|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunity.jdbc.UnityDriver
public class UnityDriver
Unity implements the java.sql.Driver interface and may be used like any other JDBC driver.
The UnityJDBC driver determines if it is required based on the URL. The URL
should be of the form: jdbc:Unity://mypath/sources.xml
where mypath is an absolute path to the sources.xml file that is accessible
to the driver. Inside the sources.xml file is information on each
JDBC-accessible source that can be queried by the UnityJDBC driver. The
format of this file is as follows:
jdbc:microsoft:sqlserver://XXX.cs.uiowa.edu:1433;DatabaseName=TPCD1;User=YYY;Password=ZZZ com.microsoft.jdbc.sqlserver.SQLServerDriver Tests/xspec/TPC2.xml jdbc:microsoft:sqlserver://AAA.cs.uiowa.edu:1433;DatabaseName=TPCD2;User=BBB;Password=CCC com.microsoft.jdbc.sqlserver.SQLServerDriver Tests/xspec/TPC1.xml
The URL is the JDBC URL that would be used to connect to the source. The JDBC driver to connect to the source must be in the classpath. The XSPEC element contains an absolute or relative path to an XML file describing the data source characteristics. More information can be found in the description of
UnityExtractor.
,
DriverManager
,
Connection
,
UnityConnection
Field Summary | |
---|---|
static int |
_MAJORVERSION
|
static int |
_MINORVERSION
|
static boolean |
DEBUG
|
static java.lang.String |
DRIVER_NAME
|
Constructor Summary | |
---|---|
UnityDriver()
|
Method Summary | |
---|---|
boolean |
acceptsURL(java.lang.String url)
Retrieves whether the driver thinks that it can open a connection to the given URL. |
java.sql.Connection |
connect(java.lang.String url,
java.util.Properties info)
Attempts to make a database connection to the given URL. |
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 url,
java.util.Properties info)
Gets information about the possible properties for this driver. |
boolean |
jdbcCompliant()
Reports whether this driver is a genuine JDBC CompliantTM driver. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int _MAJORVERSION
public static final int _MINORVERSION
public static java.lang.String DRIVER_NAME
public static boolean DEBUG
Constructor Detail |
---|
public UnityDriver() throws java.sql.SQLException
java.sql.SQLException
Method Detail |
---|
public java.sql.Connection connect(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
The driver throws an SQLException
if it is the right
driver to connect to the given URL but has trouble connecting to the
database.
The java.util.Properties
argument can be used to pass
arbitrary string tag/value pairs as connection arguments. The only
properties supported by UnityJDBC are:
connectNow
which may be either true
or
false
. If true, the driver connects to all sources listed
in the sources.xml file immediately. If false, connection occurs on
demand as needed by queries. The default is false.
connect
in interface java.sql.Driver
url
- the URL of the sources.xml to read connection information
(must be locally accessible file)info
- a list of arbitrary string tag/value pairs as connection
arguments.
Connection
object that represents a connection
to the URL. Actually returns UnityConnection object.
java.sql.SQLException
- if a database access error occurspublic boolean acceptsURL(java.lang.String url) throws java.sql.SQLException
true
if they
understand the subprotocol specified in the URL and false
if they do not.
acceptsURL
in interface java.sql.Driver
url
- the URL of the database
true
if this driver understands the given URL;
false
otherwise
java.sql.SQLException
- if a database access error occurspublic java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
The getPropertyInfo
method is intended to allow a generic
GUI tool to discover what properties it should prompt a human for in
order to get enough information to connect to a database. Note that
depending on the values the human has supplied so far, additional values
may become necessary, so it may be necessary to iterate though several
calls to the getPropertyInfo
method.
Note: Not currently supported.
getPropertyInfo
in interface java.sql.Driver
url
- the URL of the database to which to connectinfo
- a proposed list of tag/value pairs that will be sent on
connect open
DriverPropertyInfo
objects describing
possible properties. This array may be an empty array if no
properties are required.
java.sql.SQLException
- if a database access error occurspublic int getMajorVersion()
getMajorVersion
in interface java.sql.Driver
public int getMinorVersion()
getMinorVersion
in interface java.sql.Driver
public boolean jdbcCompliant()
true
here if it passes the JDBC compliance tests;
otherwise it is required to return false
.
The UnityJDBC driver currently returns false although it supports most of SQL 92 Entry Level.
jdbcCompliant
in interface java.sql.Driver
true
if this driver is JDBC Compliant;
false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |