public class OracleConnectionFactory extends DBConnectionFactory
java.sql.Connection
object for connecting to
an Oracle database.dbDriver, HOST_TEMPLATE, PORT_TEMPLATE, SERVICENAME_TEMPLATE, SID_TEMPLATE, urlTemplate
Constructor and Description |
---|
OracleConnectionFactory(java.lang.String connURL,
java.lang.String user,
java.lang.String pword)
Construct the connection factory with the information necessary for
creating a
java.sql.Connection object for communicating
with an Oracle database. |
OracleConnectionFactory(java.lang.String host,
java.lang.String port,
java.lang.String sid,
java.lang.String serviceName,
java.lang.String user,
java.lang.String pword)
Construct the connection factory with the information necessary for
creating a
java.sql.Connection object for communicating
with an Oracle database. |
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
getConnection()
Returns a
java.sql.Connection object to be used for
reading/writing data from/to a JDBC-compliant database. |
protected void |
registerDriver() |
formJDBCURL, getDBUser
public OracleConnectionFactory(java.lang.String connURL, java.lang.String user, java.lang.String pword) throws java.sql.SQLException
java.sql.Connection
object for communicating
with an Oracle database.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.java.sql.SQLException
public OracleConnectionFactory(java.lang.String host, java.lang.String port, java.lang.String sid, java.lang.String serviceName, java.lang.String user, java.lang.String pword) throws java.sql.SQLException
java.sql.Connection
object for communicating
with an Oracle database.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.java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.Connection
object to be used for
reading/writing data from/to a JDBC-compliant database.getConnection
in interface JDBCConnectionFactoryIfc
getConnection
in class DBConnectionFactory
java.sql.Connection
objectjava.sql.SQLException
protected void registerDriver() throws java.sql.SQLException
registerDriver
in class DBConnectionFactory
java.sql.SQLException