Driver.connect

Driver.connect

Interface Overview | Interface Members | This Package | All Packages

Syntax
public abstract Connection connect( String url, Properties info ) throws SQLException
Parameters
url
The URL of the database to connect to
info
a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included
Returns
a Connection to the URL
Description
Try to make a database connection to the given URL. The driver should return "null" if it realizes it is the wrong kind of driver to connect to the given URL. This will be common, as when the JDBC driver manager is asked to connect to a given URL it passes the URL to each loaded driver in turn.

The driver should raise a SQLException if it is the right driver to connect to the given URL, but has trouble connecting to the database.

The java.util.Properties argument can be used to passed arbitrary string tag/value pairs as connection arguments. Normally at least "user" and "password" properties should be included in the Properties.

Exceptions
SQLException if a database-access error occurs.