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, getDBUserpublic 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.SQLExceptionpublic 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.SQLExceptionpublic 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 JDBCConnectionFactoryIfcgetConnection in class DBConnectionFactoryjava.sql.Connection objectjava.sql.SQLExceptionprotected void registerDriver()
throws java.sql.SQLException
registerDriver in class DBConnectionFactoryjava.sql.SQLException