All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.imaginary.sql.msql.MsqlDriver

com.imaginary.sql.msql.MsqlDriver

public class MsqlDriver
The MsqlDriver class implements the JDBC Driver interface from the JDBC specification. A Driver is specifically concerned with making database connections via new JDBC Connection instances by responding to URL requests.
Last modified $Date: 1999/07/09 23:16:28 $

Version:
$Revision: 1.1.2.1.2.2 $
Author:
George Reese (borg@imaginary.com)

Constructor Index

 o MsqlDriver()
Constructs an MsqlDriver instance.

Method Index

 o acceptsURL(String)
Returns true if the driver thinks that it can open a connection to the given URL.
 o connect(String, Properties)
Takes a look at the given URL to see if it is meant for this driver.
 o getMajorVersion()
Gives the major version for this driver as required by the JDBC specification.
 o getMinorVersion()
Gives the minor version for this driver as required by the JDBC specification.
 o getPropertyInfo(String, 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.
 o jdbcCompliant()

Constructors

 o MsqlDriver
 public MsqlDriver() throws SQLException
Constructs an MsqlDriver instance. The JDBC specification requires the driver then to register itself with the DriverManager.

Throws: SQLException
an error occurred in registering

Methods

 o acceptsURL
 public boolean acceptsURL(String url) throws 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 subprotocol is 'msql'.

Parameters:
url - The URL of the database.
Returns:
True if this driver can connect to the given URL.
Throws: SQLException
never actually is thrown
 o connect
 public Connection connect(String url,
                           Properties p) throws SQLException
Takes a look at the given URL to see if it is meant for this driver. If not, simply return null. If it is, then go ahead and connect to the database. For the mSQL implementation of JDBC, it looks for URL's in the form of

     jdbc:msql://[host_addr]:[port]/[db_name]
 

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 mSQL URL
Throws: SQLException
an error occurred during connection such as a network error or bad URL
See Also:
connect
 o getMajorVersion
 public int getMajorVersion()
Gives the major version for this driver as required by the JDBC specification.

Returns:
the major version
See Also:
getMajorVersion
 o getMinorVersion
 public int getMinorVersion()
Gives the minor version for this driver as required by the JDBC specification.

Returns:
the minor version
See Also:
getMinorVersion
 o getPropertyInfo
 public DriverPropertyInfo[] getPropertyInfo(String url,
                                             Properties info) throws 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.

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.
Throws: SQLException
never actually thrown
 o jdbcCompliant
 public boolean jdbcCompliant()
Returns:
information noting the fact that the mSQL database is not SQL-92 and thus cannot support a JDBC compliant implementation.

All Packages  Class Hierarchy  This Package  Previous  Next  Index