borland Packages Class Hierarchy datastore.jdbc Package
java.lang.Object +----com.borland.datastore.jdbc.DataStoreDriver
Variables Constructors Properties Methods
Implements Driver
DataStoreDriver
is the JDBC driver for the DataStore
.
The driver supports both local and remote access. Both types of access
require a user name (any string, with no setup required) and an empty
password.
Local access provides exclusive, transactional, single-user access to a DataStore file that is accessible by the machine requesting the connection. Exclusive access means that the DataStore file cannot be opened by another process. You can open other connections from the same process, using another JDBC connection, the DataExpress API, or the DataStore API. The JDBC URL for local access is:
jdbc:borland:dslocal:<filename>
Remote access requires a DataStore server. A basic server implementation is available by running the
com.borland.jbuilder.dsserver.Server
class. By
routing all requests through a single DataStore server process, you get
transactional multi-user access to a DataStore. The DataStore file must
be accessible from the DataStore server. The JDBC URL for remote
access is:
jdbc:borland:dsremote://<hostname>/<filename>
For example, a simple JDBC local connection might look like:
Class.forName( "com.borland.datastore.jdbc.DataStoreDriver" ); Connection con = DriverManager.getConnection( "jdbc:borland:dslocal:c:/mydir/mystore.jds", "MyUserName", "" );
A remote connection using DataExpress might look like:
ConnectionDescriptor con = new ConnectionDescriptor( "jdbc:borland:dsremote://MYSERVER/c:/serverdir/serverdb.jds", "MyUserName", "", false, "com.borland.datastore.jdbc.DataStoreDriver" );
The DataStore JDBC driver supports the following properties:
Property name | Value (all strings) |
---|---|
user | Any name (no setup required) |
password | Password. There is no security with DataStoreDriver , so
this should be an empty string.
|
port | Port to connect on; the default is 2508. |
readonly | "true" or "false" : whether to open the connection read-only.
|
lockWaitTime | Time to wait for lock before aborting transaction, in milliseconds; default 10000 (10 seconds) |
The following example gets a read-only connection on port 9876 using driver properties:
Class.forName( "com.borland.datastore.jdbc.DataStoreDriver" ); java.util.Properties info = new java.util.Properties(); info.setProperty( "user" , "MyUserName" ); info.setProperty( "password", "" ); info.setProperty( "port" , "9876" ); info.setProperty( "readonly", "true" ); Connection con = DriverManager.getConnection( "jdbc:borland:dsremote://MYSERVER/c:/serverdir/serverdb.jds", info );
DataStoreDriver
supports a subset of the ANSI/ISO SQL-92
standard. In general, it provides:
DataStore SQL Reference
.
public static final String URL_START_LOCAL = "jdbc:borland:dslocal:"
public static final String URL_START_REMOTE = "jdbc:borland:dsremote:"
public DataStoreDriver()The
DataStoreDriver
constructor is usually not called directly.
Typically, JDBC drivers register themselves with the JDBC driver manager
when their class is loaded (for example, when using
Class.forName
).
public int getMajorVersion()The part of the version number that indicates significant changes in the driver. For example, for version 1.02, the major version number is 1.
public int getMinorVersion()The part of the version number that indicates maintenance changes in the driver. For example, for version 1.02, the minor version number is 2.
public final int checkURL(String url)Internal use only.
public final String getConnectName(String url, boolean remote)Returns whatever's to the right of the JDS protocol in the URL. For the local JDataStore JDBC driver, this would be the file name. For the remote JDataStore JDBC Driver, this would be the host name plus the file name.
public static final void load()Internal use method that registers the
DataStoreDriver
with the DriverManager
.