andrey
2008-Feb-18 20:44 UTC
"java.sql.SQLException: invalid arguments in call" using Oracle config with JRoR
Hi, All, J. Ruby Newbie here. I''m trying to get JRuby on Rails to start using Oracle, but I get "The driver encountered an error: java.sql.SQLException: invalid arguments in call". I''ve got the driver jar in the right place, because it can find OracleDriver. The trace complains about: C:/jruby/lib/ruby/gems/1.8/gems/ActiveRecord-JDBC-0.5/lib/ active_record/connection_adapters/jdbc_adapter.rb, and by doing puts I find that Jdbc::DriverManager.getConnection(url, user, pass) throws an exception, and the rescue code jdbc_driver.create.connect(url, props) throws another exception. My database.yml: ... development: adapter: jdbc driver: oracle.jdbc.driver.OracleDriver url: jdbc:oracle:thin:@localhost:1521:orcl user: rubydevel password: rubydevel I can create a connection with Java just dandy: Class.forName("oracle.jdbc.driver.OracleDriver"); Connection dbConnection=DriverManager.getConnection( "jdbc:oracle:thin:@localhost:1521:orcl","rubydevel","rubydevel"); I''m lost. Has anyone come across this? Thanks, Andrey --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
andrey
2008-Feb-18 21:45 UTC
Re: "java.sql.SQLException: invalid arguments in call" using Oracle config with JRoR
Ok. This appears to be a failure of communication between database.yml and the jdbc_adapter.rb. jdbc_adapter expects the driver param to be named "username" while all the database.ymls expect the param name user: def configure_jdbc driver = @config[:driver].to_s user = @config[:username].to_s pass = @config[:password].to_s url = @config[:url].to_s Should this be the symbol :user? Is there a standard? On Feb 18, 1:44 pm, andrey <andrey.yea...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, All, J. Ruby Newbie here. > > I''m trying to get JRuby on Rails to start using Oracle, but I get "The > driver encountered an error: java.sql.SQLException: invalid arguments > in call". I''ve got the driver jar in the right place, because > it can find OracleDriver. > > The trace complains about: > > C:/jruby/lib/ruby/gems/1.8/gems/ActiveRecord-JDBC-0.5/lib/ > active_record/connection_adapters/jdbc_adapter.rb, > > and by doing puts I find that > Jdbc::DriverManager.getConnection(url, user, pass) throws an > exception, > and the rescue code > jdbc_driver.create.connect(url, props) > throws another exception. > > My database.yml: > ... > development: > adapter: jdbc > driver: oracle.jdbc.driver.OracleDriver > url: jdbc:oracle:thin:@localhost:1521:orcl > user: rubydevel > password: rubydevel > > I can create a connection with Java just dandy: > > Class.forName("oracle.jdbc.driver.OracleDriver"); > Connection dbConnection=DriverManager.getConnection( > "jdbc:oracle:thin:@localhost:1521:orcl","rubydevel","rubydevel"); > > I''m lost. Has anyone come across this? > > Thanks, > > Andrey--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---