public class DBConnectionFactory extends java.lang.Object implements JDBCConnectionFactoryIfc
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoCommit |
protected java.lang.String |
connectionURL |
protected java.lang.String |
dbDriver |
protected java.lang.String |
dbHost |
protected java.lang.String |
dbPassword |
protected java.lang.String |
dbPort |
protected java.lang.String |
dbServiceName |
protected java.lang.String |
dbSID |
protected java.lang.String |
dbUser |
protected java.lang.String |
errMesg |
protected static java.lang.String |
HOST_TEMPLATE |
protected static java.lang.String |
PORT_TEMPLATE |
protected static java.lang.String |
SERVICENAME_TEMPLATE |
protected static java.lang.String |
SID_TEMPLATE |
protected java.lang.String |
urlTemplate |
Constructor and Description |
---|
DBConnectionFactory(java.lang.String connURL,
java.lang.String user,
java.lang.String pword,
java.lang.String dbdriver)
Construct the connection factory with the information necessary for
creating a
java.sql.Connection object for communicating
with an Oracle database. |
DBConnectionFactory(java.lang.String connURL,
java.lang.String user,
java.lang.String pword,
java.lang.String dbdriver,
boolean commit)
Construct the connection factory with the information necessary for
creating a
java.sql.Connection object for communicating
with an Oracle database. |
DBConnectionFactory(java.lang.String host,
java.lang.String port,
java.lang.String sid,
java.lang.String serviceName,
java.lang.String user,
java.lang.String pword,
java.lang.String dbdriver,
java.lang.String urltemplate)
Construct the connection factory with the information necessary for
creating a
java.sql.Connection object for communicating
with an Oracle database. |
DBConnectionFactory(java.lang.String host,
java.lang.String port,
java.lang.String sid,
java.lang.String serviceName,
java.lang.String user,
java.lang.String pword,
java.lang.String dbdriver,
java.lang.String urltemplate,
boolean commit)
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 |
---|---|
protected java.lang.String |
formJDBCURL() |
java.sql.Connection |
getConnection()
Returns a
java.sql.Connection object to be used for
reading/writing data from/to a JDBC-compliant database. |
java.lang.String |
getDBUser() |
protected void |
registerDriver() |
protected java.lang.String errMesg
protected java.lang.String dbHost
protected java.lang.String dbPort
protected java.lang.String dbSID
protected java.lang.String dbServiceName
protected java.lang.String dbUser
protected java.lang.String dbPassword
protected java.lang.String connectionURL
protected java.lang.String dbDriver
protected java.lang.String urlTemplate
protected boolean autoCommit
protected static final java.lang.String HOST_TEMPLATE
protected static final java.lang.String PORT_TEMPLATE
protected static final java.lang.String SID_TEMPLATE
protected static final java.lang.String SERVICENAME_TEMPLATE
public DBConnectionFactory(java.lang.String connURL, java.lang.String user, java.lang.String pword, java.lang.String dbdriver) 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.dbdriver
- The class name of the JDBC driver.java.sql.SQLException
public DBConnectionFactory(java.lang.String connURL, java.lang.String user, java.lang.String pword, java.lang.String dbdriver, boolean commit) 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.dbdriver
- The class name of the JDBC driver.commit
- true
, if each statement will be
automatically commited.java.sql.SQLException
public DBConnectionFactory(java.lang.String host, java.lang.String port, java.lang.String sid, java.lang.String serviceName, java.lang.String user, java.lang.String pword, java.lang.String dbdriver, java.lang.String urltemplate) 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.dbdriver
- The class name of the JDBC driver.urltemplate
- The template of the JDBC URL.java.sql.SQLException
public DBConnectionFactory(java.lang.String host, java.lang.String port, java.lang.String sid, java.lang.String serviceName, java.lang.String user, java.lang.String pword, java.lang.String dbdriver, java.lang.String urltemplate, boolean commit) 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.dbdriver
- The class name of the JDBC driver.urltemplate
- The template of the JDBC URL.commit
- true
, if each statement will be
automatically commited.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
java.sql.Connection
objectjava.sql.SQLException
protected void registerDriver() throws java.sql.SQLException
java.sql.SQLException
protected java.lang.String formJDBCURL() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getDBUser()
getDBUser
in interface JDBCConnectionFactoryIfc