Package com.nt.udc.db

Class JDBCUtils

java.lang.Object
com.nt.udc.db.JDBCUtils

public final class JDBCUtils extends Object
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 Details

    • JDBCUtils

      public JDBCUtils()
  • Method Details

    • getOracleConnectionFactory

      public static JDBCConnectionFactoryIfc getOracleConnectionFactory(String connect, String user, String pword) throws SQLException
      Returns a JDBCConnectionFactoryIfc object to be used for obtaining a java.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

      public static Timestamp getOracleTimeAsTimestamp(Connection dbConn) throws SQLException
      Returns a Timestamp object representing the current time for the Oracle DB.
      Parameters:
      dbConn - A Connection object for the Oracle DB
      Returns:
      Timestamp object, representing current database time.
      Throws:
      SQLException
    • getOracleTimeAsLong

      public static long getOracleTimeAsLong(Connection dbConn) throws SQLException
      Returns a long value representing the current time for the Oracle DB.
      Parameters:
      dbConn - A Connection object for the Oracle DB
      Returns:
      long value, representing current database time, in milliseconds
      Throws:
      SQLException