Quadcap Embeddable Database

com.quadcap.jdbc.JdbcDriver Class Reference

Inheritance diagram for com.quadcap.jdbc.JdbcDriver:

QDriver List of all members.

Detailed Description

This class implements the java.sql.Driver interface, which provides a basic mechanism for establishing connections to a QED database.

A driver can support multiple simultaneously open databases -- the database URL specifies a file name which is the root directory of the database, and which is used to select the correct database.

Author:
Stan Bailes

Definition at line 76 of file JdbcDriver.java.

Public Member Functions

 JdbcDriver ()
 No-argument constructor.

java.sql.Connection makeConnection (Database db, String auth, String passwd) throws SQLException
 Make a new Connection for the specified database and user.

QedResultSet makeResultSet (Cursor c)
 Make a QedResultSet to wrap the internal database cursor.

boolean acceptsURL (String url)
 Return true if this is a QED JDBC URL.

java.sql.Connection connect (String url, Properties props) throws SQLException
 Assuming that url is a QED URL, return a new Connection object that can be used to access the database specified by that url.

int getMajorVersion ()
 Return the driver major version number.

int getMinorVersion ()
 Return the driver minor version number.

DriverPropertyInfo[] getPropertyInfo (String url, Properties info) throws SQLException
 Return an array of DriverPropertyInfo objects that describe the properties required to connect to a QED database.

boolean jdbcCompliant ()
 QED is a JDBC compliant driver.

void closeDatabase (final String name)
 Close the specified database.

Enumeration getDatabaseNames ()
 Enumerate the currently open databases.

Database getDatabase (String name)
 Locate a specific database by name.

Session getSession (java.sql.Connection conn)
 Return the session for this connection.


Static Public Member Functions

void closeAll ()
 Close all databases (presumably at program exit).


Static Public Attributes

JdbcDriver jdbcDriver = null

Static Package Functions

 [static initializer]

Static Package Attributes

final ConfigNumber trace
Hashtable dbs = new Hashtable()


Constructor & Destructor Documentation

com.quadcap.jdbc.JdbcDriver.JdbcDriver  ) 
 

No-argument constructor.

Definition at line 119 of file JdbcDriver.java.


Member Function Documentation

com.quadcap.jdbc.JdbcDriver.[static initializer]  )  [static, package]
 

boolean com.quadcap.jdbc.JdbcDriver.acceptsURL String  url  ) 
 

Return true if this is a QED JDBC URL.

QED URLS are of the form jdbc:qed:<i>database.

Parameters:
url a URL
Returns:
true if url is a QED JDBC URL.

Definition at line 161 of file JdbcDriver.java.

References com.quadcap.jdbc.JdbcDriver.acceptsURL().

Referenced by com.quadcap.jdbc.JdbcDriver.acceptsURL().

void com.quadcap.jdbc.JdbcDriver.closeAll  )  [static]
 

Close all databases (presumably at program exit).

Definition at line 355 of file JdbcDriver.java.

References com.quadcap.jdbc.JdbcDriver.dbs.

void com.quadcap.jdbc.JdbcDriver.closeDatabase final String  name  ) 
 

Close the specified database.

Deprecated:
Pay no attention to that man behind the curtains.
Parameters:
name the name of the database.

Definition at line 306 of file JdbcDriver.java.

References com.quadcap.jdbc.JdbcDriver.closeDatabase(), com.quadcap.jdbc.JdbcDriver.dbs, and com.quadcap.jdbc.JdbcDriver.trace.

Referenced by com.quadcap.jdbc.JdbcDriver.closeDatabase().

java.sql.Connection com.quadcap.jdbc.JdbcDriver.connect String  url,
Properties  props
throws SQLException
 

Assuming that url is a QED URL, return a new Connection object that can be used to access the database specified by that url.

Parameters:
url a JDBC URL. If the URL string contains a semicolon, then the URL proper is interpreted as the portion of the string preceeding the semicolon, and the remaining string is treated as a semi-colon separated list of 'name=value' connection properties. E.g., jdbc:qed:db1;create=true
props a set of connection properties.
Returns:
a new Connection
Exceptions:
SQLException may be thrown

Definition at line 189 of file JdbcDriver.java.

References com.quadcap.sql.Database.addConnection(), com.quadcap.jdbc.JdbcDriver.connect(), com.quadcap.jdbc.JdbcDriver.dbs, com.quadcap.sql.Database.driverLock, com.quadcap.sql.Database.init(), com.quadcap.sql.Database.removeConnection(), and com.quadcap.jdbc.JdbcDriver.trace.

Referenced by com.quadcap.jdbc.JdbcDriver.connect().

Database com.quadcap.jdbc.JdbcDriver.getDatabase String  name  ) 
 

Locate a specific database by name.

Deprecated:
Pay no attention to that man behind the curtains..
Parameters:
name the name of the database
Returns:
the database.

Definition at line 346 of file JdbcDriver.java.

References com.quadcap.jdbc.JdbcDriver.dbs, and com.quadcap.jdbc.JdbcDriver.getDatabase().

Referenced by com.quadcap.jdbc.JdbcDriver.getDatabase().

Enumeration com.quadcap.jdbc.JdbcDriver.getDatabaseNames  ) 
 

Enumerate the currently open databases.

Deprecated:
Pay no attention to that man behind the curtains..
Returns:
an enumeration of the names of the currently open databases

Definition at line 335 of file JdbcDriver.java.

References com.quadcap.jdbc.JdbcDriver.dbs.

int com.quadcap.jdbc.JdbcDriver.getMajorVersion  ) 
 

Return the driver major version number.

Returns:
the driver's major version number

Definition at line 258 of file JdbcDriver.java.

int com.quadcap.jdbc.JdbcDriver.getMinorVersion  ) 
 

Return the driver minor version number.

Returns:
the driver's minor version number

Definition at line 265 of file JdbcDriver.java.

DriverPropertyInfo [] com.quadcap.jdbc.JdbcDriver.getPropertyInfo String  url,
Properties  info
throws SQLException
 

Return an array of DriverPropertyInfo objects that describe the properties required to connect to a QED database.

Currently no properties are required except user

Parameters:
url the database url
info the properties the client has so far.
Returns:
the required connect properties

Definition at line 277 of file JdbcDriver.java.

References com.quadcap.jdbc.JdbcDriver.getPropertyInfo().

Referenced by com.quadcap.jdbc.JdbcDriver.getPropertyInfo().

Session com.quadcap.jdbc.JdbcDriver.getSession java.sql.Connection  conn  ) 
 

Return the session for this connection.

Definition at line 372 of file JdbcDriver.java.

References com.quadcap.jdbc.JdbcDriver.getSession().

Referenced by com.quadcap.jdbc.JdbcDriver.getSession().

boolean com.quadcap.jdbc.JdbcDriver.jdbcCompliant  ) 
 

QED is a JDBC compliant driver.

Returns:
true

Definition at line 296 of file JdbcDriver.java.

java.sql.Connection com.quadcap.jdbc.JdbcDriver.makeConnection Database  db,
String  auth,
String  passwd
throws SQLException
 

Make a new Connection for the specified database and user.

Deprecated:
Pay no attention to that man behind the curtains.
Parameters:
db the database
auth the userid

Definition at line 130 of file JdbcDriver.java.

References com.quadcap.jdbc.JdbcDriver.makeConnection(), and com.quadcap.jdbc.JdbcDriver.trace.

Referenced by com.quadcap.jdbc.JdbcDriver.makeConnection().

QedResultSet com.quadcap.jdbc.JdbcDriver.makeResultSet Cursor  c  ) 
 

Make a QedResultSet to wrap the internal database cursor.

Deprecated:
Pay no attention to that man behind the curtains.
Parameters:
c the cursor
Returns:
the resultset

Definition at line 150 of file JdbcDriver.java.

References com.quadcap.jdbc.JdbcDriver.makeResultSet().

Referenced by com.quadcap.jdbc.JdbcDriver.makeResultSet().


Member Data Documentation

Hashtable com.quadcap.jdbc.JdbcDriver.dbs = new Hashtable() [static, package]
 

Definition at line 104 of file JdbcDriver.java.

Referenced by com.quadcap.jdbc.JdbcDriver.closeAll(), com.quadcap.jdbc.JdbcDriver.closeDatabase(), com.quadcap.jdbc.JdbcDriver.connect(), com.quadcap.jdbc.JdbcDriver.getDatabase(), and com.quadcap.jdbc.JdbcDriver.getDatabaseNames().

JdbcDriver com.quadcap.jdbc.JdbcDriver.jdbcDriver = null [static]
 

Definition at line 106 of file JdbcDriver.java.

final ConfigNumber com.quadcap.jdbc.JdbcDriver.trace [static, package]
 

Initial value:

ConfigNumber.find("qed.trace.JdbcDriver", "0")

Definition at line 100 of file JdbcDriver.java.

Referenced by com.quadcap.jdbc.JdbcDriver.closeDatabase(), com.quadcap.jdbc.JdbcDriver.connect(), and com.quadcap.jdbc.JdbcDriver.makeConnection().