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 JDBCConnectionFactoryIfc
getOracleConnectionFactory
(String connect, String user, String pword) Returns aJDBCConnectionFactoryIfc
object to be used for obtaining ajava.sql.Connection
object to an Oracle DB.static long
getOracleTimeAsLong
(Connection dbConn) Returns along
value representing the current time for the Oracle DB.static Timestamp
getOracleTimeAsTimestamp
(Connection dbConn) Returns aTimestamp
object 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 aJDBCConnectionFactoryIfc
object to be used for obtaining ajava.sql.Connection
object 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
JDBCConnectionFactoryIfc
object
- Throws:
SQLException
-
getOracleTimeAsTimestamp
Returns aTimestamp
object representing the current time for the Oracle DB.- Parameters:
dbConn
- AConnection
object for the Oracle DB- Returns:
Timestamp
object, representing current database time.- Throws:
SQLException
-
getOracleTimeAsLong
Returns along
value representing the current time for the Oracle DB.- Parameters:
dbConn
- AConnection
object for the Oracle DB- Returns:
long
value, representing current database time, in milliseconds- Throws:
SQLException
-