com.northgateis.reality.realsql
Class RealSQLDriver

java.lang.Object
 |
 +--com.northgateis.reality.realsql.RealSQLDriver

public class RealSQLDriver
extends java.lang.Object
implements java.sql.Driver

The RealSQLDriver clase is an implementation of the JDBC 2.0 Driver . interface The methods in this class should not be called directly by a client application, they should be called indirectly via the DriverManagerclass.

Connections to a Reality database can be established by using a URL with the following format:

jdbc:realsql://host{:port}/database{;key=value,key=value,...}
 
The host name is network name for the remote system, port is optional, the default is 1203.

The database name is database name on the remote system, as defined in the ROUTE-FILE (Unix) or Registry (Windows).

The remaining optional key=value pairs are used for other connection properties; user, password, account, accountpwd, and logging options.


Field Summary
static java.lang.StringstartURL
           
 
Constructor Summary
RealSQLDriver()
          Default constructor, does nothing except call super();
 
Method Summary
 booleanacceptsURL(java.lang.String url)
          Returns true if the driver thinks that it can open a connection to the given URL.
 java.sql.Connectionconnect(java.lang.String url, java.util.Properties props)
          Attempts to make a database connection to the given URL.
 intgetMajorVersion()
          Get the major version of this driver.
 intgetMinorVersion()
          Get the minor version of this driver.
 java.sql.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.
 booleanjdbcCompliant()
          Checks if this implementation is ANSI-92 compliant, since the Reality database does not conform to ANSI-92 the driver cannot claim to be a JDBC compliant implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startURL

public static final java.lang.String startURL
Constructor Detail

RealSQLDriver

public RealSQLDriver()
Default constructor, does nothing except call super();
Method Detail

acceptsURL

public boolean acceptsURL(java.lang.String url)
 throws java.sql.SQLException
Returns true if the driver thinks that it can open a connection to the given URL. In this case, true is returned if and only if the url starts with: jdbc:realsql.

Specified by:
acceptsURL in interface java.sql.Driver
Parameters:
url - The URL of the database.
Returns:
True if this driver can connect to the given URL.
Throws:
java.sql.SQLException - never actually is thrown


connect

public java.sql.Connection connect(java.lang.String url,
 java.util.Properties props)
 throws java.sql.SQLException
Attempts to make a database connection to the given URL. The driver will return "null" if it realizes it is the wrong kind of driver to connect to the given URL.

The driver will 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 should be used to pass additional connection information, these should include:

 user        - User identiy.
 userpwd     - User password.
 account     - Reality account name.
 accountpwd  - Reality account password.
 
Specified by:
connect in interface java.sql.Driver
Parameters:
url - the URL for the database in question
p - the properties object
Returns:
null if the URL should be ignored, a new Connection implementation if the URL is a valid RealSQL URL
Throws:
java.sql.SQLException - an error occurred during connection such as a network error or bad URL
See Also:
Driver.connect(java.lang.String, java.util.Properties)

getMajorVersion

public int getMajorVersion()
Get the major version of this driver.

Specified by:
getMajorVersion in interface java.sql.Driver
Returns:
the major version
See Also:
Driver.getMajorVersion()


getMinorVersion

public int getMinorVersion()
Get the minor version of this driver.

Specified by:
getMinorVersion in interface java.sql.Driver
Returns:
the minor version
See Also:
Driver.getMinorVersion()


getPropertyInfo

public 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 getPropertyInfo.

Specified by:
getPropertyInfo in interface java.sql.Driver
Parameters:
url - the URL of the database to connect to.
info - proposed list of tag/value pairs that will be sent on connect open.
Returns:
empty Property object.
Throws:
java.sql.SQLException - never thrown


jdbcCompliant

public boolean jdbcCompliant()
Checks if this implementation is ANSI-92 compliant, since the Reality database does not conform to ANSI-92 the driver cannot claim to be a JDBC compliant implementation.

Specified by:
jdbcCompliant in interface java.sql.Driver
Returns:
always returns false.