Access Through JDBC

JDBC (Java Database Connectivity) is a Java API that allows executing statements on a relational database regardless of the Database Management System used.

Denodo provides a JDBC type 4 driver that implements the main characteristics of the JDBC 4.1 API (Java Database Connectivity).

You can get the Denodo JDBC driver from:

  • The Denodo Community (https://community.denodo.com/drivers/jdbc/). Download the version of the update installed in the Denodo server. To find out the version of the Denodo server you are connecting to, log in to that server with the administration tool, click the menu File > About… and look for VDP server (below installed updates).

  • Or from the installation (<DENODO_HOME>/tools/client-drivers/jdbc/vdp-jdbcdriver-core/denodo-vdp-jdbcdriver.jar).

Java Version

The JDBC driver is compatible with Java 8, 9, 10 and 11.

Driver Class Name

The class name of this driver is this:

com.denodo.vdp.jdbc.Driver

Connection URL

The syntax of the database URL is this:

Syntax of the JDBC connection URL
jdbc:denodo://<hostName>:<port>/<databaseName>[?<paramName>=<paramValue> [&<paramName>=<paramValue>]*]

Important

To use the prefix “jdbc:denodo” you need to use the Denodo JDBC driver 8.0u20210209 or newer. If you use the driver of 8.0 GA, use the prefix “jdbc:vdb”. For backward compatibility, the newer drivers also support the prefix “jdbc:vdb”.

The name of the database is mandatory.

For example:

JDBC connection URL sample
jdbc:denodo://denodo-server.acme.com:9999/admin?ssl=true&queryTimeout=100000&chunkTimeout=1000&userAgent=myApplication&autoCommit=true

If the name of the database contains non-ASCII characters, they have to be URL-encoded. For example, if the name of the database is “テスト”, the connection URL to the database will be this:

JDBC connection URL sample with non-ASCII characters
jdbc:denodo://localhost:9999/%E3%83%86%E3%82%B9%E3%83%88?queryTimeout=900000&chunkTimeout=1000&userAgent=myApplication&autoCommit=true

The path <DENODO_HOME>/samples/vdp/vdp-clients contains examples of client programs accessing Virtual DataPort through JDBC (the README file of this path explains how to generate and publish the views accessed by the clients in the example).

Backward Compatibility

Virtual DataPort is backward compatible with its JDBC driver and other clients, within the same major version. That is, to connect to a Virtual DataPort that runs with a certain update, use the JDBC driver of that update or an older update. Examples:

  • To connect to a Denodo server version 8.0 update 20210715, use the JDBC driver included in that update or an older update.

  • Do not use the JDBC driver of 8.0 20210715 to connect to a Virtual DataPort 8.0 update 20210209 or older because the driver is more recent than the server. This is an unsupported configuration; some operations may fail.

  • The JDBC driver of Denodo 8.0 GA or any 8.0 update returns an error when trying to connect to Denodo 7.0 or older.

Features of the Driver

These are some of the features of the JDBC specification supported by the Virtual DataPort JDBC driver:

  • The data types supported are defined in the VQL Guide (includes support for all basic types and for fields of the type array and register).

  • Execution of statements to query, insert, update and delete data. In addition, to create new elements such as data sources, views, etc.

  • Support for metadata description statements and listing of server catalog elements.

  • Support for PreparedStatements.

  • Support for canceling the current statement execution by using the cancel() method of the java.sql.Statement class. When a query is cancelled, the Virtual DataPort Server will cancel all current accesses to data sources and cache. After invoking the cancel method, it is still possible for the server to return some results, if these were retrieved before the source access canceling were effective. Therefore, the query cancellation does not imply closing the ResultSet that is being used.

  • Invocation of stored procedures using the CALL statement.

  • Support for submitting batches of commands.

  • The ResultSet objects returned by Virtual DataPort are not updatable (i.e. CONCUR_READ_ONLY) and have a cursor that moves forward only (i.e. TYPE_FORWARD_ONLY). In addition, the ResultSet objects are closed when the current transaction is committed (i.e. CLOSE_CURSORS_AT_COMMIT).

  • The driver implements the method ResultSet getGeneratedKeys() of the class java.sql.Statement (see Get Auto-Generated Keys in IDU Statements).

  • Support for JDBC escape syntax for timestamp, date, and time literals (see Queries with Datetime Literals).