tags:

views:

398

answers:

1

How do you access SQLite3 via JDBC without using active record?

+1  A: 

Install the jdbc-sqlite3 gem

Then, in your jruby script:

require 'jdbc/sqlite3'
url = "jdbc:sqlite:path.to.your.db"
begin        
    Java::org.sqlite.JDBC #initialize the driver
    connection = JavaLang::DriverManager.getConnection(url) #grab your connection
rescue => error      
    #handle error
end
Samuel Holloway