Package com.nt.udc.db
Class JDBCUtils
java.lang.Object
com.nt.udc.db.JDBCUtils
This class provides static methods that can be used to obtain DB-specific
objects and information. Rather than having generic methods that return
specific objects based upon a given type of DB, DB-specific methods are
used since different parameters may be needed from one DB to the next.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JDBCConnectionFactoryIfcgetOracleConnectionFactory(String connect, String user, String pword) Returns aJDBCConnectionFactoryIfcobject to be used for obtaining ajava.sql.Connectionobject to an Oracle DB.static longgetOracleTimeAsLong(Connection dbConn) Returns alongvalue representing the current time for the Oracle DB.static TimestampgetOracleTimeAsTimestamp(Connection dbConn) Returns aTimestampobject representing the current time for the Oracle DB.
-
Constructor Details
-
JDBCUtils
public JDBCUtils()
-
-
Method Details
-
getOracleConnectionFactory
public static JDBCConnectionFactoryIfc getOracleConnectionFactory(String connect, String user, String pword) throws SQLException Returns aJDBCConnectionFactoryIfcobject to be used for obtaining ajava.sql.Connectionobject to an Oracle DB.- Parameters:
connect- Connection URL for Oracle JDBC driver. Format is: jdbc:oracle:thin:@: : user- User name used for logging in to the DB.pword- Password used for logging in to the DB.- Returns:
- A
JDBCConnectionFactoryIfcobject - Throws:
SQLException
-
getOracleTimeAsTimestamp
Returns aTimestampobject representing the current time for the Oracle DB.- Parameters:
dbConn- AConnectionobject for the Oracle DB- Returns:
Timestampobject, representing current database time.- Throws:
SQLException
-
getOracleTimeAsLong
Returns alongvalue representing the current time for the Oracle DB.- Parameters:
dbConn- AConnectionobject for the Oracle DB- Returns:
longvalue, representing current database time, in milliseconds- Throws:
SQLException
-