|
SQLFire 1.0.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.vmware.sqlfire.jdbc.EmbeddedDriver
public class EmbeddedDriver
The embedded JDBC driver (Type 4) for SQLFire.
The driver automatically supports the correct JDBC specification version for the Java Virtual Machine's environment.
Loading this JDBC driver boots the database engine within the same Java virtual machine.
The correct code to load the SQLFire engine using this driver is (with approriate try/catch blocks):
Class.forName("com.vmware.sqlfire.jdbc.EmbeddedDriver").newInstance();
// or
new com.vmware.sqlfire.jdbc.EmbeddedDriver();
When loaded in this way, the class boots the actual JDBC driver indirectly.
The JDBC specification recommends the Class.ForName method without the .newInstance()
method call, but adding the newInstance() guarantees
that SQLFire will be booted on any Java Virtual Machine.
Note that you do not need to manually load the driver this way if you are running on Jave SE 6 or later. In that environment, the driver will be automatically loaded for you when your application requests a connection to a SQLFire database.
Any initial error messages are placed in the PrintStream supplied by the DriverManager. If the PrintStream is null error messages are sent to System.err. Once the SQLFire engine has set up an error logging facility (by default to sqlfire.log) all subsequent messages are sent to it.
By convention, the class used in the Class.forName() method to boot a JDBC driver implements java.sql.Driver. This class is not the actual JDBC driver that gets registered with the Driver Manager. It proxies requests to the registered SQLFire JDBC driver.
DriverManager,
DriverManager.getLogStream(),
Driver,
SQLException| Constructor Summary | |
|---|---|
EmbeddedDriver()
|
|
| Method Summary | |
|---|---|
boolean |
acceptsURL(String url)
Accept anything that starts with jdbc:derby:. |
static void |
boot()
|
Connection |
connect(String url,
Properties info)
Connect to the URL if possible |
int |
getMajorVersion()
Returns the driver's major version number. |
int |
getMinorVersion()
Returns the driver's minor version number. |
Logger |
getParentLogger()
|
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info)
Returns an array of DriverPropertyInfo objects describing possible properties. |
boolean |
jdbcCompliant()
Report whether the Driver is a genuine JDBC COMPLIANT (tm) driver. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EmbeddedDriver()
| Method Detail |
|---|
public boolean acceptsURL(String url)
throws SQLException
jdbc:derby:.
acceptsURL in interface DriverSQLException - if a database-access error occurs.Driver
public Connection connect(String url,
Properties info)
throws SQLException
connect in interface DriverSQLException - illegal url or problem with connectiongDriver
public DriverPropertyInfo[] getPropertyInfo(String url,
Properties info)
throws SQLException
getPropertyInfo in interface DriverSQLException - if a database-access error occurs.Driverpublic int getMajorVersion()
getMajorVersion in interface DriverDriverpublic int getMinorVersion()
getMinorVersion in interface DriverDriverpublic boolean jdbcCompliant()
jdbcCompliant in interface DriverDriverpublic static void boot()
public Logger getParentLogger()
throws SQLFeatureNotSupportedException
SQLFeatureNotSupportedException
|
SQLFire 1.0.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||