com.stc.connector.appconn.db
Interface DbOtd


public interface DbOtd

The base OTD class.


Method Summary
 void commit()
          Commits a transaction for the connection.
 boolean getAutoCommit()
          Gets the AutoCommit mode of the connection.
 java.sql.Connection getConnection()
          Gets the connection of the OTD.
 int getTransactionIsolation()
          Gets the transaction isolation level for the connection.
 boolean isConnected()
          Returns the connection status.
 void reconnect()
          Reconnect to a database.
 void rollback()
          Rollbacks a transaction for the connection.
 void setAutoCommit(boolean bAuto)
          Sets the AutoCommit mode of the connection.
 void setConcurrencyToReadOnly()
          Set concurrency type of the session to read only.
 void setConcurrencyToUpdatable()
          Set concurrency type of the session to updatable.
 void setScrollTypeToForwardOnly()
          Set result set type of the session to be forward only.
 void setScrollTypeToScrollInsensitive()
          Set result set type of the session to be insensitive.
 void setScrollTypeToScrollSensitive()
          Set result set type of the session to be sensitive.
 void setTransactionIsolation(int iLevel)
          Sets the transaction isolation level for the connection.
 

Method Detail

commit

public void commit()
            throws java.sql.SQLException
Commits a transaction for the connection. All data changes will be permanent.

Parameters:
None.

Returns:
void - None.
Throws:
java.sql.SQLException - if there is any problem in commiting a transaction.

getAutoCommit

public boolean getAutoCommit()
                      throws java.sql.SQLException
Gets the AutoCommit mode of the connection.

Parameters:
None.

Returns:
true if the Autocommit mode is true; false otherwise.
Throws:
java.sql.SQLException - if there is any error in getting the AutoCommit mode from the database.

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Gets the connection of the OTD.

Parameters:
None.

Returns:
the database connection.
Throws:
java.sql.SQLException - if there is any error in getting the connection.

getTransactionIsolation

public int getTransactionIsolation()
                            throws java.sql.SQLException
Gets the transaction isolation level for the connection.

Parameters:
None.

Returns:
the transaction isolation level: TRANSACTION_NONE, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE.
Throws:
java.sql.SQLException - if there is any error in getting the transaction isolation level.

isConnected

public boolean isConnected()
Returns the connection status.

Parameters:
None.

Returns:
true if connection is broken or not established; false otherwise.
Throws:
None.

reconnect

public void reconnect()
               throws java.sql.SQLException
Reconnect to a database.

Parameters:
None.

Returns:
void - None.
Throws:
java.sql.SQLException - if there is any problem in establishing connection.

rollback

public void rollback()
              throws java.sql.SQLException
Rollbacks a transaction for the connection. All data changes will be cleared.

Parameters:
None.

Returns:
void - None.
Throws:
java.sql.SQLException - if there is any problem in rolling back a transaction.

setAutoCommit

public void setAutoCommit(boolean bAuto)
                   throws java.sql.SQLException
Sets the AutoCommit mode of the connection.

Parameters:
bAuto - a true value will set the connection to be in AutoCommit mode; false otherwise.
Returns:
void - None.
Throws:
java.sql.SQLException - if there is any problem in setting the AutoCommit mode.

setConcurrencyToReadOnly

public void setConcurrencyToReadOnly()
                              throws java.sql.SQLException
Set concurrency type of the session to read only.

Parameters:
None.

Returns:
void - None.
Throws:
java.sql.SQLException - if there is any problem in setting scroll type.

setConcurrencyToUpdatable

public void setConcurrencyToUpdatable()
                               throws java.sql.SQLException
Set concurrency type of the session to updatable.

Parameters:
None.

Returns:
void - None.
Throws:
java.sql.SQLException - if there is any problem in setting scroll type.

setScrollTypeToForwardOnly

public void setScrollTypeToForwardOnly()
                                throws java.sql.SQLException
Set result set type of the session to be forward only.

Parameters:
None.

Returns:
void - None.
Throws:
java.sql.SQLException - if there is any problem in setting result set type.

setScrollTypeToScrollInsensitive

public void setScrollTypeToScrollInsensitive()
                                      throws java.sql.SQLException
Set result set type of the session to be insensitive.

Parameters:
None.

Returns:
void - None.
Throws:
java.sql.SQLException - if there is any problem in setting result set type.

setScrollTypeToScrollSensitive

public void setScrollTypeToScrollSensitive()
                                    throws java.sql.SQLException
Set result set type of the session to be sensitive.

Parameters:
None.

Returns:
void - None.
Throws:
java.sql.SQLException - if there is any problem in setting scroll type.

setTransactionIsolation

public void setTransactionIsolation(int iLevel)
                             throws java.sql.SQLException
Sets the transaction isolation level for the connection.

Parameters:
iLevel - a transaction isolation value: TRANSACTION_NONE, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE.
Returns:
void - None.
Throws:
java.sql.SQLException - if there is any problem in setting the transaction isolation level.


Copyright 2006 by Sun Microsystems, Inc. All Rights Reserved.