I'm trying to write a jruby script that connects to an oracle database using jdbc.
Thusfar I've got:
require 'rubygems'
require 'jdbc_adapter'
require 'active_record'
require 'active_record/version'
ActiveRecord::Base.establish_connection(
:adapter => 'jdbc',
:driver => 'oracle.jdbc.driver.OracleDriver',
:url => 'jdbc:oracle:thin:@mydatabase:1521:mydb',
:user => "user",
:password => "password"
)
ActiveRecord::Base.connection.execute("SELECT * FROM MYTABLE")
The error I'm getting: C:/Program Files/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:326:in `initialize': The driver encountered an error: java.sql.SQLException: invalid arguments in call (RuntimeError)
Suggestions?