skip to main content
Reference : JDBC extensions : ExtConnection interface
  

Try DataDirect Drivers Now

ExtConnection interface

The methods of this interface are supported for all drivers.
ExtConnection Methods
Description
void abortConnection()
Closes the current connection and marks the connection as closed. This method does not attempt to obtain any locks when closing the connection. If subsequent operations are performed on the connection, the driver throws an exception.
Connection createArray(String, Object[])
Supported by the Oracle driver only for use with Oracle VARRAY and TABLE data types. Creates an array object.
String getClientAccountingInfo()
Returns the accounting client information on the connection or an empty string if the accounting client information value or the connection has not been set.
If getting accounting client information is supported by the database and this operation fails, the driver throws an exception.
String getClientApplicationName()
Returns the name of the client application on the connection or an empty string if the client name value for the connection has not been set.
If getting client name information is supported by the database and this operation fails, the driver throws an exception.
String getClientHostname()
Returns the name of the host used by the client application on the connection or an empty string if the client hostname value in the database has not been set.
If getting host name information is supported by the database and this operation fails, the driver throws an exception.
String getClientUser()
Returns the user ID of the client on the connection or an empty string if the client user ID value for the connection has not been set. The user ID may be different from the user ID establishing the connection.
If getting user ID application information is supported by the database and this operation fails, the driver throws an exception.
String getCurrentUser()
Returns the current user of the connection. If reauthentication was performed on the connection, the current user may be different than the user that created the connection. For the DB2 and Oracle drivers, the current user is the same as the user reported by DatabaseMetaData.getUserName(). For the SQL Server driver, the current user is the login user name. DatabaseMetaData.getUserName() reports the user name the login user name is mapped to in the database.
int getNetworkTimeout()
Supported by the SQL Server driver to return the network timeout. The network timeout is the maximum time (in milliseconds) that a connection, or objects created by a connection, will wait for the database to reply to an application request. A value of 0 means that no network timeout exists.
See void setNetworkTimeout(int) for details about setting a network timeout.
ExtStatementPoolMonitor getStatementPoolMonitor()
Returns an ExtStatementPoolMonitor object for the statement pool associated with the connection. If the connection does not have a statement pool, this method returns null.
void resetUser(String)
Specifies a non-null string that resets the current user on the connection to the user that created the connection. It also restores the current schema, current path, or current database to the original value used when the connection was created. If reauthentication was performed on the connection, this method is useful to reset the connection to the original user.
For the SQL Server driver, the current user is the login user name.The driver throws an exception in the following circumstances:
*The driver cannot change the current user to the initial user.
*A transaction is active on the connection.
void setClientAccountingInfo(String)
Specifies a non-null string that sets the accounting client information on the connection. Some databases include this information in their usage reports. The maximum length allowed for accounting information for a particular database can be determined by calling the ExtDatabaseMetaData.getClientAccountingInfoLength() method. If the length of the information specified is longer than the maximum length allowed, the information is truncated to the maximum length, and the driver generates a warning.
If setting accounting client information is supported by the database and this operation fails, the driver throws an exception.
void setClientApplicationName(String)
Specifies a non-null string that sets the name of the client application on the connection. The maximum client name length allowed for a particular database can be determined by calling the ExtDatabaseMetaData.getClientApplicationNameLength() method. If the length of the client application name specified is longer than the maximum name length allowed, the name is truncated to the maximum length allowed, and the driver generates a warning.
If setting client name information is supported by the database and this operation fails, the driver throws an exception.
void setClientHostname(String)
Specifies a non-null string that sets the name of the host used by the client application on the connection. The maximum hostname length allowed for a particular database can be determined by calling the ExtDatabaseMetaData.getClientHostnameLength() method. If the length of the hostname specified is longer than the maximum hostname length allowed, the hostname is truncated to the maximum hostname length, and the driver generates a warning.
If setting hostname information is supported by the database and this operation fails, the driver throws an exception.
void setClientUser(String)
Specifies a non-null string that sets the user ID of the client on the connection. This user ID may be different from the user ID establishing the connection. The maximum user ID length allowed for a particular database can be determined by calling the ExtDatabaseMetaData.getClientUserLength() method. If the length of the user ID specified is longer than the maximum length allowed, the user ID is truncated to the maximum user ID length, and the driver generates a warning.
If setting user ID information is supported by the database and this operation fails, the driver throws an exception.
void setCurrentUser(String)
Specifies a non-null string that sets the current user on the connection. This method is used to perform reauthentication on a connection. For the SQL Server driver, the current user is the login user name. The driver throws an exception in the following circumstances:
*The driver is connected to a database server that does not support reauthentication.
*The database server rejects the request to change the user on the connection.
*A transaction is active on the connection.
void setCurrentUser(String, Properties)
Specifies a non-null string that sets the current user on the connection. This method is used to perform reauthentication on a connection. In addition, this method sets options that control how the driver handles reauthentication. The options that are supported depend on the driver. See the DB2 driver, Oracle driver, and SQL Server driver chapters for information on which options are supported by each driver. For the SQL Server driver, the current user is the login user name. The driver throws an exception in the following circumstances:
*The driver is connected to a database server that does not support reauthentication.
*The database server rejects the request to change the user on the connection.
*A transaction is active on the connection.
void setCurrentUser(javax.security.auth.Subject)
Specifies a non-null string that sets the current user on the connection to the user specified by the javax.security.auth.Subject object. This method is used to perform reauthentication on a connection. For the SQL Server driver, the current user is the login user name. The driver throws an exception in the following circumstances:
*The driver does not support reauthentication.
*The driver is connected to a database server that does not support reauthentication.
*The database server rejects the request to change the user on the connection.
*A transaction is active on the connection.
void setCurrentUser(javax.security.auth.Subject, Properties)
Specifies a non-null string that sets the current user on the connection to the user specified by the javax.security.auth.Subject object. This method is used to perform reauthentication on a connection. In addition, this method sets options that control how the driver handles reauthentication. The options that are supported depend on the driver. See your user's guide for information on which options are supported by each driver.
For the SQL Server driver, the current user is the login user name.
The driver throws an exception in the following circumstances:
*The driver does not support reauthentication.
*The driver is connected to a database server that does not support reauthentication.
*The database server rejects the request to change the user on the connection.
*A transaction is active on the connection.
void setNetworkTimeout(int)
Supported by the SQL Server driver to set the network timeout. The network timeout is the maximum time (in milliseconds) that a connection, or objects created by a connection, will wait for the database to reply to an application request. If this limit is exceeded, the connection or objects are closed and the driver returns an exception indicating that a timeout occurred. A value of 0 means that no network timeout exists.
Note that if a query timeout occurs before a network timeout, the execution of the statement is cancelled. Both the connection and the statement can be used. If a network timeout occurs before a query timeout or if the query timeout fails because of network problems, the connection is closed and neither the connection or the statement can be used.
boolean supportsReauthentication()
Indicates whether the connection supports reauthentication. If true is returned, you can perform reauthentication on the connection. If false is returned, any attempt to perform reauthentication on the connection throws an exception.