Oracle Fusion Middleware extensions for Logging and Diagnostics
11g Release 1 (11.1.2)

E22565-02

oracle.apps.fnd.appltest.diagfwk.engine.provider.dao.db
Class OADBBaseDAO

java.lang.Object
  extended by oracle.apps.fnd.appltest.diagfwk.engine.provider.dao.db.OADBBaseDAO
All Implemented Interfaces:
BaseDAO
Direct Known Subclasses:
OADBTagDAO, OADBTestDefDAO, OADBTestRunDAO, OADBTestStatsDAO

public abstract class OADBBaseDAO
extends java.lang.Object
implements BaseDAO

Base class that all OADB specific DAO classes extend from.

This class provides from useful APIs for setting savepoints and rolling back transactions that can be used by all DAO objects.

Since:
release specific (what release of product did this appear in)
Version:
$Header: atgpf/appltest/applications/Diagnostics/Engine/src/oracle/apps/fnd/appltest/diagfwk/engine/provider/dao/db/OADBBaseDAO.java /main/27 2009/10/09 15:42:43 ilawler Exp $
Author:
ppradhan

Nested Class Summary
 
Nested classes/interfaces inherited from interface oracle.apps.fnd.appltest.diagfwk.engine.provider.dao.BaseDAO
BaseDAO.DBSessionInfo
 
Field Summary
protected  java.lang.String langCode
           
 
Constructor Summary
OADBBaseDAO()
           
 
Method Summary
protected static void close(java.sql.ResultSet pRs)
          This method closes the given ResultSet object and logs any SQLException that is thrown when attempting to close.
protected static void close(java.sql.ResultSet pRs, java.sql.Statement pStmt)
          Helper method to close both a result set and a statement.
protected static void close(java.sql.Statement pStmt)
          This method closes the given Statement object and logs any SQLException that is thrown when attempting to close.
 java.lang.String createSysGuid()
          Generates a new system GUID
protected static oracle.sql.CLOB getCLOB(java.sql.Connection pCon, java.lang.String clobData)
          This method uses temporary clob to create the CLOB object.
protected static java.sql.Connection getConnection()
          Returns a JDBC Connection to the database by calling the Connection provider.
 BaseDAO.DBSessionInfo getDBSessionInfo(DiagContextExtn context)
          Retrieves the database session information for the connection encapsulated by the passed in context.
protected  int getJdbcBatchSize()
          Returns the batch size when doing batch operations
protected  java.lang.String getLangCode()
           
static java.util.Date getSysDate()
          Returns the system date
static java.util.Date getSysDate(java.lang.String pRel)
          Returns a date relative to sysdate as specified by pRel
static java.lang.String getSysGuid()
          Returns a system GUID
protected static void populateWhoColumns(DiagBObj pObj, java.sql.ResultSet pRs)
          Populates the common WHO columns for the given diagnostic business object from the given SQL Result set.
protected static void prepareWhoColumns(DiagBObj pObj)
          Prepares the WHO column values for the given business object by calling the appropriate APIs from the SessionInfoProvider interface.
 java.lang.String[] queryNlsParameters(java.lang.String[] pNlsParameterNames)
          Queries the values of the given NLS parameter names from the repository.
 java.util.Date querySysDate()
          Queries the system date from the Applications database and returns it.
 java.util.Date querySysDate(java.lang.String pRel)
          Returns a date relative to sysdate as specified by pRel
protected static void returnConnection(java.sql.Connection pCon)
          Returns the JDBC Connection back to the provider
protected  boolean rollBack(java.sql.Connection pCon, java.sql.Savepoint pSvPt)
          Rollsback to the given save point
protected static void setFetchSize(java.sql.ResultSet pRs)
          This method set the fetchsize for the given ResultSet object
protected  java.sql.Savepoint setSavepoint(java.sql.Connection pCon, java.lang.String pSvPtName)
          Sets a save point with the given name
protected static int setWhoColumnsForInsert(DiagBObj pObj, java.sql.PreparedStatement pStmt, int pStartIndex)
          Sets the WHO column values namely created_by, last_updated_by and last_update_login from the given business object into the given prepared statement.
protected static int setWhoColumnsForUpdate(DiagBObj pObj, java.sql.PreparedStatement pStmt, int pStartIndex)
          Sets the WHO column values namely last_updated_by and last_update_login from the given business object into the given prepared statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

langCode

protected java.lang.String langCode
Constructor Detail

OADBBaseDAO

public OADBBaseDAO()
Method Detail

getLangCode

protected java.lang.String getLangCode()

getJdbcBatchSize

protected int getJdbcBatchSize()
Returns the batch size when doing batch operations


setSavepoint

protected java.sql.Savepoint setSavepoint(java.sql.Connection pCon,
                                          java.lang.String pSvPtName)
Sets a save point with the given name

Parameters:
pCon -
pSvPtName -
Returns:

rollBack

protected boolean rollBack(java.sql.Connection pCon,
                           java.sql.Savepoint pSvPt)
Rollsback to the given save point

Parameters:
pCon -
pSvPt -

getCLOB

protected static oracle.sql.CLOB getCLOB(java.sql.Connection pCon,
                                         java.lang.String clobData)
This method uses temporary clob to create the CLOB object.


close

protected static void close(java.sql.Statement pStmt)
This method closes the given Statement object and logs any SQLException that is thrown when attempting to close.

Parameters:
pStmt - Statement to close.

close

protected static void close(java.sql.ResultSet pRs)
This method closes the given ResultSet object and logs any SQLException that is thrown when attempting to close.

Parameters:
pRs - ResultSet to close.

close

protected static void close(java.sql.ResultSet pRs,
                            java.sql.Statement pStmt)
Helper method to close both a result set and a statement.

Parameters:
pRs -
pStmt -

setFetchSize

protected static void setFetchSize(java.sql.ResultSet pRs)
                            throws java.sql.SQLException
This method set the fetchsize for the given ResultSet object

Parameters:
pRs - ResultSet for setting the fetch size.
Throws:
java.sql.SQLException

getConnection

protected static java.sql.Connection getConnection()
Returns a JDBC Connection to the database by calling the Connection provider.

Returns:
JDBC Connection to the database

returnConnection

protected static void returnConnection(java.sql.Connection pCon)
Returns the JDBC Connection back to the provider

Parameters:
pCon - JDBC Connection to the database

createSysGuid

public java.lang.String createSysGuid()
Description copied from interface: BaseDAO
Generates a new system GUID

Specified by:
createSysGuid in interface BaseDAO
Returns:
the newly generated system GUID.

getSysGuid

public static java.lang.String getSysGuid()
Returns a system GUID

Returns:
a system guid.

getSysDate

public static java.util.Date getSysDate()
Returns the system date

Returns:
the current system date.

getSysDate

public static java.util.Date getSysDate(java.lang.String pRel)
Returns a date relative to sysdate as specified by pRel

Parameters:
pRel - a String such as "+1","-1" etc that indicates a date relative to sysdate
Returns:
a date relative to sysdate

querySysDate

public java.util.Date querySysDate()
Description copied from interface: BaseDAO
Queries the system date from the Applications database and returns it.

Specified by:
querySysDate in interface BaseDAO
Returns:
the system date from the Applications database and returns it.

querySysDate

public java.util.Date querySysDate(java.lang.String pRel)
Returns a date relative to sysdate as specified by pRel

Specified by:
querySysDate in interface BaseDAO
Parameters:
pRel - a String such as "+1","-1" etc that indicates a date relative to sysdate
Returns:
a date relative to sysdate

queryNlsParameters

public java.lang.String[] queryNlsParameters(java.lang.String[] pNlsParameterNames)
Description copied from interface: BaseDAO
Queries the values of the given NLS parameter names from the repository.

Specified by:
queryNlsParameters in interface BaseDAO
Parameters:
pNlsParameterNames - The names of the NLS parameters to query
Returns:
the corresponding values of the NLS parameters in the order that they exist in the input array. If a particular parameter value is not found then the value is null for that parameter in the return array.

populateWhoColumns

protected static void populateWhoColumns(DiagBObj pObj,
                                         java.sql.ResultSet pRs)
                                  throws java.sql.SQLException
Populates the common WHO columns for the given diagnostic business object from the given SQL Result set.

Parameters:
pObj -
pRs -
Throws:
java.sql.SQLException

setWhoColumnsForInsert

protected static int setWhoColumnsForInsert(DiagBObj pObj,
                                            java.sql.PreparedStatement pStmt,
                                            int pStartIndex)
                                     throws java.sql.SQLException
Sets the WHO column values namely created_by, last_updated_by and last_update_login from the given business object into the given prepared statement.

Returns:
next bind index to use
Throws:
java.sql.SQLException

setWhoColumnsForUpdate

protected static int setWhoColumnsForUpdate(DiagBObj pObj,
                                            java.sql.PreparedStatement pStmt,
                                            int pStartIndex)
                                     throws java.sql.SQLException
Sets the WHO column values namely last_updated_by and last_update_login from the given business object into the given prepared statement.

Returns:
next bind index to use
Throws:
java.sql.SQLException

prepareWhoColumns

protected static void prepareWhoColumns(DiagBObj pObj)
Prepares the WHO column values for the given business object by calling the appropriate APIs from the SessionInfoProvider interface.

Parameters:
pObj - the business object to populate

getDBSessionInfo

public BaseDAO.DBSessionInfo getDBSessionInfo(DiagContextExtn context)
Retrieves the database session information for the connection encapsulated by the passed in context. Delegates the call to the PL/SQL Provider.

Specified by:
getDBSessionInfo in interface BaseDAO
Parameters:
context - a diag context object.
Returns:
a DBSessionInfo object.

Oracle Fusion Middleware extensions for Logging and Diagnostics
11g Release 1 (11.1.2)

E22565-02

Copyright © 2011 Oracle. All Rights Reserved.