All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.access.AS400JDBCDriver
java.lang.Object
|
+----com.ibm.as400.access.AS400JDBCDriver
- public class AS400JDBCDriver
- extends Object
- implements Driver
The AS400JDBCDriver class
is a JDBC driver accesses DB2 for OS/400 databases.
To use this driver, the application or caller
must register it with the JDBC DriverManager. See the
AS/400 for Java Toolbox API and
Technical Reference for more information about registering
the driver.
After registering the driver, applications make connection
requests to the DriverManager, which dispatches them to the
appropriate driver. This driver accepts connection requests
for databases specified by the URLs that match the following syntax:
jdbc:as400://server-name/default-schema;properties
The driver uses the specified server name to connect
to a corresponding AS/400 server. The default schema is
optional and the driver uses it to resolve unqualified names
in SQL statements. In addition, properties can optionally be set
within the URL. They are separated by semicolons and are
in the form:
name1=value1;name2=value2;...
See JDBC properties for a
complete list of properties supported by this driver.
- See Also:
- AS400JDBCConnection
-
AS400JDBCDriver()
-
-
acceptsURL(String)
- Indicates if the driver understands how to connect
to the database named by the URL.
-
connect(String, Properties)
- Connects to the database named by the specified URL.
-
getMajorVersion()
- Returns the driver's major version number.
-
getMinorVersion()
- Returns the driver's minor version number.
-
getPropertyInfo(String, Properties)
- Returns an array of DriverPropertyInfo objects that
describe the properties that are supported by this
driver.
-
jdbcCompliant()
- Indicates if the driver is a genuine JDBC compliant driver.
-
toString()
- Returns the name of the driver.
AS400JDBCDriver
public AS400JDBCDriver()
acceptsURL
public boolean acceptsURL(String url) throws SQLException
- Indicates if the driver understands how to connect
to the database named by the URL.
- Parameters:
- url - The URL for the database.
- Returns:
- true if the driver understands how
to connect to the database; false
otherwise.
- Throws: SQLException
- If an error occurs.
connect
public Connection connect(String url,
Properties info) throws SQLException
- Connects to the database named by the specified URL.
There are many optional properties that can be specified.
Properties can be specified either as part of the URL or in
a java.util.Properties object. See
JDBC properties for a complete list of properties
supported by this driver.
- Parameters:
- url - The URL for the database.
- info - The connection properties.
- Returns:
- The connection to the database or null if
the driver does not understand how to connect
to the database.
- Throws: SQLException
- If the driver is unable to make the connection.
getMajorVersion
public int getMajorVersion()
- Returns the driver's major version number.
- Returns:
- The major version number.
getMinorVersion
public int getMinorVersion()
- Returns the driver's minor version number.
- Returns:
- The minor version number.
getPropertyInfo
public DriverPropertyInfo[] getPropertyInfo(String url,
Properties info) throws SQLException
- Returns an array of DriverPropertyInfo objects that
describe the properties that are supported by this
driver.
- Parameters:
- url - The URL for the database.
- info - The connection properties.
- Returns:
- The descriptions of all possible properties or null if
the driver does not understand how to connect to the
database.
- Throws: SQLException
- If an error occurs.
jdbcCompliant
public boolean jdbcCompliant()
- Indicates if the driver is a genuine JDBC compliant driver.
- Returns:
- Always true.
toString
public String toString()
- Returns the name of the driver.
- Returns:
- The driver name.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index