Skip to main content

Drivers

JDBC

In JDBC, database connections are created through the standard java.sql.DriverManager class. The driver should auto-register in the DriverManager, if that does not work for some reason, you can enforce registration like so:

Class.forName("org.postgresql.Driver");

To create accio connection, call DriverManager with the JDBC URL and corresponding properties, like so:

String host = "localhost";
String port = 7432;
String dbName = "canner-cml";
String schemaName = "tpch_tiny";
String url = format("jdbc:postgresql://%s:%s/%s", host, port, dbName);

Properties props = new Properties();
props.setProperty("currentSchema", schemaName);

Connection conn = DriverManager.getConnection(url, props);

Note that dbName should be the target data source db name, and schemaName should be the target schema under data source db. While user and password is not needed since accio currently doesn’t support authentication.

ODBC (future)