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 DataSource class. This is part of the overall goal of bringing JDBC 3.0 in line with other J2EE technologies, such as JNDI.

The important thing, at this point, is to understand what the options are and to choose the one that is most suitable for your environment.



Java Oracle Database Development
Java Oracle Database Development
ISBN: 0130462187
EAN: 2147483647
Year: 2002
Pages: 71

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net