
# how to use RJDBC directly (some RH2 capability missing if done this way)

h2.jar <- dir(system.file("java", package = "RH2"), full = TRUE)
drv <- JDBC("org.h2.Driver", h2.jar)

conn <- dbConnect(drv, "jdbc:h2:mem:")

res <- dbWriteTable(conn, "BOD", BOD)
res

dbGetQuery(conn, "select * from BOD")

r <- dbSendQuery(conn, "select * from BOD limit 3")
fetch(r, -1)
r@stat

.jcall(r@stat, "V", "close")

dbDisconnect(conn)
