I had an issue reported by a developer where their jboss connection pool wasn’t working properly. It looked good to me, so I decided to verify that everything worked in so far as connectivity from the box. So, I used the following jruby script to help:
1 2 3 4 5 6 7 8 9 10 11 12 |
require 'rubygems' require 'jdbc' require 'java' Java::oracle.jdbc.driver.OracleDriver url = "jdbc:oracle:thin:@SERVER:1521:DB" user = "user" pass = "pass" conn = java.sql.DriverManager.get_connection(url,user,pass) stmt = conn.create_statement query = "select 1 from dual" rss = stmt.execute_query(query) puts rss.next? # did we get anything? |