docs.intersystems.com
Home  /  Application Development: Language Bindings and Gateways  /  Using Java JDBC with InterSystems Products  /  JDBC Quick Reference


Using Java JDBC with InterSystems Products
JDBC Quick Reference
[Back] 
InterSystems: The power behind what matters   
Search:  


This chapter is a quick reference for the com.intersystems.jdbc package. It describes all InterSystems JDBC driver extension methods, plus any methods that include permissible variations from the JDBC standard.
Note:
This chapter lists only extension methods and variant methods. See JDBC Driver Support in the InterSystems IRIS Implementation Reference for Java Third Party APIs for a complete description of all InterSystems JDBC driver features.
This chapter provides details of methods in the following classes. All of these classes are fully implemented, but they also contain extension methods and variant methods:
java.sql.CallableStatement
In addition to the methods defined by the interface, this class also includes the following InterSystems IRIS-specific extension method:
getBinaryStream()
Extension method CallableStatement.getBinaryStream() returns the value of query parameter i as a java.io.InputStream object.
java.io.InputStream getBinaryStream(int i)
java.sql.Connection
The following java.sql.Connection methods vary from the JDBC standard due to InterSystems IRIS-specific support for various parameter options.
prepareCall()
Variant method Connection.prepareCall()
java.sql.CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
java.sql.CallableStatement prepareCall prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
setReadOnly()
Variant method Connection.setReadOnly()
void setReadOnly(Boolean readOnly)
setCatalog()
Variant method Connection.setCatalog()
void setCatalog(String catalog)
setTransactionIsolation()
Variant method Connection.setTransactionIsolation()
void setTransactionIsolation(int level)
createStatement()
Variant method Connection.createStatement()
java.sql.Statement createStatement(int resultSetType, int result, int resultSetHoldability)
prepareStatement()
Variant method Connection.prepareStatement()
java.sql.PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
java.sql.PreparedStatement prepareStatement(String sql, int[] columnIndexes)
java.sql.PreparedStatement prepareStatement(String sql, String[] columnNames)
setHoldability()
Variant method Connection.setHoldability()
void setHoldability(int holdability)
java.sql.DatabaseMetaData
Class java.sql.DatabaseMetaData is fully supported, but the following methods vary from the JDBC standard due to InterSystems IRIS-specific handling of their return values.
supportsMixedCaseQuotedIdentifiers()
Variant method DatabaseMetaData.supportsMixedCaseQuotedIdentifiers() returns false, which is not JDBC compliant.
boolean supportsMixedCaseQuotedIdentifiers()
getIdentifierQuoteString()
Variant method DatabaseMetaData.getIdentifierQuoteString() returns a space (which is not JDBC compliant) if delimited id support is off. It returns a JDBC compliant " (double quote character) if delimited id support is on.
String getIdentifierQuoteString()
java.sql.ResultSet
The java.sql.ResultSet class is fully implemented, but one optional method is supported with restrictions.
setFetchDirection()
Optional method ResultSet.setFetchDirection() is implemented with restrictions:
void setFetchDirection(int direction)
Instead, use afterLast to move the result set's cursor to after the last row, and use previous to scroll backwards.
java.sql.Statement
Class java.sql.Statement is fully implemented, but several optional methods have restrictions or limitations.
getResultSetHoldability()
Optional method Statement.getResultSetHoldability()
int getResultSetHoldability()
This method supports only HOLD_CURSORS_OVER_COMMIT.
setCursorName()
Optional method Statement.setCursorName()
void setCursorName(String name)
This method is a no-op.
setEscapeProcessing()
Optional method Statement.setEscapeProcessing()
void setEscapeProcessing(Boolean enable)
This method is a no-op.
setFetchDirection()
Optional method Statement.setFetchDirection()
void setFetchDirection(int direction)
Instead, use afterLast to move the result set's cursor to after the last row, and use previous to scroll backwards.
execute()
Optional method Statement.execute()
boolean execute(String sql, int[] columnIndexes)
boolean execute(String sql, String[] columnNames)
This method throws an exception if columnIndexes or columnNames do not have array lengths equal to one. InterSystems IRIS currently supports only zero or one Auto Generated Keys.
executeUpdate()
Optional method Statement.executeUpdate()
int executeUpdate(String sql, int[] columnIndexes)
int executeUpdate(String sql, String[] columnNames)
This method throws an exception if columnIndexes or columnNames do not have array lengths equal to one. InterSystems IRIS currently supports only zero or one Auto Generated Keys.
javax.sql.ConnectionPoolDataSource
In addition to the methods defined by the interface, ConnectionPoolDataSource also includes the following InterSystems IRIS specific methods to control connection pooling:
getMaxPoolSize()
Extension method ConnectionPoolDataSource.getMaxPoolSize() returns an int representing the current maximum connection pool size.
int getMaxPoolSize()
getPoolCount()
Extension method ConnectionPoolDataSource.getPoolCount() returns an int representing the current number of entries in the connection pool.
int getPoolCount()
getPooledConnection()
Always use DataSource.getConnection() instead of this method.
Do not call this method
ConnectionPoolDataSource.getPooledConnection() is required by the interface, but should never be invoked directly. The JDBC driver controls connection pooling transparently.
restartConnectionPool()
Extension method ConnectionPoolDataSource.restartConnectionPool() restarts a connection pool. Closes all physical connections, and empties the connection pool.
void restartConnectionPool()
setMaxPoolSize()
Extension method ConnectionPoolDataSource.setMaxPoolSize() sets a maximum connection pool size. If the maximum size is not set, it defaults to 40.
void setMaxPoolSize(int max)
javax.sql.DataSource
The javax.sql.DataSource interface is fully implemented in com.intersystems.jdbc.IRISDataSource class. This class also provides additional InterSystems IRIS-specific extension methods and extended functionality in one required method, as described below. This class does not inherit the methods of javax.sql.CommonDataSource, which is not supported by the InterSystems JDBC driver.
The extension methods listed here are getters and setters for various InterSystems connection properties. See Setting Connection Properties for details and a complete list of properties.
getConnection()
Required Method with Extended Functionality
Required method DataSource.getConnection() returns a java.sql.Connection. This method must always be used to obtain InterSystems IRIS driver connections. The InterSystems IRIS driver also provides pooling transparently through the java.sql.Connection object that getConnection() returns.
java.sql.Connection getConnection()
java.sql.Connection getConnection(String usr,String pwd)
This method provides pooling, and must always be used in place of getPooledConnection() and the methods of the PooledConnection class (see ConnectionPoolDataSource Extension Methods for more information).
getConnectionSecurityLevel()
Extension property accessor DataSource.getConnectionSecurityLevel() returns an int representing the current Connection Security Level setting. Also see setConnectionSecurityLevel().
int getConnectionSecurityLevel()
getDatabaseName()
Extension property accessor DataSource.getDatabaseName() returns a String representing the current database (InterSystems IRIS namespace) name. Also see setDatabaseName().
String getDatabaseName()
getDataSourceName()
Extension property accessor DataSource.getDataSourceName() returns a String representing the current data source name. Also see setDataSourceName().
String getDataSourceName()
getDefaultTransactionIsolation()
Extension property accessor DataSource.getDefaultTransactionIsolation() returns an int representing the current default transaction isolation level. Also see setDefaultTransactionIsolation().
int getDefaultTransactionIsolation()
getDescription()
Extension property accessor DataSource.getDescription() returns a String representing the current description. Also see setDescription().
String getDescription()
getEventClass()
Extension property accessor DataSource.getEventClass() returns a String representing an Event Class object. Also see setEventClass().
String getEventClass()
getKeyRecoveryPassword()
Extension property accessor DataSource.getKeyRecoveryPassword() returns a String representing the current Key Recovery Password setting. Also see setKeyRecoveryPassword().
String getKeyRecoveryPassword()
getNodelay()
Extension property accessor DataSource.getNodelay() returns a boolean representing a current TCP_NODELAY option setting. Also see setNodelay().
boolean getNodelay()
getPassword()
Extension property accessor DataSource.getPassword() returns a String representing the current password. Also see setPassword().
String getPassword()
getPortNumber()
DataSource.getPortNumber() returns an int representing the current port number. Also see setPortNumber().
int getPortNumber()
getServerName()
Extension property accessor DataSource.getServerName() returns a String representing the current server name. Also see setServerName().
String getServerName()
getServicePrincipalName()
Extension property accessor DataSource.getServicePrincipalName() returns a String representing the current Service Principal Name setting. Also see setServicePrincipalName().
String getServicePrincipalName()
getSSLConfigurationName()
Extension property accessor DataSource.getSSLConfigurationName() returns a String representing the current SSL Configuration Name setting. Also see setSSLConfigurationName().
String getSSLConfigurationName()
getURL()
Extension property accessor DataSource.getURL() returns a String representing a current URL for this object. Also see setURL().
String getURL()
getUser()
Extension property accessor DataSource.getUser() returns a String representing the current username. Also see setUser().
String getUser()
setConnectionSecurityLevel()
Extension property accessor DataSource.setConnectionSecurityLevel() sets the connection security level for this object. Also see setConnectionSecurityLevel().
void setConnectionSecurityLevel(int level)
setDatabaseName()
Extension property accessor DataSource.setDatabaseName() sets the database name (InterSystems IRIS namespace) for this object. Also see getDatabaseName().
void setDatabaseName(String dn)
setDataSourceName()
Extension property accessor DataSource.setDataSourceName() sets the data source name for this object. DataSourceName is an optional setting and is not used to connect. Also see getDataSourceName().
void setDataSourceName(String dsn)
setDefaultTransactionIsolation()
Extension property accessor DataSource.setDefaultTransactionIsolation() sets the default transaction isolation level. Also see getDefaultTransactionIsolation().
void setDefaultTransactionIsolation(int level)
setDescription()
Extension property accessor DataSource.setDescription() sets the description for this object. Description is an optional setting and is not used to connect. Also see getDescription().
void setDescription(String d)
setEventClass()
Extension property accessor DataSource.setEventClass() sets the Event Class for this object. The Event Class is a mechanism specific to InterSystems IRIS JDBC. It is completely optional, and the vast majority of applications will not need this feature. Also see getEventClass().
void setEventClass(String e)
The InterSystems JDBC server will dispatch to methods implemented in a class when a transaction is about to be committed and when a transaction is about to be rolled back. The class in which these methods are implemented is referred to as the “event class.” If an event class is specified during login, then the JDBC server will dispatch to %OnTranCommit just prior to committing the current transaction and will dispatch to %OnTranRollback just prior to rolling back (aborting) the current transaction. User event classes should extend %ServerEvent. The methods do not return any values and cannot abort the current transaction.
setKeyRecoveryPassword()
Extension property accessor DataSource.setKeyRecoveryPassword() sets the Key Recovery Password for this object. Also see getKeyRecoveryPassword().
void setKeyRecoveryPassword(java.lang.String password) 
setLogFile()
Extension property accessor DataSource.setLogFile() unconditionally sets the log file name for this object.
void setLogFile(java.lang.String logFile)
setNodelay()
Extension property accessor DataSource.setNodelay() sets the TCP_NODELAY option for this object. Toggling this flag can affect the performance of the application. If not set, it defaults to true. Also see getNodelay().
void setNodelay(boolean nd)
setPassword()
Extension property accessor DataSource.setPassword() sets the password for this object. Also see getPassword().
void setPassword(String p)
setPortNumber()
Extension property accessor DataSource.setPortNumber() sets the port number for this object. Also see getPortNumber().
void setPortNumber(int pn)
setServerName()
Extension property accessor DataSource.setServerName() sets the server name for this object. Also see getServerName().
void setServerName(String sn)
setServicePrincipalName()
Extension property accessor DataSource.setServicePrincipalName() sets the Service Principal Name for this object. Also see getServicePrincipalName().
void setServicePrincipalName(String name)
setSSLConfigurationName()
Extension property accessor DataSource.setSSLConfigurationName() sets the SSL Configuration Name for this object. Also see getSSLConfigurationName().
void setSSLConfigurationName(java.lang.String name)
setURL()
Extension property accessor DataSource.setURL() sets the URL for this object. Also see getURL().
void setURL(String u)
setUser()
Extension property accessor DataSource.setUser() sets the username for this object. Also see getUser().
void setUser(String u)