Package SQLite
Class JDBCDriver
java.lang.Object
SQLite.JDBCDriver
- All Implemented Interfaces:
Driver
public class JDBCDriver extends Object implements Driver
-
Field Summary
Fields Modifier and Type Field Description protected Connectionconnstatic intMAJORVERSIONstatic booleansharedCachestatic Stringvfs -
Constructor Summary
Constructors Constructor Description JDBCDriver() -
Method Summary
Modifier and Type Method Description booleanacceptsURL(String url)Returns whether the driver thinks that it can open a connection to the given URL.Connectionconnect(String url, Properties info)Attempts to make a database connection to a data source specified by a supplied URL.intgetMajorVersion()Gets the driver's major version number.intgetMinorVersion()Gets the driver's minor version number.DriverPropertyInfo[]getPropertyInfo(String url, Properties info)Gets information about possible properties for this driver.booleanjdbcCompliant()Reports whether this driver is a genuine JDBC CompliantTM driver.
-
Field Details
-
MAJORVERSION
public static final int MAJORVERSION- See Also:
- Constant Field Values
-
vfs
-
conn
-
-
Constructor Details
-
JDBCDriver
public JDBCDriver()
-
-
Method Details
-
acceptsURL
Description copied from interface:DriverReturns whether the driver thinks that it can open a connection to the given URL.- Specified by:
acceptsURLin interfaceDriver- Parameters:
url- the URL to connect to.- Returns:
trueif the driver thinks that is can open a connection to the supplied URL,falseotherwise. Typically, the driver will respondtrueif it thinks that it can handle the subprotocol specified by the driver.- Throws:
SQLException- if a database error occurs.
-
connect
Description copied from interface:DriverAttempts to make a database connection to a data source specified by a supplied URL.- Specified by:
connectin interfaceDriver- Parameters:
url- the URL to connect.info- some properties that should be used in establishing the connection. The properties consist of name/value pairs of strings. Normally, a connection to a database requires at least two properties - for"user"and"password"in order to pass authentication to the database.- Returns:
- the connection to the database.
- Throws:
SQLException- if a database error occurs.
-
getMajorVersion
public int getMajorVersion()Description copied from interface:DriverGets the driver's major version number.- Specified by:
getMajorVersionin interfaceDriver- Returns:
- the major version number of the driver - typically starts at 1.
-
getMinorVersion
public int getMinorVersion()Description copied from interface:DriverGets the driver's minor version number.- Specified by:
getMinorVersionin interfaceDriver- Returns:
- the minor version number of the driver - typically starts at 0.
-
getPropertyInfo
Description copied from interface:DriverGets information about possible properties for this driver.This method is intended to provide a listing of possible properties that the client of the driver must supply in order to establish a connection to a database. Note that the returned array of properties may change depending on the supplied list of property values.
- Specified by:
getPropertyInfoin interfaceDriver- Parameters:
url- the URL of the database. An application may call this method iteratively as the property list is built up - for example, when displaying a dialog to an end-user as part of the database login process.info- a set of tag/value pairs giving data that a user may be prompted to provide in order to connect to the database.- Returns:
- an array of
DriverPropertyInforecords which provide details on which additional properties are required (in addition to those supplied in theinfoparameter) in order to connect to the database. - Throws:
SQLException- if a database error occurs.
-
jdbcCompliant
public boolean jdbcCompliant()Description copied from interface:DriverReports whether this driver is a genuine JDBC CompliantTM driver. The driver may only returntrueif it passes all the JDBC compliance tests.A driver may not be fully compliant if the underlying database has limited functionality.
- Specified by:
jdbcCompliantin interfaceDriver- Returns:
trueif the driver is fully JDBC compliant,falseotherwise.
-