## create an Oracle instance and create one connection.
drv <- dbDriver("Oracle")
## use username/password authentication
con <- dbConnect(drv, username = "scott", password = "tiger")
## run an SQL statement by creating first a resultSet object
rs <- dbSendQuery(con, "select * from emp where deptno = 10")
## we now fetch records from the resultSet into a data.frame
data <- fetch(rs) ## extract all rows
dim(data)
## create an Oracle instance and create one connection.
drv <- dbDriver("Oracle")
## use Oracle wallet authentication
con <- dbConnect(drv, username ="", password="",
dbname = "<wallet_connect_string>")
## run an SQL statement by creating first a resultSet object
rs <- dbSendQuery(con, "select * from emp where deptno = 10")
## we now fetch records from the resultSet into a data.frame
data <- fetch(rs) ## extract all rows
dim(data)
Run the code above in your browser using DataLab