public class JDBCDriver extends java.lang.Object implements Driver
Title: Dataspace Framework
Description: Dataspace underlying provider implementation
The Java SQL framework allows for multiple database drivers.
The DriverManager will try to load as many drivers as it can find and then for any given connection request, it will ask each driver in turn to try to connect to the target URL.
The application developer will normally not need to call any function of the Driver directly. All required calls are made by the DriverManager.
When the StreamScape Dataspase Engine Driver class is loaded, it creates an instance of itself and register it with the DriverManager. This means that a user can load and register the StreamScape Dataspase Engine driver by calling:
Class.forName("com.streamscape.ds.jdbc.JDBCDriver")
or include the file META-INF/services/java.sql.Driver
with
with 'com.streamscape.ds.jdbc.JDBCDriver' into jar.
For detailed information about how to obtain StreamScape JDBC Connections,
please see JDBCConnection
.
Copyright: Copyright (c) 2014
Company: StreamScape Technologies
JDBCConnection
Modifier and Type | Field and Description |
---|---|
static JDBCDriver |
driverInstance |
java.lang.ThreadLocal |
threadConnection
As a separate instance of this class is registered with DriverManager
for each class loader, the threadConnection is not declared as static.
|
Constructor and Description |
---|
JDBCDriver()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsURL(java.lang.String url)
Returns true if the driver thinks that it can open a connection to
the given URL.
|
Connection |
connect(DataspaceAccessor accessor,
java.lang.String properties) |
Connection |
connect(DataspaceAccessor accessor,
java.util.TimeZone timezone) |
Connection |
connect(DataspaceAccessor accessor,
java.util.TimeZone timezone,
java.util.Properties properties) |
Connection |
connect(java.lang.String url,
java.util.Properties info)
Attempts to make a database connection to the given URL.
|
static Connection |
getConnection(java.lang.String url,
java.util.Properties info)
The static equivalent of the
connect(String,Properties)
method. |
int |
getMajorVersion()
Gets the driver's major version number.
|
int |
getMinorVersion()
Gets the driver's minor version number.
|
java.util.logging.Logger |
getParentLogger()
Return the parent Logger of all the Loggers used by this driver.
|
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.
|
public static JDBCDriver driverInstance
public final java.lang.ThreadLocal threadConnection
public Connection connect(java.lang.String url, java.util.Properties info) throws SQLException
Returns "null" if this is the wrong kind of driver to connect to the given URL. This will be common, as when the JDBC driver manager is asked to connect to a given URL it passes the URL to each loaded driver in turn.
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.
Normally at least "user" and "password" properties should be
included in the Properties
object.
For the StreamScape Database Engine, at least "user" and "password" properties should be included in the Properties.
connect
in interface Driver
url
- the URL of the database to which to connectinfo
- a list of arbitrary string tag/value pairs as connection
arguments. Normally at least a "user" and "password" property
should be included.Connection
object that represents a
connection to the URLSQLException
- if a database access error occurspublic static Connection getConnection(java.lang.String url, java.util.Properties info) throws SQLException
connect(String,Properties)
method. url
- the URL of the database to which to connectinfo
- a list of arbitrary string tag/value pairs as connection
arguments including at least at a "user" and a "password" propertyConnection
object that represents a
connection to the URLSQLException
- if a database access error occurspublic Connection connect(DataspaceAccessor accessor, java.util.TimeZone timezone) throws SQLException
SQLException
public Connection connect(DataspaceAccessor accessor, java.lang.String properties) throws SQLException
SQLException
public Connection connect(DataspaceAccessor accessor, java.util.TimeZone timezone, java.util.Properties properties) throws SQLException
SQLException
public boolean acceptsURL(java.lang.String url)
acceptsURL
in interface Driver
url
- the URL of the databasepublic DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info)
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 getPropertyInfo.
getPropertyInfo
in interface Driver
url
- the URL of the database to which to connectinfo
- a proposed list of tag/value pairs that will be sent on
connect openpublic int getMajorVersion()
getMajorVersion
in interface Driver
public int getMinorVersion()
getMinorVersion
in interface Driver
public boolean jdbcCompliant()
true
here if it passes the JDBC compliance tests; otherwise
it is required to return false
. JDBC compliance requires full support for the JDBC API and full support for SQL 92 Entry Level.
jdbcCompliant
in interface Driver
true
if this driver is JDBC Compliant;
false
otherwisepublic java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
SQLFeatureNotSupportedException
- if the driver does not use java.util.logging.
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.