|
jxDBCon 0.9z | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sourceforge.jxdbcon.JXDBConDriver
JXDBConDriver is the interface to the DriverManager, it dispatches the openConnection requests to the appropriate sub driver. This class handles the URL syntax. Acceptable URLs look like this:
jdbc:driver:subdriver[//[[user][:password]@][host][:port][/catalog]
Optionally additional parameters can be supplied by appending
a [?parameters] block. The parameters itself are of the form
[parameter[=value]] and are separated by ; (semicolon)
Example URLs include:
jdbc:postgresql:net//keve@localhost:9876/mydb
jdbc:postgresql:net//keve@/mydb
jdbc:postgresql:net
For the additional properties supported by a given connection handler
consult the InfoKeys interface and its subinterfaces.
DriverManager
,
InfoKeys
,
AbstractConnection
Field Summary | |
private static String[][] |
connectionTypes
The known connection classes. |
Fields inherited from interface org.sourceforge.jxdbcon.InfoKeys |
CATALOG, DESCRIPTION, DRIVER, HOST, PASSWORD, PORT, SUBDRIVER, USER |
Constructor Summary | |
JXDBConDriver()
|
Method Summary | |
boolean |
acceptsURL(String url)
Returns true if the URL's syntax is correct and a connection is registered with the type and subtype. |
private Properties |
breakURL(String url,
Properties info)
Split the URL into its parts and populate a Map with it. |
Connection |
connect(String url,
Properties info)
Connect to the URL. |
private AbstractConnection |
getConnection(String connClass)
Instantiate the connection handler. |
int |
getMajorVersion()
Gets the driver's major version number. |
int |
getMinorVersion()
Gets the driver's minor version number. |
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info)
Gets information about the possible properties for this driver. |
boolean |
jdbcCompliant()
Reports whether this driver is a genuine JDBC COMPLIANT driver. |
private String |
matchConnection(String driver,
String subdriver)
Match the driver/subdriver array with a known Connection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String[][] connectionTypes
Constructor Detail |
public JXDBConDriver()
Method Detail |
public final boolean acceptsURL(String url)
acceptsURL
in interface Driver
url
- The URL of the database.
private final Properties breakURL(String url, Properties info)
url
- The URL of the database.info
- The additional parameters
public final Connection connect(String url, Properties info) throws SQLException
connect
in interface Driver
url
- The URL of the database.info
- The additional parameters
SQLException
- if the url is accepted,
but the connection cannot be establishedAbstractConnection.open(java.lang.String, java.util.Properties)
private final AbstractConnection getConnection(String connClass) throws SQLException
SQLException
- the wrapped exception if the instance could not
be createdpublic final int getMajorVersion()
getMajorVersion
in interface Driver
public final int getMinorVersion()
getMinorVersion
in interface Driver
public final DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
getPropertyInfo
in interface Driver
url
- The URL of the database.info
- The additional parameters
SQLException
AbstractConnection.fillPropertyInfo(java.util.ArrayList,
java.util.Properties)
public final boolean jdbcCompliant()
jdbcCompliant
in interface Driver
private final String matchConnection(String driver, String subdriver)
driver
- the driversubdriver
- the driver specific subprotocol
|
jxDBCon 0.9z | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |