Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

unable to find an inherited method for function ‘dbListFields’ for signature ‘"H2Result"’ #1

Open
menecken opened this issue Jul 30, 2015 · 1 comment

Comments

@menecken
Copy link

Hi there,

if I setup my connection like this

myH2 <- H2('org.h2.Driver', 'C:/PortablePrograms/h2/bin/h2-1.4.187.jar')
conh2 <- dbConnect(myH2, "jdbc:h2:C:/Data/database", "usr", "pw")
h2db <- src_h2(conh2)

the connection seems to work since h2db returns the correct list of tables in the database but when I try to get the data like this

myData <- h2db %>%
    tbl("BEFUND") %>%
    collect() 

I get the error

 Error in (function (classes, fdef, mtable)  :
    unable to find an inherited method for function ‘dbListFields’ for 
    signature ‘"H2Result", "missing"’ 
 Show Traceback

 Rerun with Debug
 Error in .jcall(res@stat, "V", "close") : 
  RcallMethod: attempt to call a method of a NULL object. 

Did I do something wrong? I'm an R newbie. Thank you very much in advance!

@menecken menecken changed the title no applicable method for 'select_' applied to an object of class "c('src_h2', 'src_sql', 'src')" error when querying for data Jul 30, 2015
@menecken menecken changed the title error when querying for data unable to find an inherited method for function ‘dbListFields’ for signature ‘"H2Result"’ Jul 30, 2015
@hoesler
Copy link
Owner

hoesler commented Jul 31, 2015

Hi there.

You are not doing anything obviously wrong here. Which version of RJDBC and RH2 are you using? Mine (hoesler/RJDBC and hoesler/RH2), or the CRAN versions?
Is there any particular reason for using the beta version of H2 (1.4*)? I haven't tested my R packages against it. Have you tried to access the database with the H2 version that comes shipped with RH2 like so:

src <- src_h2("C:/Data/database")

I tested your code with the nycflights13 DB and got no errors:

db <- nycflights13_h2()
myData <- db %>%
    tbl("flights") %>%
    collect()

Cheers,
Christoph

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants