|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.dse.base.DSENotifier | +--com.ibm.dse.base.Service | +--com.ibm.dse.services.jdbc.JDBCService
The JDBCService provides the implementation of the DatabaseConnect interface. All JDBC services extend from this class inheriting all methods related with the connection to the database.
Field Summary | |
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 when the application commits or rolls back any database changes only the changes made but 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 when the application commits or rolls back any database changes only the changes made but 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 of WebSphere 2.0 |
protected java.lang.String |
sharedConnection
Keeps the alias of the connection to the database that the service instance would like to share with another service |
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.dse.base.Service |
externalizer |
Fields inherited from class com.ibm.dse.base.DSENotifier |
handlersList,
name |
Constructor Summary | |
JDBCService()
* This constructor creates a JDBCService object. |
|
JDBCService(java.lang.String aName)
This constructor creates a JDBCService object. |
Method Summary | |
protected void |
buildConnectionProperties()
Build the hashtable containing all details needed to request the database connection. |
void |
connect(java.lang.String aDatabaseURL)
Connects to the Database. |
void |
connect(java.lang.String aDatabaseURL,
Context aContext)
Connects to the Database. |
void |
connect(java.lang.String aUser,
java.lang.String aPassword)
Connects to the Database set in the DataSource definition, with user identification aUser and password aPassword. |
void |
connect(java.lang.String aUser,
java.lang.String aPassword,
Context aContext)
Connects to the Database set in the DataSource definition, with user identification aUser and password aPassword. |
void |
connect(java.lang.String aDatabaseURL,
java.lang.String aUser,
java.lang.String aPassword)
Connects to the Database in the URL aDatabaseURL, with user identification aUser and password aPassword. |
void |
connect(java.lang.String aDatabaseURL,
java.lang.String aUser,
java.lang.String aPassword,
Context aContext)
Connects to the Database in the URL aDatabaseURL, with user identification aUser and password aPassword. |
void |
disconnect()
Closes the Database connection. |
boolean |
getAutoCommit()
Returns the autoCommit attribute value. |
protected JDBCServicesConnectionManager |
getConnectionManager()
Returns the connection manager instance used by the service to request the connections. |
protected Hashtable |
getConnectionProperties()
Returns the Hashtable containing the connection details. |
protected java.sql.Connection |
getDatabaseConnection()
Returns the database connection being used by the service. |
java.lang.String |
getDatabaseURL()
Returns the databaseURL attribute value. |
java.lang.String |
getDataSourceName()
Returns the dataSourceName attribute value. |
java.lang.String |
getPassword()
Returns the password attribute value. |
java.lang.String |
getPoolName()
Returns the poolName attribute value. |
java.lang.String |
getSharedConnection()
Returns the sharedConnection 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 |
requestConnectionToConnectionManager(Hashtable connProperties)
Request the connection to the connection manager defined in the operation root context. |
void |
requestConnectionToConnectionManager(Hashtable connProperties,
Context aContext)
Request the connection to the connection manager defined in the operation provided context. |
void |
setAutoCommit(boolean b)
Sets the autoCommit attribute to a boolean. |
protected void |
setConnectionManager(JDBCServicesConnectionManager newConnectionManager)
Sets the connectionManager attribute value with the JDBCServicesConnectionManager instance. |
protected void |
setConnectionProperties(Hashtable newConnectionProperties)
Sets the connectionProperties attribute value with the newConnectionProperties Hashtable instance. |
protected void |
setDatabaseConnection(java.sql.Connection newDatabaseConnection)
Sets the databaseConnection attribute to the newDatabaseConnection Connection instance |
void |
setDatabaseURL(java.lang.String s)
Sets the databaseURL attribute to the string provided as an argument. |
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 |
setPoolName(java.lang.String newPoolName)
Sets the poolName attribute value to newPoolName. |
void |
setSharedConnection(java.lang.String newSharedConnection)
Sets the sharedConnection attribute value to newSharedConnection. |
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.dse.base.Service |
externalizer,
getExternalizer,
getTagName,
initializeFrom,
readExternal,
readExternal,
readObject,
removeExternal,
setExternalizer,
terminate,
toString,
toStrings,
toTags,
writeExternal,
writeExternal |
Methods inherited from class com.ibm.dse.base.DSENotifier |
addHandler,
getHandlersList,
getName,
removeHandler,
setName,
signalEvent,
signalEvent,
signalEvent |
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
Constructor Detail |
public JDBCService()
public JDBCService(java.lang.String aName) throws java.io.IOException
aName
- java.lang.StringMethod Detail |
protected void buildConnectionProperties()
public void connect(java.lang.String aDatabaseURL) throws DSEInternalErrorException, DSEInvalidRequestException, DSESQLException, DSEObjectNotFoundException, DSEException
aDatabaseURL
- java.lang.String, the database URLpublic void connect(java.lang.String aDatabaseURL, Context aContext) throws DSEInternalErrorException, DSEInvalidRequestException, DSESQLException, DSEObjectNotFoundException, DSEException
aDatabaseURL
- java.lang.String, the database URLaContext
- com.ibm.dse.base.Context, the context where the JDBCServiceConnectionManager is definedpublic void connect(java.lang.String aUser, java.lang.String aPassword) throws DSEInternalErrorException, DSEInvalidRequestException, DSESQLException, DSEObjectNotFoundException, DSEException
aUser
- java.lang.String, the user identificationaPassword
- java.lang.String, the user passwordpublic void connect(java.lang.String aUser, java.lang.String aPassword, Context aContext) throws DSESQLException, DSEInvalidRequestException, DSEInternalErrorException, DSEObjectNotFoundException, DSEException
aUser
- java.lang.String, the user identificationaPassword
- java.lang.String, the user passwordaContext
- com.ibm.dse.base.Context, the context where the JDBCServiceConnectionManager is definedpublic void connect(java.lang.String aDatabaseURL, java.lang.String aUser, java.lang.String aPassword) throws DSESQLException, DSEInvalidRequestException, DSEInternalErrorException, DSEObjectNotFoundException, DSEException
aDatabaseURL
- java.lang.String, the database URLaUser
- java.lang.String, the user identificationaPassword
- java.lang.String, the user passwordpublic void connect(java.lang.String aDatabaseURL, java.lang.String aUser, java.lang.String aPassword, Context aContext) throws DSESQLException, DSEInvalidRequestException, DSEInternalErrorException, DSEObjectNotFoundException, DSEException
aDatabaseURL
- java.lang.String, the database URLaUser
- java.lang.String, the user identificationaPassword
- java.lang.String, the user passwordaContext
- com.ibm.dse.base.Context, the context where the JDBCServiceConnectionManager is definedpublic void disconnect() throws DSEInvalidRequestException, DSESQLException, DSEException
public boolean getAutoCommit()
protected JDBCServicesConnectionManager getConnectionManager()
protected Hashtable getConnectionProperties()
protected java.sql.Connection getDatabaseConnection()
public java.lang.String getDatabaseURL()
public java.lang.String getDataSourceName()
public java.lang.String getPassword()
public java.lang.String getPoolName()
public java.lang.String getSharedConnection()
public java.lang.String getUser()
public boolean isConnected() throws DSEInvalidRequestException, DSEInternalErrorException, DSESQLException, DSEObjectNotFoundException, DSEException
public boolean isWaitRetry()
public void requestConnectionToConnectionManager(Hashtable connProperties) throws DSEInvalidRequestException, DSESQLException, DSEObjectNotFoundException, DSEException
connProperties
- com.ibm.dse.base.Hashtable, the connection propertiespublic void requestConnectionToConnectionManager(Hashtable connProperties, Context aContext) throws DSEInvalidRequestException, DSESQLException, DSEObjectNotFoundException, DSEException
connProperties
- com.ibm.dse.base.Hashtable, the connection propertiesaContext
- com.ibm.dse.base.Context, the Context where to look for the connection managerpublic void setAutoCommit(boolean b)
boolean
- protected void setConnectionManager(JDBCServicesConnectionManager newConnectionManager)
newConnectionManager
- com.ibm.dse.services.jdbc.JDBCServicesConnectionManagerprotected void setConnectionProperties(Hashtable newConnectionProperties)
newConnectionProperties
- com.ibm.dse.base.Hashtableprotected void setDatabaseConnection(java.sql.Connection newDatabaseConnection)
newDatabaseConnection
- java.sql.Connectionpublic void setDatabaseURL(java.lang.String s)
s
- java.lang.Stringpublic void setDataSourceName(java.lang.String newDataSourceName)
newDataSourceName
- java.lang.Stringpublic void setPassword(java.lang.String s)
s
- java.lang.Stringpublic void setPoolName(java.lang.String newPoolName)
newPoolName
- java.lang.Stringpublic void setSharedConnection(java.lang.String newSharedConnection)
newSharedConnection
- java.lang.Stringpublic void setUser(java.lang.String s)
s
- java.lang.Stringpublic void setWaitRetry(boolean newWaitRetry)
newWaitRetry
- booleanpublic boolean verifyConnection() throws DSESQLException, DSEException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |