|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.btt.base.Service
com.ibm.btt.services.BTTServiceRequester
com.ibm.btt.services.PooledServiceRequester
com.ibm.btt.services.jdbcservicesinfra.JDBCService
The JDBCService provides the implementation of the DatabaseConnect interface. All JDBC services extend from this class inheriting all methods related to connecting to a database.
Field Summary | |
---|---|
protected java.sql.PreparedStatement |
addPstmt
Keeps the preparedStatement attribute value. |
protected java.lang.String |
addString
Keeps the SQL sentence used when adding a records. |
protected boolean |
autoCommit
Keeps the commit criteria the JDBCTable service must follow. |
protected Hashtable |
connectionProperties
Keeps the details of the connection being used by the service. |
protected java.sql.Connection |
databaseConnection
Each JDBCService instance must have its own connection to the database so that when the application commits or rolls back, only the changes made by that application are affected. |
protected java.lang.String |
databaseURL
The database URL. |
protected java.lang.String |
dataSourceName
Keeps the name of the DataSource factory object in the naming system. |
protected java.sql.DatabaseMetaData |
metaData
Each JDBCService instance must have its own connection to the database so that when the application commits or rolls back, only the changes made by that application are affected. |
protected java.lang.String |
password
The user password to connect to the database. |
protected java.lang.String |
poolName
Keeps the name of the pool when using the connection pooling for WebSphere 2.0. |
protected java.lang.String |
sharedConnection
Keeps the alias of the database connection that the service instance would like to share with another service. |
protected static int |
STMT_POOL_SIZE_DEFAULT
Default number of elements of the array. |
protected java.util.ArrayList |
stmtPool
Array to keep different statements |
protected int |
stmtPoolSize
Number of elements of the array. |
protected java.lang.String |
updateString
Keeps the SQL sentence used when updating all columns of a record. |
protected java.lang.String |
user
The user identification to connect to the database. |
protected boolean |
waitRetry
Keeps the waitRetry attribute used by the WebSphere 2.0 connection pooling. |
Fields inherited from class com.ibm.btt.services.PooledServiceRequester |
---|
poolable, poolId |
Fields inherited from class com.ibm.btt.services.BTTServiceRequester |
---|
COMPID |
Fields inherited from class com.ibm.btt.base.Service |
---|
externalizer, name |
Constructor Summary | |
---|---|
JDBCService()
* This constructor creates a JDBCService object. |
Method Summary | |
---|---|
void |
connect()
Connects to the Database set in the DataSource definition without userid and password This method can only be used if the connection is requested using a pool of connections implemented as a DataSource with the database URL specified as part of the DataSource definition. |
void |
connect(java.lang.String aUser,
java.lang.String aPassword)
Connects to the Database set in the DataSource definition using aUser and aPassword. |
void |
disconnect()
Closes the Database connection. |
boolean |
getAutoCommit()
Returns the autoCommit attribute value. |
java.lang.String |
getDataSourceName()
Returns the dataSourceName attribute value. |
java.lang.String |
getPassword()
Returns the password attribute value. |
java.lang.String |
getUser()
Returns the user attribute value. |
boolean |
isConnected()
Returns true if there is a connection to the database or false if there is not. |
boolean |
isWaitRetry()
Returns the waitRetry attribute value. |
void |
setAutoCommit(boolean b)
Sets the autoCommit attribute. |
void |
setDataSourceName(java.lang.String newDataSourceName)
Sets the dataSourceName attribute value to newDataSourceName. |
void |
setPassword(java.lang.String s)
Sets the password attribute to the string provided as an argument. |
void |
setUser(java.lang.String s)
Sets the user attribute to the string provided as an argument. |
void |
setWaitRetry(boolean newWaitRetry)
Sets the waitRetry attribute value to newWaitRetry. |
boolean |
verifyConnection()
Checks for the database connection availability by calling the Connection Manager. |
Methods inherited from class com.ibm.btt.services.PooledServiceRequester |
---|
getGrantTime, getPoolable, getPoolable, getPoolId, getServiceID, grantServiceID, initializeFrom, initializeFrom, processRequest, releaseOrphan, releaseOrphan, releasePoolable, releaseServiceRequester, setGrantTime, setPoolId |
Methods inherited from class com.ibm.btt.services.BTTServiceRequester |
---|
getCachingEnabled, getInactiveTimeout, getLastAccess, getServiceInvocation, getServiceType, HashMapToHashtable, newInstance, setCachingEnabled, setInactiveTimeout, setLastAccess, setServiceID, setServiceInvocation, setServiceType |
Methods inherited from class com.ibm.btt.base.Service |
---|
externalizer, getExternalizer, getName, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, setName, terminate, toString, toStrings, toTags, writeExternal, writeExternal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.sql.Connection databaseConnection
protected boolean autoCommit
protected java.lang.String databaseURL
protected java.lang.String user
protected java.lang.String password
protected java.lang.String poolName
protected boolean waitRetry
protected java.lang.String dataSourceName
protected java.sql.DatabaseMetaData metaData
protected java.lang.String sharedConnection
protected Hashtable connectionProperties
protected java.lang.String addString
protected java.lang.String updateString
protected java.sql.PreparedStatement addPstmt
protected static final int STMT_POOL_SIZE_DEFAULT
protected int stmtPoolSize
protected java.util.ArrayList stmtPool
Constructor Detail |
public JDBCService()
Method Detail |
public void connect() throws DSEInternalErrorException, DSEInvalidRequestException, DSESQLException, DSEObjectNotFoundException, DSEException
DSEInvalidRequestException
- if the request is not valid
DSEInternalErrorException
- if an internal program error occurs
DSESQLException
- if an SQLException is caught
DSEObjectNotFoundException
- if the JDBCServicesConnectionManager cannot be found
DSEException
- if an exception is thrown when calling the pool of connections managerpublic void connect(java.lang.String aUser, java.lang.String aPassword) throws DSEInternalErrorException, DSEInvalidRequestException, DSESQLException, DSEObjectNotFoundException, DSEException
connect
in interface DatabaseConnect
aUser
- java.lang.String - the user identificationaPassword
- java.lang.String - the user password
DSEInvalidRequestException
- if the request is not valid
DSEInternalErrorException
- if an internal program error occurs
DSESQLException
- if an SQLException is caught
DSEObjectNotFoundException
- if the JDBCServicesConnectionManager cannot be found
DSEException
- if an exception is thrown when calling the pool of connections managerpublic void disconnect() throws DSEInvalidRequestException, DSESQLException, DSEException
disconnect
in interface DatabaseConnect
DSESQLException
- if a SQLException occurs
DSEException
- if an exception is thrown when calling the pool of connections manager
DSEInvalidRequestException
- if the database connection is nullpublic boolean getAutoCommit() throws DSEException
DSEException
public java.lang.String getDataSourceName() throws DSEException
getDataSourceName
in interface DatabaseConnect
DSEException
public java.lang.String getPassword() throws DSEException
DSEException
public java.lang.String getUser() throws DSEException
DSEException
public boolean isConnected() throws DSEInvalidRequestException, DSEInternalErrorException, DSESQLException, DSEObjectNotFoundException, DSEException
isConnected
in interface DatabaseConnect
DSEInvalidRequestException
- if the request is not valid
DSEInternalErrorException
- if an internal program error occurs
DSESQLException
- if an SQL Exception is caught
DSEObjectNotFoundException
DSEException
public boolean isWaitRetry() throws DSEException
isWaitRetry
in interface DatabaseConnect
DSEException
public void setAutoCommit(boolean b) throws DSEException
b
- boolean value
DSEException
public void setDataSourceName(java.lang.String newDataSourceName) throws DSEException
setDataSourceName
in interface DatabaseConnect
newDataSourceName
- java.lang.String
DSEException
public void setPassword(java.lang.String s) throws DSEException
s
- java.lang.String
DSEException
public void setUser(java.lang.String s) throws DSEException
s
- java.lang.String
DSEException
public void setWaitRetry(boolean newWaitRetry) throws DSEException
setWaitRetry
in interface DatabaseConnect
newWaitRetry
- boolean
DSEException
public boolean verifyConnection() throws DSESQLException, DSEException
DSESQLException
- if an SQLException is caught
DSEException
- if an exception is thrown when calling the pool of connections
|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |