SonicBase. In-memory embedded or distributed streaming sql database

JDBC Driver

The SonicBase jdbc jar is available from the Maven Central repository. If you are using maven, add the jdbc jar to your project pom.xml file. In the dependencies section add the following:

The jdbc version should match your SonicBase server version.


JDK Requirements

The jvm running the jdbc driver needs to be at least version 8.


Include the following line before creating a connection:

Connect to the database with the following code:
    Connection conn = DriverManager.getConnection("jdbc:sonicbase:<address-0>:<port-0>,<address-1>:<port-1><address-n>:<port-n>/<database name>");

"address-0" thru "address-n" should be the ip addresses of all the replicas of shard 0. Enter all the replicas of the first shard configured in the config file for this cluster. Note that each address/port combination is separated by a comma.

Connection Pool

C3P0 is a good connection pool to use. Below is an example of how to use it:

ComboPooledDataSource cpds = new ComboPooledDataSource();

cpds.setMinPoolSize(5); cpds.setAcquireIncrement(1); cpds.setMaxPoolSize(20);
//aquire connection Connection conn = cpds.getConnection();
//release connection conn.close();