basho-labs / Riak-TS-JDBC-Driver

JDBC client for Basho's Riak TS database (http://docs.basho.com/riak/ts/), see https://github.com/cvitter/Riak-TS-JDBC-Driver/tree/master/riakts.jdbc.driver for documentation.
Apache License 2.0
10 stars 2 forks source link

java.sql.SQLException: No suitable driver found for riakts://127.0.0.1:8087 #11

Closed cvitter closed 8 years ago

cvitter commented 8 years ago

The following code in riakts.jdbc.driver.test.ExternalDriverTest: conn = (Connection) DriverManager.getConnection(DB_URL);

Throws the following error: java.sql.SQLException: No suitable driver found for riakts://127.0.0.1:8087

The code is able to connect to the database using the following means of connecting: Driver d = new Driver(); conn = (Connection) d.connect(DB_URL, null);

cvitter commented 8 years ago

Added the following code to riakts.jdbc.driver.Driver: static { try { DriverManager.registerDriver(new Driver()); } catch (SQLException e) { } }

This corrected the error in the test.