Error:
jruby-1.6.7 :014 > DB = Sequel.connect('jdbc:mysql://root:@localhost/table_saver_dev?user=root')
=> #<Sequel::JDBC::Database: "jdbc:mysql://root:@localhost/table_saver_dev?user=root">
jruby-1.6.7 :015 > DB[:restaurants].all
Sequel::DatabaseConnectionError: NativeException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "@localhost"'.
NativeException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "@localhost"'.
Cause:
Looks like Sequel jdbc adapter is expecting a different format for connection uri. While Sequel doc implies that all document Sequel uri formats are valid, it didn't seem to be the case with JDBC.
Error: jruby-1.6.7 :014 > DB = Sequel.connect('jdbc:mysql://root:@localhost/table_saver_dev?user=root') => #<Sequel::JDBC::Database: "jdbc:mysql://root:@localhost/table_saver_dev?user=root"> jruby-1.6.7 :015 > DB[:restaurants].all Sequel::DatabaseConnectionError: NativeException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "@localhost"'. NativeException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "@localhost"'.
Cause: Looks like Sequel jdbc adapter is expecting a different format for connection uri. While Sequel doc implies that all document Sequel uri formats are valid, it didn't seem to be the case with JDBC.
Works: I found the following uri format works:
adapter = 'jdbc:mysql' host = 'localhost' database = 'table_saver_dev' username = 'root' password = ""