Package com.nt.udc.db
Class DBConnectionFactory
java.lang.Object
com.nt.udc.db.DBConnectionFactory
- All Implemented Interfaces:
JDBCConnectionFactoryIfc
- Direct Known Subclasses:
OracleConnectionFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected static final String
protected static final String
protected static final String
protected static final String
protected String
-
Constructor Summary
ConstructorsConstructorDescriptionDBConnectionFactory
(String connURL, String user, String pword, String dbdriver) Construct the connection factory with the information necessary for creating ajava.sql.Connection
object for communicating with an Oracle database.DBConnectionFactory
(String connURL, String user, String pword, String dbdriver, boolean commit) Construct the connection factory with the information necessary for creating ajava.sql.Connection
object for communicating with an Oracle database.DBConnectionFactory
(String host, String port, String sid, String serviceName, String user, String pword, String dbdriver, String urltemplate) Construct the connection factory with the information necessary for creating ajava.sql.Connection
object for communicating with an Oracle database.DBConnectionFactory
(String host, String port, String sid, String serviceName, String user, String pword, String dbdriver, String urltemplate, boolean commit) Construct the connection factory with the information necessary for creating ajava.sql.Connection
object for communicating with an Oracle database. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns ajava.sql.Connection
object to be used for reading/writing data from/to a JDBC-compliant database.protected void
-
Field Details
-
errMesg
-
dbHost
-
dbPort
-
dbSID
-
dbServiceName
-
dbUser
-
dbPassword
-
connectionURL
-
dbDriver
-
urlTemplate
-
autoCommit
protected boolean autoCommit -
HOST_TEMPLATE
- See Also:
-
PORT_TEMPLATE
- See Also:
-
SID_TEMPLATE
- See Also:
-
SERVICENAME_TEMPLATE
- See Also:
-
-
Constructor Details
-
DBConnectionFactory
public DBConnectionFactory(String connURL, String user, String pword, String dbdriver) throws SQLException 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.dbdriver
- The class name of the JDBC driver.- Throws:
SQLException
-
DBConnectionFactory
public DBConnectionFactory(String connURL, String user, String pword, String dbdriver, boolean commit) throws SQLException 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.dbdriver
- The class name of the JDBC driver.commit
-true
, if each statement will be automatically commited.- Throws:
SQLException
-
DBConnectionFactory
public DBConnectionFactory(String host, String port, String sid, String serviceName, String user, String pword, String dbdriver, String urltemplate) 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.dbdriver
- The class name of the JDBC driver.urltemplate
- The template of the JDBC URL.- Throws:
SQLException
-
DBConnectionFactory
public DBConnectionFactory(String host, String port, String sid, String serviceName, String user, String pword, String dbdriver, String urltemplate, boolean commit) 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.dbdriver
- The class name of the JDBC driver.urltemplate
- The template of the JDBC URL.commit
-true
, if each statement will be automatically commited.- 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
- Returns:
- A
java.sql.Connection
object - Throws:
SQLException
-
registerDriver
- Throws:
SQLException
-
formJDBCURL
- Throws:
SQLException
-
getDBUser
- Specified by:
getDBUser
in interfaceJDBCConnectionFactoryIfc
-