JDBC feature support
The Vertica JDBC driver complies with the JDBC 4.0 standards (although it does not implement all of the optional features in them). Your application can use the DatabaseMetaData
class to determine if the driver supports a particular feature it wants to use. In addition, the driver implements the Wrapper
interface, which lets your client code discover Vertica-specific extensions to the JDBC standard classes, such as VerticaConnection
and VerticaStatement
classes.
Some important facts to keep in mind when using the Vertica JDBC driver:
-
Cursors are forward only and are not scrollable. Result sets cannot be updated.
-
A connection supports executing a single statement at any time. If you want to execute multiple statements simultaneously, you must open multiple connections.
-
CallableStatement is supported as of the version 12.0.0 of the client driver.
Multiple SQL statement support
The Vertica JDBC driver can execute strings containing multiple statements. For example:
stmt.executeUpdate("CREATE TABLE t(a INT);INSERT INTO t VALUES(10);");
Only the Statement
interface supports executing strings containing multiple SQL statements. You cannot use multiple statement strings with PreparedStatement
. COPY statements that copy a file from a host file system work in a multiple statement string. However, client COPY statements (COPY FROM STDIN) do not work.
Multiple batch conversion to COPY statements
The Vertica JDBC driver converts all batch inserts into Vertica COPY statements. If you turn off your JDBC connection's AutoCommit property, the JDBC driver uses a single COPY statement to load data from sequential batch inserts which can improve load performance by reducing overhead. See Batch inserts using JDBC prepared statements for details.
JDBC version
The version of JDBC is determined by the version of the JVM. A JVM version of 8 or higher uses JDBC 4.2.
Multiple active result sets (MARS)
The Vertica JDBC driver supports Multiple active result sets (MARS). MARS allows the execution of multiple queries on a single connection. While ResultBufferSize sends the results of a query directly to the client, MARS stores the results first on the server. Once query execution has finished and all of the results have been stored, you can make a retrieval request to the server to have rows returned to the client.