com.framework.jdto.jdbc.wrapper
Class JDBCTemplate

java.lang.Object
  extended bycom.framework.jdto.jdbc.wrapper.JDBCTemplate
Direct Known Subclasses:
PreparedStatementWrapper, StatementWrapper

public class JDBCTemplate
extends java.lang.Object

This is the super class of PreparedStatementWrapper and StatementWrapper Classes. This class is mainly responsible for handling the transactions.

Author:
msatish

Constructor Summary
JDBCTemplate()
          Default constructor sets the datasource to the current object from ServiceFinder class.
JDBCTemplate(javax.sql.DataSource ds)
          Constructor that sets the DataSource to the current PreparedStatementWrapper or StatementWrapper object
 
Method Summary
static void finishTransaction()
          Calls the endTransaction() method of TransactionContextManager, which either commits or rollback the transaction based on the current Transaction Status.
 void setDatasource(javax.sql.DataSource datasource)
          This Method Sets the DataSource to the current PreparedStatementWrapper Object or StatementWrapper Object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCTemplate

public JDBCTemplate()
Default constructor sets the datasource to the current object from ServiceFinder class.


JDBCTemplate

public JDBCTemplate(javax.sql.DataSource ds)
Constructor that sets the DataSource to the current PreparedStatementWrapper or StatementWrapper object

Parameters:
ds - javax.sql.DataSource
Method Detail

setDatasource

public void setDatasource(javax.sql.DataSource datasource)
This Method Sets the DataSource to the current PreparedStatementWrapper Object or StatementWrapper Object

Parameters:
datasource -

finishTransaction

public static void finishTransaction()
                              throws java.sql.SQLException
Calls the endTransaction() method of TransactionContextManager, which either commits or rollback the transaction based on the current Transaction Status.

Throws:
java.sql.SQLException