I'm having no luck, but I'm not very familiar with the subtleties I'm dealing with here.
One thought: Could this have to do with the fact that the Java class name starts with a lower-case letter? It is org.hsqldb.jdbcDriver. I'm wondering if JRuby's assumptions about CamelCasing Java packages and such could be preventing it from ever referencing a class named jdbcDriver, as opposed to JdbcDriver. Do you think that could be an issue? If so, can you suggest a workaround? If you don't think that's an issue, would you mind trying to connect to HSQLDB (http://hsqldb.org) with Sequel? It would not surprise me if I'm just misunderstanding how to get the gems and requires just so. Would you expect me to need the jdbc-hsqldb gem? Thanks for any guidance!, Lee On Dec 29, 1:17 pm, Jeremy Evans <[email protected]> wrote: > On Dec 28, 8:30 am, greymatter <[email protected]> wrote: > > > > > I'm trying to embed HSQL into an application written in JRuby using > > Sequel, but I'm not having much luck. My first question is should I > > be able to do this? And if so, why isn't the driver being found when > > I'm explicitly requiring it? > > > This simple code... > > > require 'sequel' > > require 'C:/sw/hsqldb/lib/hsqldb.jar' > > > $transientdb = Sequel.connect('jdbc:hsqldb:mem:testmem') if > > $transientdb == nil > > $permanentdb = Sequel.connect('jdbc:hsqldb:file:testfile') if > > $permanentdb == nil > > puts $transientdb.inspect > > puts $permanentdb.inspect > > > class Call < Sequel::Model($transientdb[:calls]) > > set_schema do > > primary_key :id > > varchar :name > > end > > end > > > Results in this output... > > > #<Sequel::JDBC::Database: "jdbc:hsqldb:mem:testmem"> > > #<Sequel::JDBC::Database: "jdbc:hsqldb:file:testfile"> > > java/sql/DriverManager.java:602:in `getConnection': > > java.sql.SQLException: No suitable driver found for > > jdbc:hsqldb:mem:testmem (NativeException) > > This error appears to be originating from outside of Sequel. Sequel > just passes the JDBC connection string directly to getConnection > (which is raising the error). On a hunch, try referencing the java > HSQL connection class after requiring the jar, that may fix things. > If that doesn't work, can you see if you can get HSQL working outside > of Sequel? If so, it would be a lot easier to determine if Sequel is > doing something incorrectly. > > Jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
