Skip to content

SQLite3 No suitable driver #1130

@ccmywish

Description

@ccmywish

Hi,

I'm trying this script, but it failed. I've referred to many scripts:

  1. https://github.com/flum1025/jruby_sqlite3/blob/3c8f677b97592a81f2f4fdf38d7241f64391faf6/lib/jruby_sqlite3/jruby_sqlite3.rb#L15
  2. https://github.com/jeremyevans/sequel/blob/41e621fe1051441cf61d009bb76e3f7f7411f3b8/lib/sequel/adapters/jdbc/sqlite.rb#LL3C54-L3C54
  3. https://github.com/jruby/jruby/wiki/JDBC
require 'jdbc/sqlite3'

Jdbc::SQLite3.load_driver
Java::org.sqlite.JDBC

url = "jdbc:sqlite:test.db"
con = java.sql.DriverManager.get_connection url
#=> No suitable driver found for jdbc:sqlite3:test.db (Java::JavaSql::SQLException)

Even the https://rubygems.org/gems/jdbc-sqlite3 description said we only need Jdbc::SQLite3.load_driver to load the driver.

What am I missing? (I'm not interested using sequel or active_record now, I just want to try the driver directly). Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions