org.makumba.db.makumba.sql
Class SQLDBConnection

java.lang.Object
  extended by org.makumba.db.TransactionImplementation
      extended by org.makumba.db.makumba.DBConnection
          extended by org.makumba.db.makumba.sql.SQLDBConnection
All Implemented Interfaces:
Database, Transaction

public class SQLDBConnection
extends DBConnection


Field Summary
(package private)  int n
           
(package private) static int nconn
           
 
Fields inherited from class org.makumba.db.makumba.DBConnection
dataSource, db
 
Fields inherited from class org.makumba.db.TransactionImplementation
ddp, qp, tp
 
Constructor Summary
SQLDBConnection(Database db, TransactionProvider tp, com.mchange.v2.c3p0.PooledDataSource pooledDataSource)
           
 
Method Summary
 void close()
          Give this connection back to the system.
 void commit()
          Commit the transaction associated with this connection.
 Statement createStatement()
           
 DatabaseMetaData getMetaData()
           
 PreparedStatement getPreparedStatement(String s)
           
 void rollback()
          Rollback the transaction associated with this connection.
 String toString()
           
 
Methods inherited from class org.makumba.db.makumba.DBConnection
deleteLock, executeQuery, executeQuery, executeReadQuery, executeUpdate, getDataSource, getHostDatabase, getName, getNullConstant, getQuery, insert, insert, insertFromQueryImpl, lock, setDataSource, treatParam, unlock, unlockAll, writeReadQuery
 
Methods inherited from class org.makumba.db.TransactionImplementation
delete, delete, delete1, extractReadFields, getParameterName, getPrimaryKeyName, getPrimaryKeyName, getSetJoinSyntax, getTransactionProvider, insert, insertFromQuery, paramsToMap, paramsToMap1, read, readCharEnumValues, readExternalSetValues, readIntEnumValues, readSetValues, setContext, transformTypeName, update, update, updateSet, updateWithValueDiff
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nconn

static int nconn

n

int n
Constructor Detail

SQLDBConnection

SQLDBConnection(Database db,
                TransactionProvider tp,
                com.mchange.v2.c3p0.PooledDataSource pooledDataSource)
          throws SQLException
Throws:
SQLException
Method Detail

close

public void close()
Description copied from interface: Transaction
Give this connection back to the system. This will automatically commit the transaction if it was not committed. A connection cannot be used after closing.

Specified by:
close in interface Database
Specified by:
close in interface Transaction
Specified by:
close in class TransactionImplementation

commit

public void commit()
Description copied from interface: Transaction
Commit the transaction associated with this connection. Normally, simply closing the connection will do, but more often committs may be needed. The business logic manager will close (and therefore commit) all transaction that it provides for usage.

Specified by:
commit in interface Database
Specified by:
commit in interface Transaction
Specified by:
commit in class TransactionImplementation

rollback

public void rollback()
Description copied from interface: Transaction
Rollback the transaction associated with this connection. Typically rollback should be doneif an error occurs in a business logic operation. The business logic manager will rollback a transaction that it provided for usage if it catches any exception during the business logic execution.

Specified by:
rollback in interface Database
Specified by:
rollback in interface Transaction
Specified by:
rollback in class TransactionImplementation

toString

public String toString()
Overrides:
toString in class Object

getMetaData

public DatabaseMetaData getMetaData()
                             throws SQLException
Throws:
SQLException

createStatement

public Statement createStatement()
                          throws SQLException
Throws:
SQLException

getPreparedStatement

public PreparedStatement getPreparedStatement(String s)