IBM WebSphere Application ServerTM
Release 7

com.ibm.websphere.rsadapter
Interface WSConnection

All Superinterfaces:
java.sql.Connection, java.sql.Wrapper

public interface WSConnection
extends java.sql.Connection

Interface which enables an application to call certain methods on a connection.


Field Summary
static java.lang.String CLIENT_ACCOUNTING_INFO
          The key used to set the CLIENT_ACCOUNTING_INFO in the properties object passed by the user in setClientInformation().
static java.lang.String CLIENT_APPLICATION_NAME
          The key used to set the CLIENT_APPLICATION_NAME in the properties object passed by the user in setClientInformation().
static java.lang.String CLIENT_ID
          The key used to set the CLIENT_ID in the properties object passed by the user in setClientInformation().
static java.lang.String CLIENT_LOCATION
          The key used to set the CLIENT_LOCATION in the properties object passed by the user in setClientInformation().
static java.lang.String CLIENT_OTHER_INFO
          The key used to set the CLIENT_OTHER_INFO in the properties object passed by the user in setClientInformation().
static java.lang.String CLIENT_TYPE
          The key used to set the CLIENT_TYPE in the properties object passed by the user in setClientInformation().
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Method Summary
 java.util.Properties getClientInformation()
          This API returns the properties object set using setClientInformation()
 WSSystemMonitor getSystemMonitor()
          This method returns the System Monitor object from the backend database connection if the database supports System Monitors.
 void setClientInformation(java.util.Properties props)
          This API allows you to set client information on the WebSphere connection.
 
Methods inherited from interface java.sql.Connection
clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Field Detail

CLIENT_ACCOUNTING_INFO

static final java.lang.String CLIENT_ACCOUNTING_INFO
The key used to set the CLIENT_ACCOUNTING_INFO in the properties object passed by the user in setClientInformation(). The information set by this key will also be passed to DB2.

See Also:
setClientInformation(Properties), Constant Field Values

CLIENT_LOCATION

static final java.lang.String CLIENT_LOCATION
The key used to set the CLIENT_LOCATION in the properties object passed by the user in setClientInformation(). The information set by this key will also be passed to DB2.

See Also:
setClientInformation(Properties), Constant Field Values

CLIENT_ID

static final java.lang.String CLIENT_ID
The key used to set the CLIENT_ID in the properties object passed by the user in setClientInformation(). The information set by this key will also be passed to DB2 and Oracle.

See Also:
setClientInformation(Properties), Constant Field Values

CLIENT_APPLICATION_NAME

static final java.lang.String CLIENT_APPLICATION_NAME
The key used to set the CLIENT_APPLICATION_NAME in the properties object passed by the user in setClientInformation(). The information set by this key will also be passed to DB2.

See Also:
setClientInformation(Properties), Constant Field Values

CLIENT_OTHER_INFO

static final java.lang.String CLIENT_OTHER_INFO
The key used to set the CLIENT_OTHER_INFO in the properties object passed by the user in setClientInformation(). This value will not be passed to the backend database. Instead, it will be traced along with the connection information in WebSphere.

See Also:
setClientInformation(Properties), Constant Field Values

CLIENT_TYPE

static final java.lang.String CLIENT_TYPE
The key used to set the CLIENT_TYPE in the properties object passed by the user in setClientInformation().
This key identifies the client type (e.g. "JMS", "NON_JMS", "USER_ALPHA", ...).
Note: User defined client type must begin with the prefix "USER_", failure to do that may result in unpredictable behavior.

See Also:
setClientInformation(Properties), Constant Field Values
Method Detail

setClientInformation

void setClientInformation(java.util.Properties props)
                          throws java.sql.SQLException
This API allows you to set client information on the WebSphere connection. Some of the client information will be passed on to the backend database if that database supports such functionality.

Example:


import com.ibm.websphere.rsadapter.WSConnection;
.....
try {
  InitialContext ctx = new InitialContext();
  // Perform a naming service lookup to get the DataSource object.
  DataSource ds = (javax.sql.DataSource)ctx.lookup("java:comp/jdbc/myDS");
} catch (Exception e) {;}

WSConnection conn = (WSConnection) ds.getConnection();
Properties props = new properties();
props.setProperty(WSConnection.CLIENT_ID, "user123");
props.setProperty(WSConnection.CLIENT_LOCATION, "127.0.0.1");
props.setProperty(WSConnection.CLIENT_ACCOUNTING_INFO , "accounting1");
props.setProperty(WSConnection.CLIENT_APPLICATION_NAME, "appname");
props.setProperty(WSConnection.CLIENT_TYPE, "JMS");
props.setProperty(WSConnection.CLIENT_OTHER_INFO, "cool stuff");
conn.setClientInformation(props);
conn.close();

Parameters:
props - contains the client information to be passed, possible values are:
  • WSConnection.CLIENT_ACCOUNTING_INFO
  • WSConnection.CLIENT_LOCATION
  • WSConnection.CLIENT_ID
  • WSConnection.CLIENT_APPLICATION_NAME
  • WSConnection.CLIENT_TYPE
  • WSConnection.CLIENT_OTHER_INFO

Refer to the WSConnection documentation for more details on which client information is passed to the backend database.
To reset the client Information, call the method with a null parameter .
Throws:
java.sql.SQLException - thrown if database throws an exception when setting the data
Since:
WebSphere Application Server 6.0

getClientInformation

java.util.Properties getClientInformation()
This API returns the properties object set using setClientInformation()

Returns:
java.util.Properties
Since:
WebSphere Application Server 6.0

getSystemMonitor

WSSystemMonitor getSystemMonitor()
                                 throws java.sql.SQLException
This method returns the System Monitor object from the backend database connection if the database supports System Monitors.

Returns:
com.ibm.websphere.rsadapter.WSSystemMonitor if database supports System Monitors, null otherwise
Throws:
java.sql.SQLException - if the database throws an exception
Since:
WebSphere Application Server 6.0

IBM WebSphere Application ServerTM
Release 7