Driver class creates Connection
The user requests the DriverManager class to make a connection to a particular database with user and password. The DriverManager then asks each available driver if it can handle that request until one can; the driver then makes the connection. String url = “jdbc:odbc:fred”; Connection conn = DriverManager.getConnection (url, “userid”, “password”);
The form of the url is <protocol>:<subprotocol>:<subname>
- the protocol is always jdbc
- the subprotocol is a keyword registered by the driver authors, odbc is a standard one
- the subname format is very flexible and is designed by the driver author - just follow their examples!