Purpose:Use this Connector to build a java.sql.Connection in the "standard" fashion, via the DriverManager.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | connectDirectly
Save whether we have switched to direct connect (sql.Driver.connect()) mode |
| protected String | |
| protected Driver | driver
cache up the instantiated Driver to speed up reconnects |
| protected Class | driverClass
cache up the driver class to speed up reconnects |
| protected String | |
| protected String |
| Access | Constructor and Description |
|---|---|
| public | DefaultConnector()
PUBLIC: Construct a Connector with default settings The database URL will still need to be set. |
| public | DefaultConnector(String driverClassName, String driverURLHeader, String databaseURL)
PUBLIC: Construct a Connector with the specified settings. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public Object | clone()
Overrides java. Implements org. |
| public Connection | Returns: java.sql.ConnectionImplements org. |
| protected Connection | Returns: java.sql.ConnectionINTERNAL: Connect directly - without using DriverManager. |
| public String | Returns: java.lang.StringImplements org. |
| public String | |
| public String | |
| public String | getDriverClassName()
PUBLIC: The driver class is the name of the Java class for the JDBC driver being used (e.g. "sun.jdbc.odbc.JdbcOdbcDriver"). |
| public String | getDriverURLHeader()
PUBLIC: The driver URL header is the string predetermined by the JDBC driver to be part of the URL connection string, (e.g. "jdbc:odbc:"). |
| protected void | initialize(String driverClassName, String driverURLHeader, String databaseURL)
INTERNAL: Initialize the connector with the specified settings. |
| protected void | |
| protected void | loadDriverClass(Session session)
INTERNAL: Ensure that the driver has been loaded and registered with the DriverManager. |
| public void | |
| public void | setDriverClassName(String driverClassName)
PUBLIC: The driver class is the name of the Java class for the JDBC driver being used (e.g. "sun.jdbc.odbc.JdbcOdbcDriver"). |
| public void | setDriverURLHeader(String driverURLHeader)
PUBLIC: The driver URL header is the string predetermined by the JDBC driver to be part of the URL connection string, (e.g. "jdbc:odbc:"). |
| public boolean | Returns: booleanINTERNAL: Indicates whether DriverManager should be used. |
| public String | |
| public void | toString(PrintWriter writer)
Implements org. |
| connectDirectly | back to summary |
|---|---|
| private boolean connectDirectly Save whether we have switched to direct connect (sql.Driver.connect()) mode | |
| databaseURL | back to summary |
|---|---|
| protected String databaseURL | |
| driver | back to summary |
|---|---|
| protected Driver driver cache up the instantiated Driver to speed up reconnects | |
| driverClass | back to summary |
|---|---|
| protected Class<?> driverClass cache up the driver class to speed up reconnects | |
| driverClassName | back to summary |
|---|---|
| protected String driverClassName | |
| driverURLHeader | back to summary |
|---|---|
| protected String driverURLHeader | |
| DefaultConnector | back to summary |
|---|---|
| public DefaultConnector() PUBLIC: Construct a Connector with default settings The database URL will still need to be set. | |
| DefaultConnector | back to summary |
|---|---|
| public DefaultConnector(String driverClassName, String driverURLHeader, String databaseURL) PUBLIC: Construct a Connector with the specified settings. | |
| clearDriverClassAndDriver | back to summary |
|---|---|
| public void clearDriverClassAndDriver() INTERNAL: Discard the cached driver class and driver. | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Implements org. INTERNAL: Clone the connector.
| |
| connect | back to summary |
|---|---|
| public Connection connect(Properties properties, Session session) throws DatabaseException Implements org. INTERNAL: Connect with the specified properties and session. Return the Connection.
| |
| directConnect | back to summary |
|---|---|
| protected Connection directConnect(Properties properties) throws DatabaseException INTERNAL: Connect directly - without using DriverManager. Return the Connection.
| |
| getConnectionDetails | back to summary |
|---|---|
| public String getConnectionDetails() Implements org. PUBLIC: Provide the details of my connection information. This is primarily for JMX runtime services. | |
| getConnectionString | back to summary |
|---|---|
| public String getConnectionString() PUBLIC: Return the JDBC connection string. This is a combination of the driver-specific URL header and the database URL. | |
| getDatabaseURL | back to summary |
|---|---|
| public String getDatabaseURL() PUBLIC: The database URL is the JDBC URL for the database server. The driver header is not be included in this URL (e.g. "dbase files"; not "jdbc:odbc:dbase files"). | |
| getDriverClassName | back to summary |
|---|---|
| public String getDriverClassName() PUBLIC: The driver class is the name of the Java class for the JDBC driver being used (e.g. "sun.jdbc.odbc.JdbcOdbcDriver"). | |
| getDriverURLHeader | back to summary |
|---|---|
| public String getDriverURLHeader() PUBLIC: The driver URL header is the string predetermined by the JDBC driver to be part of the URL connection string, (e.g. "jdbc:odbc:"). This is required to connect to the database. | |
| initialize | back to summary |
|---|---|
| protected void initialize(String driverClassName, String driverURLHeader, String databaseURL) INTERNAL: Initialize the connector with the specified settings. | |
| instantiateDriver | back to summary |
|---|---|
| protected void instantiateDriver() throws DatabaseException INTERNAL: Instantiate the Driver. | |
| loadDriverClass | back to summary |
|---|---|
| protected void loadDriverClass(Session session) throws DatabaseException INTERNAL: Ensure that the driver has been loaded and registered with the DriverManager. Just loading the class should cause the static initialization code to do the necessary registration. Return the loaded driver Class. | |
| setDatabaseURL | back to summary |
|---|---|
| public void setDatabaseURL(String databaseURL) PUBLIC: The database URL is the JDBC URL for the database server. The driver header is not be included in this URL (e.g. "dbase files"; not "jdbc:odbc:dbase files"). | |
| setDriverClassName | back to summary |
|---|---|
| public void setDriverClassName(String driverClassName) PUBLIC: The driver class is the name of the Java class for the JDBC driver being used (e.g. "sun.jdbc.odbc.JdbcOdbcDriver"). | |
| setDriverURLHeader | back to summary |
|---|---|
| public void setDriverURLHeader(String driverURLHeader) PUBLIC: The driver URL header is the string predetermined by the JDBC driver to be part of the URL connection string, (e.g. "jdbc:odbc:"). This is required to connect to the database. | |
| shouldUseDriverManager | back to summary |
|---|---|
| public boolean shouldUseDriverManager(Properties properties, Session session) INTERNAL: Indicates whether DriverManager should be used.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. PUBLIC: Print connection string.
| |
| toString | back to summary |
|---|---|
| public void toString(PrintWriter writer) Implements org. INTERNAL: Print something useful on the log.
| |