Connection Options

To connect to a database, we are faced with a confusing number of alternatives. To begin with, we have to, at a minimum, decide between the two drivers Oracle provides. This is important because the JDBC API consists entirely of interfaces—nothing is implemented in the Java JDK. Choosing a JDBC driver is choosing the JDBC implementation.

The next complication is the fact that each JDBC driver has its own way of specifying connection information. The database URL, username, and password options vary from one to another.

Finally, Sun has suggested that the traditional way of getting a database connection, by loading and registering the driver, may be deprecated in the future. Instead, as of JDBC 3.0, we should be using the

Get Java™ Oracle® Database Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.