Package com.portal.pcm
Class DatabaseConnection
java.lang.Object
com.portal.pcm.DatabaseConnection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectioncreateOracleConnection(String user, String password, String dbName) Attempts to establish a connection to an oracle database through a Oracle JDBC thin driver.static ConnectionAttempts to establish a connection to an oracle database through a Oracle JDBC thin driver.static ConnectioncreateOracleConnection(String user, String password, String dbHost, String dbPort, String svcName, Properties prop) Attempts to establish a connection to an oracle database through a Oracle JDBC thin driver.static ConnectioncreateOracleConnection(String user, String password, String dbName, Properties prop) Attempts to establish a connection to an oracle database through a Oracle JDBC thin driver.static ConnectionAttempts to establish a connection to an oracle database through a Oracle thin JDBC driver.static Processexec_sql_cmd(String cmd, String password) Provides an interface to execute sqlloader/sqlplus operation as system command by decrypting the password, second parameter.static Processexec_sql_cmd(String cmd, String[] envp, File dir, String password) Provides an interface to execute sqlloader/sqlplus operation as system command by decrypting the password, second parameter.static Processexec_sql_cmd(String cmd, String[] envp, String password) Provides an interface to execute sqlloader/sqlplus operation as system command by decrypting the password, second parameter.
-
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 namepassword- - PassworddbName- - 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 namepassword- - PassworddbName- - Name of the databaseprop- - 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 namepassword- - PassworddbHost- - Database hostnamedbPort- - Database portsvcName- - Database service nameprop- - 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 namepassword- - PassworddbHost- - Database hostnamedbPort- - Database portsvcName- - 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 namepassword- - PasswordHost- - Database hostPort- - Database portSid- - SID of the database- Returns:
- Connection - JDBC Connection object
- Throws:
Exception
-
exec_sql_cmd
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
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 arraypassword- - 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 arraydir- - Directory pathpassword- - plain or encrypted password. Like'&aes|05|...'- Returns:
- process id
- Throws:
Exception
-