All Packages Class Hierarchy This Package Previous Next Index
Class com.studioitech.gulli.MJDBC.dbConnection
java.lang.Object
|
+----com.studioitech.gulli.MJDBC.dbConnection
- public class dbConnection
- extends Object
A dbConnection represents a Connection and a Statement
in JDBC terminology.
Besides a dbConnection has all inner characteristic to be
handled in a multi-thread safe manner
-
db
- access JDBC connection in the chosen dbConnection.
-
st
- access JDBC statement in the chosen dbConnection.
-
dbConnection(String, String, String)
- Constructor of the dbConnection: A dbConnection is defined
as a triple (Connection, Statement, busyState)
-
closeConnection()
- Close a connection and its associated statement
Note: this
MUST be executed in a Multi-Thread safe enviroment
-
freeConnection()
- Set this connection as available, It is multithread safe
-
takeConnection()
- Take a non yet used connection, It is multithread safe
db
public Connection db
- access JDBC connection in the chosen dbConnection.
st
public Statement st
- access JDBC statement in the chosen dbConnection.
dbConnection
public dbConnection(String url,
String usr,
String pwd) throws SQLException
- Constructor of the dbConnection: A dbConnection is defined
as a triple (Connection, Statement, busyState)
- Parameters:
- url - the url to connect database (e.g.: jdbc:postgresql:database )
- usr - the name of database's user (e.g.: test)
- pwd - the password database user (e.g.: test)
- Throws: SQLException
- if a database-access error occurs.
closeConnection
public void closeConnection() throws SQLException
- Close a connection and its associated statement
Note: this
MUST be executed in a Multi-Thread safe enviroment
- Throws: SQLException
- if a database-access error occurs.
takeConnection
public synchronized boolean takeConnection()
- Take a non yet used connection, It is multithread safe
- Returns:
- true if the selected connection is available
freeConnection
public synchronized void freeConnection()
- Set this connection as available, It is multithread safe
All Packages Class Hierarchy This Package Previous Next Index