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


Variable Index

 o db
access JDBC connection in the chosen dbConnection.

 o st
access JDBC statement in the chosen dbConnection.

Constructor Index

 o dbConnection(String, String, String)
Constructor of the dbConnection: A dbConnection is defined as a triple (Connection, Statement, busyState)

Method Index

 o closeConnection()
Close a connection and its associated statement
Note: this MUST be executed in a Multi-Thread safe enviroment
 o freeConnection()
Set this connection as available, It is multithread safe
 o takeConnection()
Take a non yet used connection, It is multithread safe

Variables

 o db
 public Connection db
access JDBC connection in the chosen dbConnection.

 o st
 public Statement st
access JDBC statement in the chosen dbConnection.

Constructors

 o 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.

Methods

 o 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.
 o takeConnection
 public synchronized boolean takeConnection()
Take a non yet used connection, It is multithread safe

Returns:
true if the selected connection is available
 o freeConnection
 public synchronized void freeConnection()
Set this connection as available, It is multithread safe


All Packages  Class Hierarchy  This Package  Previous  Next  Index