|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.jdbc.JDBCConnectionDriver
public class JDBCConnectionDriver
The JDBCConnectionDriver class provides access to pooled JDBCConnections. Connections will be reaped after they are stale for a while, but it's still important to call JDBCConnection.close() or the available connections will get used up.
| Field Summary | |
|---|---|
protected ReporterInterface |
reporter
|
java.lang.String |
URL_PREFIX
|
| Constructor Summary | |
|---|---|
JDBCConnectionDriver(java.lang.String jdbcDriver,
java.lang.String jdbcURL,
java.lang.String jdbcUsername,
java.lang.String jdbcPassword,
ReporterInterface reporter)
|
|
| Method Summary | |
|---|---|
boolean |
acceptsURL(java.lang.String jdbcURL)
This method is needed to implement the driver interface. |
JDBCConnection |
connect()
Returns a connection from the JDBC Connection Pool. |
java.sql.Connection |
connect(java.lang.String jdbcURL,
java.util.Properties props)
Called by the JDBCConnection threads to get a real connection to the Database via the JDBC Driver. |
void |
debug(java.lang.String message)
Prints a debug message tagged with this JDBCConnectionDriver's identity to the output stream. |
void |
error(java.lang.String message)
Prints an error message tagged with this JDBCConnectionDriver's identity to the error stream. |
void |
error(java.lang.String message,
java.lang.Exception e)
Prints an error message tagged with this JDBCConnectionDriver's identity followed by a stack trace of the passed Exception to the error stream. |
protected java.sql.Connection |
getConnection(java.lang.String jdbcURL,
java.lang.String jdbcUsername,
java.lang.String jdbcPassword)
Called by the JDBCConnection threads to get a real connection to the Database via the JDBC Driver. |
int |
getMajorVersion()
Retrieves the driver's major version number. |
int |
getMinorVersion()
Gets the driver's minor version number. |
java.sql.DriverPropertyInfo[] |
getPropertyInfo(java.lang.String str,
java.util.Properties props)
Gets information about the possible properties for this driver. |
boolean |
jdbcCompliant()
This driver is not JDBC Compliant. |
void |
println(java.lang.String message)
Prints a message tagged with this connection's identity to the output stream. |
void |
setReporter(ReporterInterface reporter)
Sets the reporter for this Connection. |
void |
warning(java.lang.String message)
Prints a warning message tagged with this JDBCConnectionDriver's identity to the error stream. |
void |
warning(java.lang.String message,
java.lang.Exception e)
Prints an warning message tagged with this JDBCConnectionDriver's identity followed by a stack trace of the passed Exception to error stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String URL_PREFIX
protected ReporterInterface reporter
| Constructor Detail |
|---|
public JDBCConnectionDriver(java.lang.String jdbcDriver,
java.lang.String jdbcURL,
java.lang.String jdbcUsername,
java.lang.String jdbcPassword,
ReporterInterface reporter)
throws java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.sql.SQLException
jdbcDriver - The classname of the JDBCDriver to load, for
instance com.ms.jdbc.odbc.JdbcOdbcDriverjdbcURL - The JDBC URL to use when connecting to the DB,
for instance JDBC:ODBC:viaDBjdbcUsername - The username to use when connecting to the DB.jdbcPassword - The password to use when connecting to the DB.
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.sql.SQLException| Method Detail |
|---|
public boolean acceptsURL(java.lang.String jdbcURL)
acceptsURL in interface java.sql.DriverjdbcURL -
public JDBCConnection connect()
throws java.sql.SQLException
java.sql.SQLException
public java.sql.Connection connect(java.lang.String jdbcURL,
java.util.Properties props)
throws java.sql.SQLException
connect in interface java.sql.DriverjdbcURL - The JDBC URL to use.props - The Properties object containing
the username and password to use.
java.sql.SQLException
protected java.sql.Connection getConnection(java.lang.String jdbcURL,
java.lang.String jdbcUsername,
java.lang.String jdbcPassword)
throws java.sql.SQLException
jdbcURL - The JDBC URL to usejdbcUsername - The JDBC usernamejdbcPassword - The JDBC password
java.sql.SQLException - Usually thrown when there is a security problem.public int getMajorVersion()
getMajorVersion in interface java.sql.Driverpublic int getMinorVersion()
getMinorVersion in interface java.sql.Driver
public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String str,
java.util.Properties props)
getPropertyInfo in interface java.sql.Driverpublic boolean jdbcCompliant()
jdbcCompliant in interface java.sql.Driverpublic void debug(java.lang.String message)
public void warning(java.lang.String message)
public void warning(java.lang.String message,
java.lang.Exception e)
public void error(java.lang.String message)
public void error(java.lang.String message,
java.lang.Exception e)
public void println(java.lang.String message)
public void setReporter(ReporterInterface reporter)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||