Methods Summary |
---|
public java.lang.Object | clone()INTERNAL:
Clone the connector.
try {
return super.clone();
} catch (Exception exception) {
throw new InternalError("Clone failed");
}
|
public java.sql.Connection | connect(java.util.Properties properties)INTERNAL:
Connect with the specified properties and return the Connection.
this.loadDriver();// ensure the driver has been loaded and registered
try {
return DriverManager.getConnection(this.getConnectionString(), properties);
} catch (SQLException exception) {
throw DatabaseException.sqlException(exception);
}
|
public java.lang.String | getConnectionDetails()PUBLIC:
Provide the details of my connection information. This is primarily for JMX runtime services.
return this.getConnectionString();
|
public java.lang.String | getConnectionString()PUBLIC:
Return the JDBC connection string.
This is a combination of the driver-specific URL header and the database URL.
return this.getDriverURLHeader() + this.getDatabaseURL();
|
public java.lang.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").
return databaseURL;
|
public java.lang.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").
return driverClassName;
|
public java.lang.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.
return driverURLHeader;
|
protected void | initialize(java.lang.String driverClassName, java.lang.String driverURLHeader, java.lang.String databaseURL)INTERNAL:
Initialize the connector with the specified settings.
this.setDriverClassName(driverClassName);
this.setDriverURLHeader(driverURLHeader);
this.setDatabaseURL(databaseURL);
|
protected java.lang.Class | loadDriver()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.
// CR#... The correct class loader must be used to load the class,
// not that Class.forName must be used to initialize the class a simple loadClass may not.
try {
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
try {
return (Class)AccessController.doPrivileged(new PrivilegedClassForName(this.getDriverClassName(), true, ConversionManager.getDefaultManager().getLoader()));
} catch (PrivilegedActionException exception) {
throw DatabaseException.configurationErrorClassNotFound(this.getDriverClassName()); }
} else {
return oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.getClassForName(this.getDriverClassName(), true, ConversionManager.getDefaultManager().getLoader());
}
} catch (ClassNotFoundException exception) {
throw DatabaseException.configurationErrorClassNotFound(this.getDriverClassName());
}
|
public void | setDatabaseURL(java.lang.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").
this.databaseURL = databaseURL;
|
public void | setDriverClassName(java.lang.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").
this.driverClassName = driverClassName;
|
public void | setDriverURLHeader(java.lang.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.
this.driverURLHeader = driverURLHeader;
|
public java.lang.String | toString()PUBLIC:
Print connection string.
return oracle.toplink.essentials.internal.helper.Helper.getShortClassName(getClass()) + "(" + getConnectionString() + ")";
|
public void | toString(java.io.PrintWriter writer)INTERNAL:
Print something useful on the log.
writer.println(ToStringLocalization.buildMessage("datasource_URL", (Object[])null) + "=> \"" + this.getConnectionString() + "\"");
|