-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
Here is a discrepancy between pre2 and rc1.
Working pre2
$ rvm use jruby-9.0.0.0.pre2
Using /usr/local/rvm/gems/jruby-9.0.0.0.pre2
$ jruby -S ./bin/sybase_bug.rb
# ... connects and dumps rows from db
Broken rc1
$ rvm use jruby-9.0.0.0.rc1
Using /usr/local/rvm/gems/jruby-9.0.0.0.rc1
$ jruby -S ./bin/sybase_bug.rb
java/sql/DriverManager.java:596:in `getConnection': java.sql.SQLException: No suitable driver found for jdbc:sybase:Tds:chrcnc-netcool-aos-01.oss.twc.net:4100/alerts
from java/sql/DriverManager.java:215:in `getConnection'
from java/lang/reflect/Method.java:606:in `invoke'
from ./bin/sybase_bug.rb:12:in `<top>’
The files
$ ls
jconn3.jar sybase_bug.rb
The Code
require 'jconn3.jar’
require ‘pp’
# load the driver
Java::com.sybase.jdbc3.jdbc.SybDriver
uri = "jdbc:sybase:Tds:foo.com:4100/dbname"
sybase = java.sql.DriverManager.get_connection(uri, "user", "pass")
sql = "SELECT TOP 10 * FROM dbname.status"
dbh = sybase.create_statement
res = dbh.execute_query(sql)
while res.next do
h = Hash.new
h[:id] = res.getObject("identifier")
h[:sev] = res.getObject("severity")
pp h
end
Reactions are currently unavailable