Class DatabaseConnection

java.lang.Object
com.portal.pcm.DatabaseConnection

public class DatabaseConnection extends Object
  • Constructor Details

    • DatabaseConnection

      public DatabaseConnection()
  • Method Details

    • createOracleConnection

      public static Connection createOracleConnection(String user, String password, String dbName) throws Exception
      Attempts to establish a connection to an oracle database through a Oracle JDBC thin driver. If successful, returns a JDBC Connection object. Multiple connections if need be created with this method.
      Parameters:
      user - - User name
      password - - Password
      dbName - - Name of the database
      Returns:
      Connection - JDBC Connection object
      Throws:
      Exception
    • createOracleConnection

      public static Connection createOracleConnection(String user, String password, String dbName, Properties prop) throws Exception
      Attempts to establish a connection to an oracle database through a Oracle JDBC thin driver. If successful, returns a JDBC Connection object. Multiple connections if need be created with this method. This method can be used to connect over TLS port
      Parameters:
      user - - User name
      password - - Password
      dbName - - Name of the database
      prop - - Connection Properties
      Returns:
      Connection - JDBC Connection object
      Throws:
      Exception
    • createOracleConnection

      public static Connection createOracleConnection(String user, String password, String dbHost, String dbPort, String svcName, Properties prop) throws Exception
      Attempts to establish a connection to an oracle database through a Oracle JDBC thin driver. If successful, returns a JDBC Connection object. Multiple connections if need be created with this method. This method can be used to connect over TLS port
      Parameters:
      user - - User name
      password - - Password
      dbHost - - Database hostname
      dbPort - - Database port
      svcName - - Database service name
      prop - - Connection Properties
      Returns:
      Connection - JDBC Connection object
      Throws:
      Exception
    • createOracleConnection

      public static Connection createOracleConnection(String user, String password, String dbHost, String dbPort, String svcName) throws Exception
      Attempts to establish a connection to an oracle database through a Oracle JDBC thin driver. If successful, returns a JDBC Connection object. Multiple connections if need be created with this method.
      Parameters:
      user - - User name
      password - - Password
      dbHost - - Database hostname
      dbPort - - Database port
      svcName - - Database service name
      Returns:
      Connection - JDBC Connection object
      Throws:
      Exception
    • createOracleThinConnection

      public static Connection createOracleThinConnection(String user, String password, String Host, String Port, String Sid) throws Exception
      Attempts to establish a connection to an oracle database through a Oracle thin JDBC driver. If successful, returns a JDBC Connection object. Multiple connections if need be created with this method.
      Parameters:
      user - - User name
      password - - Password
      Host - - Database host
      Port - - Database port
      Sid - - SID of the database
      Returns:
      Connection - JDBC Connection object
      Throws:
      Exception
    • exec_sql_cmd

      public static Process exec_sql_cmd(String cmd, String password) throws Exception
      Provides an interface to execute sqlloader/sqlplus operation as system command by decrypting the password, second parameter.
      Parameters:
      cmd - - sqlloader/sqlplus command with PASSWORD constant embedded in it. Like 'sqlloader <username>/PASSWORD@<database>'
      password - - plain or encrypted password. Like '&aes|05|...'
      Returns:
      process id
      Throws:
      Exception
    • exec_sql_cmd

      public static Process exec_sql_cmd(String cmd, String[] envp, String password) throws Exception
      Provides an interface to execute sqlloader/sqlplus operation as system command by decrypting the password, second parameter.
      Parameters:
      cmd - - sqlloader/sqlplus command with PASSWORD constant embedded in it. Like 'sqlloader <username>/PASSWORD@<database>'
      envp - - environment variables array
      password - - plain or encrypted password. Like '&aes|05|...'
      Returns:
      process id
      Throws:
      Exception
    • exec_sql_cmd

      public static Process exec_sql_cmd(String cmd, String[] envp, File dir, String password) throws Exception
      Provides an interface to execute sqlloader/sqlplus operation as system command by decrypting the password, second parameter.
      Parameters:
      cmd - - sqlloader/sqlplus command with PASSWORD constant embedded in it. Like 'sqlloader <username>/PASSWORD@<database>'
      envp - - environment variables array
      dir - - Directory path
      password - - plain or encrypted password. Like '&aes|05|...'
      Returns:
      process id
      Throws:
      Exception