|
1.50.39 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--interbase.interclient.Driver
Represents a driver implementation and a factory for connections.
The Java SQL framework allows for multiple database drivers. Each driver should supply a class that implements the Driver interface. 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.
It is strongly recommended that each Driver class should be small and standalone so that the Driver class can be loaded and queried without bringing in vast quantities of supporting code.
When a Driver class is loaded, it should create an instance of itself and register it with the DriverManager. This means that a user can load and register a driver by doing Class.forName("foo.bah.Driver").
InterClient note:
There are various ways to load the InterClient driver. See FirstExample.java in the InterClient examples directory for details. The basic method for loading the driver is as follows:
Class.forName ("interbase.interclient.Driver"); DriverManager.getConnection ("jdbc:interbase://server/c:/database-dir/atlas.gdb", "sysdba", "masterkey");You can register a named driver instance with the driver manager in addition to the automatically registered anonymous instance.
java.sql.Driver driver = new interbase.interclient.Driver (); java.sql.DriverManager.registerDriver (driver);However, registering multiple InterClient driver instances would only be necessary if different instances recognized different URL prefixes. For now, the InterClient driver only recognizes the JDBC protocol "jdbc:interbase:".
Information on using the InterClient driver with JBuilder can be found in the distributed JBuilderNotes.txt file.
Although an InterClient driver may have an expiration date, for most general releases InterClient itself will not expire. Instead the InterServer component has an expiration date defined in the InterServer license file (ic_license.dat). Newer releases of InterServer may refuse to talk with older releases of InterClient. In this way, an older release of InterClient is effectively expired when all compatible versions of InterServer expire. A customer wishing to continue using a older version of InterServer/InterClient, may substitute in a new ic_license.dat file with an extended license.
java.sql.DriverManager
,
Connection
Field Summary | |
static int |
betaBuild
An intermediate level of InterClient build certification. |
static int |
finalBuild
The highest level of InterClient build certification. |
static int |
testBuild
The lowest level of InterClient build certification. |
Constructor Summary | |
Driver()
Create an explicit driver instance. |
Method Summary | |
boolean |
acceptsURL(String url)
Returns true if the driver thinks that it can open a connection to the given URL. |
boolean |
clientServerEdition()
Are remote connections allowed. |
Connection |
connect(String url,
Properties properties)
Try to make a database connection to the given URL. |
boolean |
expiredDriver()
Has the InterClient driver expired. |
int |
getBuildCertificationLevel()
Gets the build certification level for this version of the InterClient driver. |
int |
getBuildNumber()
Gets the build number for this InterClient driver. |
String |
getCompanyName()
Gets the name of the company that developed this driver. |
int[] |
getCompatibleIBVersions()
Gets the InterBase major versions which are compatible with this version of the InterClient driver. |
String[] |
getCompatibleJREVersions()
Gets the JRE versions which are compatible with this version of the InterClient driver. |
Date |
getExpirationDate()
Gets the expiration date for this driver. |
String |
getJDBCNetProtocol()
Gets the database URL prefix to use for InterBase connections. |
int |
getJDBCNetProtocolVersion()
Gets the version of the messaging protocol between InterClient and InterServer. |
int |
getMajorVersion()
Get the driver's major version number. |
int |
getMinorVersion()
Get the driver's minor version number. |
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties properties)
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. |
Server |
getServer(String serverURL,
Properties properties)
Attaches to the InterServer/InterBase administration service. |
boolean |
jdbcCompliant()
Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int testBuild
public static final int betaBuild
public static final int finalBuild
Constructor Detail |
public Driver()
Method Detail |
public Connection connect(String url, Properties properties) throws SQLException
The driver should raise a 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 passed arbitrary string tag/value pairs as connection arguments. Normally at least "user" and "password" properties should be included in the Properties.
InterClient note: A ConnectionProperties class is supplied as a convenience for setting connection properties before requesting a connection.
url
- The URL of the database to connect toinfo
- a list of arbitrary string tag/value pairs as
connection arguments; normally at least a "user" and
"password" property should be includedpublic boolean acceptsURL(String url) throws SQLException
InterClient note: InterClient only accepts URLs which begin with "jdbc:interbase:".
url
- The URL of the database.public DriverPropertyInfo[] getPropertyInfo(String url, Properties properties)
url
- The URL of the database to connect to.info
- A proposed list of tag/value pairs that will be sent on connect open.public int getMajorVersion()
public int getMinorVersion()
InterClient note: In addition to major and minor version numbers, InterClient provides build numbers to further qualify driver versions. Build numbers may be extracted from an InterClient driver object via an extension to the JDBC API, getBuildNumber().
public boolean jdbcCompliant()
InterClient note: InterBase is only two features shy of compliance:
public int getBuildNumber()
getBuildCertificationLevel()
public int getBuildCertificationLevel()
The progression from test, beta, to final build is not static functionally. That is, new functionality may be added to a beta build that does not exist in a test build, and likewise, there may be new functionality in a final build which does not exist in a beta build of the same version.
public String[] getCompatibleJREVersions()
public int[] getCompatibleIBVersions()
public Date getExpirationDate()
Note: Although InterClient may not expire, InterServer may.
ExpiredDriverException
,
DatabaseMetaData.getServerExpirationDate()
public boolean expiredDriver()
public boolean clientServerEdition()
A non-client/server edition would only allow "localhost" connections.
public String getJDBCNetProtocol()
A type 3 JDBC driver, such as InterClient, establishes a DBMS independent communication layer between the JDBC client and a middleware server (InterServer). Of course, InterServer uses a DBMS specific protocol for talking with the InterBase server on the backend.
public int getJDBCNetProtocolVersion()
DatabaseMetaData.getServerJDBCNetProtocolVersion()
public String getCompanyName()
public Server getServer(String serverURL, Properties properties) throws SQLException
Most server operations will require you to pass the
SYSDBA user and password as server properties
.
Note: This does not start the InterBase service. The InterBase service may be started with the Server.startup() method.
|
1.50.39 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |