Package com.nt.udc.db
Class OracleConnectionFactory
java.lang.Object
com.nt.udc.db.DBConnectionFactory
com.nt.udc.db.OracleConnectionFactory
- All Implemented Interfaces:
JDBCConnectionFactoryIfc
This class, once constructed with the necessary information, will
produce a
java.sql.Connection
object for connecting to
an Oracle database.-
Field Summary
Fields inherited from class com.nt.udc.db.DBConnectionFactory
dbDriver, HOST_TEMPLATE, PORT_TEMPLATE, SERVICENAME_TEMPLATE, SID_TEMPLATE, urlTemplate
-
Constructor Summary
ConstructorsConstructorDescriptionOracleConnectionFactory
(String connURL, String user, String pword) Construct the connection factory with the information necessary for creating ajava.sql.Connection
object for communicating with an Oracle database.OracleConnectionFactory
(String host, String port, String sid, String serviceName, String user, String pword) Construct the connection factory with the information necessary for creating ajava.sql.Connection
object for communicating with an Oracle database. -
Method Summary
Modifier and TypeMethodDescriptionReturns ajava.sql.Connection
object to be used for reading/writing data from/to a JDBC-compliant database.protected void
Methods inherited from class com.nt.udc.db.DBConnectionFactory
formJDBCURL, getDBUser
-
Constructor Details
-
OracleConnectionFactory
Construct the connection factory with the information necessary for creating ajava.sql.Connection
object for communicating with an Oracle database.- Parameters:
connURL
- The URL used by the JDBC driver to make the connection to the database.user
- The user ID to be used for the database login.pword
- The password to be used for the database login.- Throws:
SQLException
-
OracleConnectionFactory
public OracleConnectionFactory(String host, String port, String sid, String serviceName, String user, String pword) throws SQLException Construct the connection factory with the information necessary for creating ajava.sql.Connection
object for communicating with an Oracle database.- Parameters:
host
- The host name where the Oracle database is running.port
- The port on which the Oracle communication software is running.sid
- The identifier used to indicate the Oracle database instance to which to connect.serviceName
- The identifier used to indicate the Oracle database service name to which to connect.user
- The user ID to be used for the database login.pword
- The password to be used for the database login.- Throws:
SQLException
-
-
Method Details
-
getConnection
Returns ajava.sql.Connection
object to be used for reading/writing data from/to a JDBC-compliant database.- Specified by:
getConnection
in interfaceJDBCConnectionFactoryIfc
- Overrides:
getConnection
in classDBConnectionFactory
- Returns:
- A
java.sql.Connection
object - Throws:
SQLException
-
registerDriver
- Overrides:
registerDriver
in classDBConnectionFactory
- Throws:
SQLException
-