Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

uesqlc::TAbstractConnectionManager Class Reference

UESQL base manager class. More...

List of all members.

Public Methods

 TAbstractConnectionManager ()
void terminate () throws SQLException
 Destroys the instance.

void bindConnection (final String kyCONNECTION_NAME, TConnectionData tCONNECTION_DATA) throws SQLException
void bindCursor (final String kyCURSOR_NAME, ResultSet tRESULT_SET)
void commitCurrent ()
void connect (final String kyCONNECTION_NAME)
 Connects to current database, host and user login.

void connect (final String kyCONNECTION_NAME, final String kySCHEMA_NAME)
void connect (final String kyCONNECTION_NAME, final String kyHOST_NAME, final String kySCHEMA_NAME, final String kyUSER_LOGIN)
abstract void connect (final String kyCONNECTION_NAME, final String kyHOST_NAME, final String kySCHEMA_NAME, final String kyUSER_NAME, final String kyUSER_PASSWORD)
void rollbackCurrent ()
void unbindAllConnections ()
 Unbinds all connections.

void unbindConnection (final String kyCONNECTION_NAME)
void unbindCurrentConnection ()
 Unbinds current connection (if any).

void unbindCursor (final String kyCURSOR_NAME)
void clearQueues ()
ResultSet execute (final String kySTATEMENT)
void executeClean (final String kySTATEMENT)
ResultSet executeSingleRow (final String kySTATEMENT)
void finish () throws SQLException
 Finishes all managed issues.

IType getFromOutputQueue (final int kiINDEX)
void initialize ()
 Initializes the default connection.

String instantiate (final String kySTATEMENT)
IType popFromOutputQueue ()
void pushOnInputQueue (final IType ktVALUE)
void pushOnOutputQueue (IType tVARIABLE)
void resetStatus ()
 Resets SQL status variables.

void setCurrentConnection (final String kyCONNECTION_NAME)
final String currentConnectionName ()
ResultSet getCursor (final String kyCURSOR_NAME)
boolean isConnected ()
boolean isConnected (final String kyCONNECTION_NAME)
boolean isNotFoundCondition ()
boolean isSqlerrorCondition ()

Public Attributes

Logger tLogger
 Logger instance.


Protected Methods

Statement createStatement () throws SQLException

Protected Attributes

Hashtable tConnectionDataHashtable
 Map that binds connection names to connections.

TConnectionData tCurrentConnectionData
 Current connection data (from tConnectionDataHashtable).

Vector tInputEmbeddedVariableVector
 Input embedded variable string values queue.

Vector tOutputEmbeddedVariableVector
 Output embedded variable string pointers vector.

String yCurrentConnection
 String with the identifier of the current connection.


Detailed Description

UESQL base manager class.

Definition at line 41 of file TAbstractConnectionManager.java.


Constructor & Destructor Documentation

uesqlc::TAbstractConnectionManager::TAbstractConnectionManager void    [inline]
 

Builds a new instance. It uses a logger in the subsystem 'org.uesqlc' but it is deactivated by default.

Definition at line 71 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::initialize(), uesqlc::TAbstractConnectionManager::tConnectionDataHashtable, uesqlc::TAbstractConnectionManager::tInputEmbeddedVariableVector, uesqlc::TAbstractConnectionManager::tLogger, uesqlc::TAbstractConnectionManager::tOutputEmbeddedVariableVector, and uesqlc::TAbstractConnectionManager::yCurrentConnection.


Member Function Documentation

void uesqlc::TAbstractConnectionManager::bindConnection final String    kyCONNECTION_NAME,
TConnectionData    tCONNECTION_DATA
throws SQLException [inline]
 

Binds in the connection map, a connection named kyCONNECTION_NAME to tCONNECTION_DATA.

Parameters:
kyCONNECTION_NAME  Connection name.
tCONNECTION_DATA  Connection data.

Definition at line 103 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::tConnectionDataHashtable.

void uesqlc::TAbstractConnectionManager::bindCursor final String    kyCURSOR_NAME,
ResultSet    tRESULT_SET
[inline]
 

Binds in the cursor map for the current connection, a cursor named kyCURSOR_NAME to tRESULT_SET.

Parameters:
kyCURSOR_NAME  Cursor name.
tRESULT_SET  Result set instance.

Definition at line 116 of file TAbstractConnectionManager.java.

References uesqlc::TConnectionData::bind().

void uesqlc::TAbstractConnectionManager::clearQueues void    [inline]
 

Clears embedded variable containers. It must be called at the beginning of each new instruction.

Definition at line 340 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::tInputEmbeddedVariableVector, and uesqlc::TAbstractConnectionManager::tOutputEmbeddedVariableVector.

Referenced by uesqlc::TAbstractConnectionManager::finish().

void uesqlc::TAbstractConnectionManager::commitCurrent   [inline]
 

Commits current connection.

Precondition:
isConnected()

Definition at line 125 of file TAbstractConnectionManager.java.

References uesqlc::TConnectionData::getConnection().

abstract void uesqlc::TAbstractConnectionManager::connect final String    kyCONNECTION_NAME,
final String    kyHOST_NAME,
final String    kySCHEMA_NAME,
final String    kyUSER_NAME,
final String    kyUSER_PASSWORD
[pure virtual]
 

Connects to a database.

Parameters:
kyCONNECTION_NAME  Connection name.
kyHOST_NAME  Host name.
kySCHEMA_NAME  Schema (database) name.
kyUSER_NAME  User name.
kyUSER_PASSWORD  User password.

void uesqlc::TAbstractConnectionManager::connect final String    kyCONNECTION_NAME,
final String    kyHOST_NAME,
final String    kySCHEMA_NAME,
final String    kyUSER_LOGIN
[inline]
 

Connects to a database.

Parameters:
kyCONNECTION_NAME  Connection name.
kyHOST_NAME  Host name.
kySCHEMA_NAME  Schema (database) name.
kyUSER_LOGIN  User login ('user/password').

Definition at line 205 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::connect().

void uesqlc::TAbstractConnectionManager::connect final String    kyCONNECTION_NAME,
final String    kySCHEMA_NAME
[inline]
 

Connects to current host and user login.

Parameters:
kyCONNECTION_NAME  Connection name.
kySCHEMA_NAME  Schema (database) name.

Definition at line 174 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::connect(), uesqlc::TConnectionData::yHostName, uesqlc::TConnectionData::yUserName, and uesqlc::TConnectionData::yUserPassword.

Statement uesqlc::TAbstractConnectionManager::createStatement   throws SQLException [inline, protected]
 

Creates a new statement for the current connection.

Returns:
The newly created statement.

Definition at line 689 of file TAbstractConnectionManager.java.

References uesqlc::TConnectionData::getConnection().

Referenced by uesqlc::TAbstractConnectionManager::execute(), uesqlc::TAbstractConnectionManager::executeClean(), and uesqlc::TAbstractConnectionManager::executeSingleRow().

final String uesqlc::TAbstractConnectionManager::currentConnectionName void    [inline]
 

Returns the connection name for the current connection.

Returns:
The connection name for the current connection.

Definition at line 698 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::yCurrentConnection.

ResultSet uesqlc::TAbstractConnectionManager::execute final String    kySTATEMENT [inline]
 

Executes the statement kySTATEMENT instantiating the input embedded variables (tagged with '$z') in the statement tSTATEMENT.

Parameters:
tSTATEMENT  Statement where the string is executed.
kySTATEMENT  String with the source statement.

Definition at line 352 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::createStatement(), uesqlc::TAbstractConnectionManager::instantiate(), uesqlc::TAbstractConnectionManager::resetStatus(), uesqlc::TAbstractConnectionManager::rollbackCurrent(), and uesqlc::TAbstractConnectionManager::tLogger.

void uesqlc::TAbstractConnectionManager::executeClean final String    kySTATEMENT [inline]
 

Executes the statement kySTATEMENT instantiating the input embedded variables (tagged with '$z'). The result of the execution is omitted.

Parameters:
kySTATEMENT  String with the source statement.

Definition at line 416 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::createStatement(), uesqlc::TAbstractConnectionManager::instantiate(), uesqlc::TAbstractConnectionManager::resetStatus(), and uesqlc::TAbstractConnectionManager::tLogger.

ResultSet uesqlc::TAbstractConnectionManager::executeSingleRow final String    kySTATEMENT [inline]
 

Executes the statement kySTATEMENT instantiating the input embedded variables (tagged with '$z') in the statement tSTATEMENT. The statement can not return more than one tuple.

Parameters:
tSTATEMENT  Statement where the string is executed.
kySTATEMENT  String with the source statement.

Definition at line 451 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::createStatement(), uesqlc::TAbstractConnectionManager::instantiate(), uesqlc::TAbstractConnectionManager::resetStatus(), uesqlc::TAbstractConnectionManager::rollbackCurrent(), and uesqlc::TAbstractConnectionManager::tLogger.

ResultSet uesqlc::TAbstractConnectionManager::getCursor final String    kyCURSOR_NAME [inline]
 

Gets cursor named kyCURSOR_NAME.

Parameters:
kyCURSOR_NAME  Cursor name.
Returns:
Result set.

Definition at line 708 of file TAbstractConnectionManager.java.

References uesqlc::TConnectionData::getCursor().

IType uesqlc::TAbstractConnectionManager::getFromOutputQueue final int    kiINDEX [inline]
 

Gets a pointer to the SQL data type of the output embedded variable at position kiINDEX in the output embedded variable vector. It must be called for writing results on output embedded variables.

Parameters:
kiINDEX  Position of the variable.
Returns:
Pointer to the output embedded variable.

Definition at line 564 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::tOutputEmbeddedVariableVector.

String uesqlc::TAbstractConnectionManager::instantiate final String    kySTATEMENT [inline]
 

Returns a string that is result of instanting the input embedded variables (if any).

Parameters:
kySTATEMENT  Source statement.
Returns:
The instantiated string.

Definition at line 585 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::tInputEmbeddedVariableVector.

Referenced by uesqlc::TAbstractConnectionManager::execute(), uesqlc::TAbstractConnectionManager::executeClean(), and uesqlc::TAbstractConnectionManager::executeSingleRow().

boolean uesqlc::TAbstractConnectionManager::isConnected final String    kyCONNECTION_NAME [inline]
 

Returns true if there is an active connection.

Parameters:
kyCONNECTION_NAME  Source connection name to check.
Returns:
True if there is an active connection.

Definition at line 727 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::tConnectionDataHashtable.

boolean uesqlc::TAbstractConnectionManager::isConnected   [inline]
 

Returns true if there is a default connection.

Returns:
True if there is a default connection.

Definition at line 717 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::yCurrentConnection.

Referenced by uesqlc::TAbstractConnectionManager::unbindCurrentConnection().

boolean uesqlc::TAbstractConnectionManager::isNotFoundCondition void    [inline]
 

Checks if a NOT FOUND condition has happened.

Returns:
True if it has happened.

Definition at line 736 of file TAbstractConnectionManager.java.

boolean uesqlc::TAbstractConnectionManager::isSqlerrorCondition void    [inline]
 

Checks if a SQLERROR condition has happened.

Returns:
True if it has happened.

Definition at line 745 of file TAbstractConnectionManager.java.

Referenced by uesqlc::TAbstractConnectionManager::initialize().

IType uesqlc::TAbstractConnectionManager::popFromOutputQueue void    [inline]
 

Pops from the output embedded variable queue the last entered variable and returns it.

Returns:
The last entered value.

Definition at line 615 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::tOutputEmbeddedVariableVector.

void uesqlc::TAbstractConnectionManager::pushOnInputQueue final IType    ktVALUE [inline]
 

Pushes on the input embedded variable queue the variable value ktVALUE.

Parameters:
ktVALUE  Input embedded variable value.

Definition at line 625 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::tInputEmbeddedVariableVector.

void uesqlc::TAbstractConnectionManager::pushOnOutputQueue IType    tVARIABLE [inline]
 

Pushes on the output embedded variable vector the variable reference tVARIABLE.

Parameters:
tVARIABLE  Output embedded variable reference.

Definition at line 635 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::tOutputEmbeddedVariableVector.

void uesqlc::TAbstractConnectionManager::rollbackCurrent   [inline]
 

Undoes all changes made in the current transaction and in the current connection.

Precondition:
isConnected()

Definition at line 252 of file TAbstractConnectionManager.java.

References uesqlc::TConnectionData::getConnection().

Referenced by uesqlc::TAbstractConnectionManager::execute(), and uesqlc::TAbstractConnectionManager::executeSingleRow().

void uesqlc::TAbstractConnectionManager::setCurrentConnection final String    kyCONNECTION_NAME [inline]
 

Sets current connection to connection named kyCONNECTION_NAME.

Parameters:
kyCONNECTION_NAME  Source connection name.

Definition at line 655 of file TAbstractConnectionManager.java.

References uesqlc::TAbstractConnectionManager::resetStatus(), uesqlc::TAbstractConnectionManager::tConnectionDataHashtable, uesqlc::TAbstractConnectionManager::tLogger, and uesqlc::TAbstractConnectionManager::yCurrentConnection.

Referenced by uesqlc::TAbstractConnectionManager::initialize().

void uesqlc::TAbstractConnectionManager::unbindConnection final String    kyCONNECTION_NAME [inline]
 

Unbinds connection named kyCONNECTION_NAME.

Parameters:
kyCONNECTION_NAME  Source connection name.
Warning:
kyCONNECTION_NAME mustn't be passed as reference to avoid problems about passing yCurrentConnection as argument.

Definition at line 289 of file TAbstractConnectionManager.java.

References uesqlc::TConnectionData::getConnection(), uesqlc::TAbstractConnectionManager::tConnectionDataHashtable, and uesqlc::TAbstractConnectionManager::yCurrentConnection.

Referenced by uesqlc::TAbstractConnectionManager::unbindAllConnections(), and uesqlc::TAbstractConnectionManager::unbindCurrentConnection().

void uesqlc::TAbstractConnectionManager::unbindCursor final String    kyCURSOR_NAME [inline]
 

Unbinds cursor kyCURSOR_NAME from current connection.

Parameters:
kyCURSOR_NAME  Cursor name.

Definition at line 331 of file TAbstractConnectionManager.java.

References uesqlc::TConnectionData::unbind().


The documentation for this class was generated from the following file:
Generated on Mon Oct 13 02:40:11 2003 for UESQLC by doxygen1.2.18