Ruby Forum JRuby > Active-Record JDBC Driver

Posted by Partogi, Joshua (Guest)
on 06.05.2008 14:27
(Received via mailing list)
Dear all,

I am evaluating the usage of Active-Record JDBC, but I received this 
error:

RuntimeError in SurveysController#new

The driver encountered an error: cannot load Java class
net.sourceforge.jtds.jdbc.Driver

RAILS_ROOT: D:/workspace/project/teaser

Application Trace <http://localhost:3000/surveys/new#> | Framework Trace
<http://localhost:3000/surveys/new#> | Full Trace
<http://localhost:3000/surveys/new#>
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.8/
lib/active_record/connection_adapters/jdbc_adapter.rb:307:in 
`initialize'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.8/
lib/active_record/connection_adapters/jdbc_adapter.rb:46:in `new'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.8/
lib/active_record/connection_adapters/jdbc_adapter.rb:46:in
`jdbc_connection'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_
record/connection_adapters/abstract/connection_specification.rb:291:in
`connection='
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_
record/connection_adapters/abstract/connection_specification.rb:259:in
`retrieve_connection'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_
record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_
record/query_cache.rb:8:in `cache'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_co
ntroller/caching.rb:677:in `perform_action_with_caching'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_co
ntroller/base.rb:524:in `process'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_co
ntroller/filters.rb:685:in `process_with_filters'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_co
ntroller/session_management.rb:123:in
`process_with_session_management_support'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_co
ntroller/base.rb:388:in `process'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_co
ntroller/dispatcher.rb:171:in `handle_request'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_co
ntroller/dispatcher.rb:115:in `dispatch'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_co
ntroller/dispatcher.rb:126:in `dispatch_cgi'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_co
ntroller/dispatcher.rb:9:in `dispatch'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/mongrel-1.1.4-java/lib/mongrel
/rails.rb:76:in `process'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/mongrel-1.1.4-java/lib/mongrel
/rails.rb:74:in `synchronize'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/mongrel-1.1.4-java/lib/mongrel
/rails.rb:74:in `process'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/mongrel-1.1.4-java/lib/mongrel
.rb:159:in `process_client'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/mongrel-1.1.4-java/lib/mongrel
.rb:158:in `each'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/mongrel-1.1.4-java/lib/mongrel
.rb:158:in `process_client'
D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/mongrel-1.1.4-java/lib/mongrel
.rb:285:in `run'
...


Where do I install the respected Jdbc driver to make it work?

Thanks in advance

IMPORTANT NOTICE:
The information in this email (and any attachments) is confidential. If 
you are not the intended recipient, you must not use or disseminate the 
information. If you have received this email in error, please 
immediately notify me by "Reply" command and permanently delete the 
original and any copies or printouts thereof.  Although this email and 
any attachments are believed to be free of any virus or other defect 
that might affect any computer system into which it is received and 
opened, it is the responsibility of the recipient to ensure that it is 
virus free and no responsibility is accepted by American International 
Group, Inc. or its subsidiaries or affiliates either jointly or 
severally, for any loss or damage arising in any way from its use.
Posted by Matthew Williams (mdweezer)
on 06.05.2008 16:49
(Received via mailing list)
What's your database back end?  You'll need that adapter installed.

So if you're using Postgres you would need the
activerecord-jdbcpostgresql-adapter gem installed.

Then in your database config you would simply use "jdbcpostgresql" as
your adapter name.

Good luck
-MW

On Tue, May 6, 2008 at 8:24 AM, Partogi, Joshua <Joshua.Partogi@aig.com> 
wrote:
> net.sourceforge.jtds.jdbc.Driver
> D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.8/lib/active_record/connection_adapters/jdbc_adapter.rb:46:in
>
> `process'
> D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in
>
> `process_client'
>
> believed to be free of any virus or other defect that might affect any
> computer system into which it is received and opened, it is the
> responsibility of the recipient to ensure that it is virus free and no
> responsibility is accepted by American International Group, Inc. or its
> subsidiaries or affiliates either jointly or severally, for any loss or
> damage arising in any way from its use.
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Juan Pablo (Guest)
on 06.05.2008 17:05
(Received via mailing list)
You can also put the JDBC driver in your rail's lib folder. You can also
put it in Jruby's lib folder. Either one should allow jruby to find it.

Matthew Williams wrote:
>
>> net.sourceforge.jtds.jdbc.Driver
>> D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.8/lib/active_record/connection_adapters/jdbc_adapter.rb:46:in
>>
>> `process'
>> D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in
>>
>> `process_client'
>>
>> believed to be free of any virus or other defect that might affect any
>
>     http://xircles.codehaus.org/manage_email
>
>
>
>
>   



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Nick Sieger (Guest)
on 06.05.2008 18:22
(Received via mailing list)
If you put it in your application, you'll need to "require
'jdbc-driver-name.jar'" inside your application to get it loaded. Your
other option is to put the path to it in the CLASSPATH environment
variable before you start JRuby.

/Nick

On Tue, May 6, 2008 at 9:05 AM, Juan Pablo
<jtarquino@westwoodchristian.org> wrote:
> > activerecord-jdbcpostgresql-adapter gem installed.
> >
> > >
> > >
> > >
> > > `cache'
> D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in
> > >
> > >
> > > `synchronize'
> D:/javastuff/jruby-1.1/lib/ruby/gems/1.8/gems/mongrel-1.1.4-java/lib/mongrel.rb:158:in
> > >
> > > notify me by "Reply" command and permanently delete the original and any
> >
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email