com.ibm.dse.services.jdbc
Interface DatabaseConnect

All Known Subinterfaces:
JournalService, StoreService, TableService
All Known Implementing Classes:
JDBCService

public interface DatabaseConnect

The DatabaseConnect interface provides the public abstract methods that are used to get a database connection and release the database connection by all database services.


Method Summary
 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.
 java.lang.String getDatabaseURL()
          Returns the databaseURL attribute value.
 java.lang.String getDataSourceName()
          Returns the dataSourceName attribute value.
 java.lang.String getPoolName()
          Returns the poolName attribute value.
 java.lang.String getSharedConnection()
          Returns the sharedConnection 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 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 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 setWaitRetry(boolean newWaitRetry)
          Sets the waitRetry attribute value to newWaitRetry.
 

Method Detail

connect

public void connect(java.lang.String aDatabaseURL)
             throws DSEInternalErrorException,
                    DSEInvalidRequestException,
                    DSESQLException,
                    DSEObjectNotFoundException,
                    DSEException
Connects to the Database. A logon panel is shown by the database system where you can enter the user identification and password, which are needed to run any operation to the requested database. If the user and password are mandatory to attempt the database connection (as it occurs when using the JDBC DB2 net driver) then an exception (DSESQLException) is thrown.
Parameters:
aDatabaseURL - java.lang.String, the database URL
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught
DSEObjectNotFoundException - if the JDBCServicesConnectionManager cannot be found
DSEException - if an exception is thrown when calling the pool of connections manager

connect

public void connect(java.lang.String aDatabaseURL,
                    Context aContext)
             throws DSEInternalErrorException,
                    DSEInvalidRequestException,
                    DSESQLException,
                    DSEObjectNotFoundException,
                    DSEException
Connects to the Database. A logon panel is shown by the database system where you can enter the user identification and password, which are needed to run any operation to the requested database. If the user and password are mandatory to attempt the database connection (as it occurs when using the JDBC DB2 net driver) then an exception (DSESQLException) is thrown.
Parameters:
aDatabaseURL - java.lang.String, the database URL
aContext - com.ibm.dse.base.Context, the context where the JDBCServiceConnectionManager is defined
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught
DSEObjectNotFoundException - if the JDBCServicesConnectionManager cannot be found
DSEException - if an exception is thrown when calling the pool of connections manager

connect

public void connect(java.lang.String aUser,
                    java.lang.String aPassword)
             throws DSESQLException,
                    DSEInvalidRequestException,
                    DSEInternalErrorException,
                    DSEObjectNotFoundException,
                    DSEException
Connects to the Database set in the DataSource definition, with user identification aUser and password aPassword. Can only be used if the connection is requested to a pool of connections implemented as a DataSource with the database URL specified as part of the DataSource definition
Parameters:
aUser - java.lang.String, the user identification
aPassword - java.lang.String, the user password
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught
DSEObjectNotFoundException - if the JDBCServicesConnectionManager cannot be found
DSEException - if an exception is thrown when calling the pool of connections manager

connect

public void connect(java.lang.String aUser,
                    java.lang.String aPassword,
                    Context aContext)
             throws DSESQLException,
                    DSEInvalidRequestException,
                    DSEInternalErrorException,
                    DSEObjectNotFoundException,
                    DSEException
Connects to the Database set in the DataSource definition, with user identification aUser and password aPassword. Can only be used if the connection is requested to a pool of connections implemented as a DataSource with the database URL specified as part of the DataSource definition
Parameters:
aUser - java.lang.String, the user identification
aPassword - java.lang.String, the user password
aContext - com.ibm.dse.base.Context, the context where the JDBCServiceConnectionManager is defined
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught
DSEObjectNotFoundException - if the JDBCServicesConnectionManager cannot be found
DSEException - if an exception is thrown when calling the pool of connections manager

connect

public void connect(java.lang.String aDatabaseURL,
                    java.lang.String aUser,
                    java.lang.String aPassword)
             throws DSESQLException,
                    DSEInvalidRequestException,
                    DSEInternalErrorException,
                    DSEObjectNotFoundException,
                    DSEException
Connects to the Database in the URL aDatabaseURL, with user identification aUser and password aPassword.
Parameters:
aDatabaseURL - java.lang.String, the database URL
aUser - java.lang.String, the user identification
aPassword - java.lang.String, the user password
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught
DSEObjectNotFoundException - if the JDBCServicesConnectionManager cannot be found
DSEException - if an exception is thrown when calling the pool of connections manager

connect

public void connect(java.lang.String aDatabaseURL,
                    java.lang.String aUser,
                    java.lang.String aPassword,
                    Context aContext)
             throws DSESQLException,
                    DSEInvalidRequestException,
                    DSEInternalErrorException,
                    DSEObjectNotFoundException,
                    DSEException
Connects to the Database in the URL aDatabaseURL, with user identification aUser and password aPassword.
Parameters:
aDatabaseURL - java.lang.String, the database URL
aUser - java.lang.String, the user identification
aPassword - java.lang.String, the user password
aContext - com.ibm.dse.base.Context, the context where the JDBCServiceConnectionManager is defined
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught
DSEObjectNotFoundException - if the JDBCServicesConnectionManager cannot be found
DSEException - if an exception is thrown when calling the pool of connections manager

disconnect

public void disconnect()
                throws DSESQLException,
                       DSEException
Closes the Database connection.
Throws:
DSESQLException - if a SQL Exception occurs
DSEException - if an exception is thrown when calling the pool of connections manager

getDatabaseURL

public java.lang.String getDatabaseURL()
Returns the databaseURL attribute value.
Returns:
java.lang.String

getDataSourceName

public java.lang.String getDataSourceName()
Returns the dataSourceName attribute value.
Returns:
java.lang.String

getPoolName

public java.lang.String getPoolName()
Returns the poolName attribute value.
Returns:
java.lang.String

getSharedConnection

public java.lang.String getSharedConnection()
Returns the sharedConnection attribute value
Returns:
java.lang.String

isConnected

public boolean isConnected()
                    throws DSEInvalidRequestException,
                           DSEInternalErrorException,
                           DSESQLException,
                           DSEObjectNotFoundException,
                           DSEException
Returns true if there is a connection to the database or false if there is not. If the autoConnect attribute has been set to true, it creates its own connection to the database if not yet created.
Returns:
boolean
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

isWaitRetry

public boolean isWaitRetry()
Returns the waitRetry attribute value.
Returns:
boolean

setDatabaseURL

public void setDatabaseURL(java.lang.String s)
Sets the databaseURL attribute to the string provided as an argument.
Parameters:
s - java.lang.String

setDataSourceName

public void setDataSourceName(java.lang.String newDataSourceName)
Sets the dataSourceName attribute value to newDataSourceName.
Parameters:
newDataSourceName - java.lang.String

setPoolName

public void setPoolName(java.lang.String newPoolName)
Sets the poolName attribute value to newPoolName.
Parameters:
newPoolName - java.lang.String

setSharedConnection

public void setSharedConnection(java.lang.String newSharedConnection)
Sets the sharedConnection attribute value to newSharedConnection.
Parameters:
newSharedConnection - java.lang.String

setWaitRetry

public void setWaitRetry(boolean newWaitRetry)
Sets the waitRetry attribute value to newWaitRetry.
Parameters:
newWaitRetry - boolean