db2.R

Uploaded by:fwild

              
library(RJDBC)

#.jinit(classpath="/data/user-data/fwild/db2jcc.jar")
.jaddClassPath("/data/user-data/fwild/db2jcc.jar")
.jaddClassPath("/data/user-data/fwild/")

#drvdb2 = JDBC("com.ibm.as400.access.AS400JDBCDriver", "/data/user-data/fwild/jt400.jar")
#drvdb2 = JDBC("com.ibm.db2.jcc.DB2Driver", "~/db2jcc.jar")
drvdb2 = JDBC("com.ibm.db2.jcc.DB2Jcc", "/data/user-data/fwild/db2jcc.jar", identifier.quote="`")

#drvm = JDBC(driverClass="com.mysql.jdbc.Driver", classPath="", identifier.quote="`")
#drvm = JDBC(driverClass="com.mysql.jdbc.Driver", classPath="/data/user-data/fwild/mysql-connector-java-5.1.22-bin.jar", identifier.quote="`")

conn = dbConnect(drvdb2, "jdbc:db2:telmap@//beuys.informatik.rwth-aachen.de:50003/PRO_MEAS")

#conn = dbConnect(drvdb2, "jdbc:db2://localhost:50000/fwild")
#conn2 = dbConnect(drvm, "jdbc:mysql://localhost/fwild", user="fwild", password="")

dbListTables(conn)
dbListTables(conn2)

conn = dbConnect(jcc, "jdbc:db2://localhost:50000/mediabase", user="yourUserName", password="yourPassword")
rs = dbSendQuery(conn, "select * from employee")
df = fetch(rs, -1)