Overview | Package | Class | Tree | Deprecated | Index | Help

2.01.05
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## interbase.interclient
Class Driver

    java.lang.Object
      |
      +--interbase.interclient.Driver

All Implemented Interfaces:
  Driver

public final class Driver
extends Object
implements 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 Notes:

There are various ways to load the InterClient driver. See DriverExample.java in the InterClient examples directory for details on loading the InterClient driver under the JDBC 1 Driver API. For details on loading the InterClient driver under the JDBC 2 `DataSource` API see DataSourceExample.java.

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.

Also see the JDBC 2 Standard Extension `DataSource` API for the preferred alternative to the Driver API for establishing connections.

Since:
  JDBC 1
See Also:
  `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.
`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

### testBuild

    public static final int testBuild

  The lowest level of InterClient build certification. Test builds are experimental and uncertified with no level of quality assurance.
  Since:
    Extension, since InterClient 1.50

### betaBuild

    public static final int betaBuild

  An intermediate level of InterClient build certification. Beta builds are certified for quality assurance, but remain experimental.
  Since:
    Extension, since InterClient 1.50

### finalBuild

    public static final int finalBuild

  The highest level of InterClient build certification. A final build is certified for quality assurance, but is not experimental.
  Since:
    Extension, since InterClient 1.50

Constructor Detail

### Driver

    public Driver()

  Create an explicit driver instance. See FirstExample.java for example usage.
  Since:
    Extension, since InterClient 1.0

Method Detail

### connect

    public Connection connect(String url,
                              Properties properties)
                       throws SQLException

  Try to make a database connection to the given URL. The driver should return "null" if it realizes it 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 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: See Connection Properties in the InterClient Help documentation.

  Specified by:
    `connect` in interface `Driver`
  Parameters:
    `url` - The URL of the database to connect to
    `info` - a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included
  Returns:
    a Connection to the URL
  Throws:
    `SQLException` - if a database access error occurs.
  Since:
    JDBC 1

### acceptsURL

    public boolean acceptsURL(String url)
                       throws SQLException

  Returns true if the driver thinks that it can open a connection to the given URL. Typically drivers will return true if they understand the subprotocol specified in the URL and false if they don't.

  InterClient note: InterClient only accepts URLs which begin with "jdbc:interbase:".

  Specified by:
    `acceptsURL` in interface `Driver`
  Parameters:
    `url` - The URL of the database.
  Returns:
    True if this driver can connect to the given URL.
  Throws:
    `SQLException` - if a database access error occurs.
  Since:
    JDBC 1

### getPropertyInfo

    public 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. 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.
  Specified by:
    `getPropertyInfo` in interface `Driver`
  Parameters:
    `url` - The URL of the database to connect to.
    `info` - A proposed list of tag/value pairs that will be sent on connect open.
  Returns:
    An array of DriverPropertyInfo objects describing possible properties. This array may be an empty array if no properties are required.
  Since:
    JDBC 1

### getMajorVersion

    public int getMajorVersion()

  Get the driver's major version number. Initially this should be 1.
  Specified by:
    `getMajorVersion` in interface `Driver`
  Since:
    JDBC 1

### getMinorVersion

    public int getMinorVersion()

  Get the driver's minor version number. Initially this should be 0.

  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()`.

  Specified by:
    `getMinorVersion` in interface `Driver`
  Since:
    JDBC 1

### jdbcCompliant

    public boolean jdbcCompliant()

  Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver. A driver may only report "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. It is expected that JDBC compliant drivers will be available for all the major commercial databases. This method is not intended to encourage the development of non-JDBC compliant drivers, but is a recognition of the fact that some vendors are interested in using the JDBC API and framework for lightweight databases that do not support full database functionality, or for special databases such as document information retrieval where a SQL implementation may not be feasible.

  InterClient note: InterBase is only two features shy of compliance:

  - Quoted SQL identifiers.
  - Asynchronous cancel and statement timeout.
  Specified by:
    `jdbcCompliant` in interface `Driver`
  Returns:
    true if so
  Since:
    JDBC 1

### getBuildNumber

    public int getBuildNumber()

  Gets the build number for this InterClient driver.
  Since:
    Extension, since InterClient 1.0
  See Also:
    `getBuildCertificationLevel()`

### getBuildCertificationLevel

    public int getBuildCertificationLevel()

  Gets the build certification level for this version of the InterClient driver. The InterClient certification levels are as follows:
  - `testBuild` Test builds are experimental and uncertified with no level of quality assurance whatsoever.
  - `betaBuild` Beta builds are certified for quality assurance, but remain experimental.
  - `finalBuild` The highest level of InterClient build certification. A final build is certified for quality assurance, but is not experimental.
  These are not JDBC certification levels, rather they represent a level of quality assurance for a particular build of an InterClient driver. So, for example, an InterClient version 2.0.1 may be a test build, and 2.0.21 may be a beta build, and 2.0.41 may be the final build.

  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.

  Returns:
    the build certification level
  Since:
    Extension, since InterClient 1.50

### clientServerEdition

    public boolean clientServerEdition()

  Are remote connections allowed.

  A non-client/server edition would only allow "localhost" connections.

  Returns:
    true if remote connections are allowed, false for localhost only.
  Since:
    Extension, since InterClient 1.0

### expiredDriver

    public boolean expiredDriver()

  Has the InterClient driver expired.
  Since:
    Extension, since InterClient 1.0

### getCompanyName

    public String getCompanyName()

  Gets the name of the company that developed this driver.
  Returns:
    The company that produced this driver.
  Since:
    Extension, since InterClient 1.0

### getCompatibleJREVersions

    public String[] getCompatibleJREVersions()

  Gets the JRE versions which are compatible with this version of the InterClient driver.
  Returns:
    an array of JRE versions, eg. {"1.2", "1.3"}.
  Since:
    Extension, since InterClient 1.50

### getCompatibleIBVersions

    public int[] getCompatibleIBVersions()

  Gets the InterBase major versions which are compatible with this version of the InterClient driver.
  Returns:
    an array of InterBase major versions as integers, eg. {5, 6}.
  Since:
    Extension, since InterClient 1.50

### getExpirationDate

    public Date getExpirationDate()

  Gets the expiration date for this driver. Returns null if the InterClient driver does not expire.

  Note: Although InterClient may not expire, InterServer may.

  Since:
    Extension, since InterClient 1.0
  See Also:
    `ExpiredDriverException`, `DatabaseMetaData.getInterServerExpirationDate()`

### getJDBCNetProtocol

    public String getJDBCNetProtocol()

  Gets the database URL prefix to use for InterBase connections.
  Returns:
    jdbc:interbase:
  Since:
    Extension, since InterClient 1.0

### getJDBCNetProtocolVersion

    public int getJDBCNetProtocolVersion()

  Gets the version of the messaging protocol between InterClient and InterServer.
  Since:
    Extension, since InterClient 1.0
  See Also:
    `DatabaseMetaData.getInterServerJDBCNetProtocolVersion()`

Overview | Package | Class | Tree | Deprecated | Index | Help

2.01.05
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Send comments or suggestions to interclient@borland.com