org.h2
Class Driver

java.lang.Object
  extended by org.h2.Driver
All Implemented Interfaces:
java.sql.Driver

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

The database driver. An application should not use this class directly. The only thing the application needs to do is load the driver. This can be done using Class.forName. To load the driver and open a database connection, use the following code:

 Class.forName("org.h2.Driver");
 Connection conn = DriverManager.getConnection(
      "jdbc:h2:˜/test", "sa", "sa");
 


Constructor Summary
Driver()
           
 
Method Summary
 boolean acceptsURL(java.lang.String url)
          Check if the driver understands this URL.
 java.sql.Connection connect(java.lang.String url, java.util.Properties info)
          Open a database connection.
 int getMajorVersion()
          Get the major version number of the driver.
 int getMinorVersion()
          Get the minor version number of the driver.
 java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info)
          Get the list of supported properties.
 boolean jdbcCompliant()
          Check if this driver is compliant to the JDBC specification.
static Driver load()
          INTERNAL
static void unload()
          INTERNAL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Driver

public Driver()
Method Detail

connect

public java.sql.Connection connect(java.lang.String url,
                                   java.util.Properties info)
                            throws java.sql.SQLException
Open a database connection. This method should not be called by an application. Instead, the method DriverManager.getConnection should be used.

Specified by:
connect in interface java.sql.Driver
Parameters:
url - the database URL
info - the connection properties
Returns:
the new connection
Throws:
java.sql.SQLException

acceptsURL

public boolean acceptsURL(java.lang.String url)
Check if the driver understands this URL. This method should not be called by an application.

Specified by:
acceptsURL in interface java.sql.Driver
Parameters:
url - the database URL
Returns:
if the driver understands the URL

getMajorVersion

public int getMajorVersion()
Get the major version number of the driver. This method should not be called by an application.

Specified by:
getMajorVersion in interface java.sql.Driver
Returns:
the major version number

getMinorVersion

public int getMinorVersion()
Get the minor version number of the driver. This method should not be called by an application.

Specified by:
getMinorVersion in interface java.sql.Driver
Returns:
the minor version number

getPropertyInfo

public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url,
                                                     java.util.Properties info)
Get the list of supported properties. This method should not be called by an application.

Specified by:
getPropertyInfo in interface java.sql.Driver
Parameters:
url - the database URL
info - the connection properties
Returns:
a zero length array

jdbcCompliant

public boolean jdbcCompliant()
Check if this driver is compliant to the JDBC specification. This method should not be called by an application.

Specified by:
jdbcCompliant in interface java.sql.Driver
Returns:
true

load

public static Driver load()
INTERNAL


unload

public static void unload()
INTERNAL