JavaDeploy
SiteMap
JSP - Servlets
JDBC
EJB Concepts
Entity Beans
JDBC
«Prev
Intro JDBC
Learning JDBC
JDBC Course Project
JDBC Case Study
JDBC Team
Business Case Conclusion
Distributed Objects
Enterprise Solutions JDBC
System Organization Role
Relational Databases
JDBC/ODBC Relationship
Microsoft API ODBC
SQL Database Processing
JDBC Architectural Models
n-tier Architectural Benefits
JDBC Mechanics
Enterprise Conclusion
JDBC Connection
JDBC URL Connection
JDBC Driver
Driver Types
Driver Manager
Sample JDBC Program
JDBC DBMS Conclusion
Database Tables
Statement Objects
Examining Query Results
Accessing Data Methods
Database Metadata
Obtain Database Content
Prepared Statements
Interface ResultSet
Transaction Methods
Isolation Levels
JDBC DriverManager Connection
1) Load the JDBC Driver object by calling Class.forName(driver).newInstace(); In the main() method of your application; or better, in a static initializer block in one of your classes.
2) To start the JDBC Connection Process, you need the database URL, user ID, and password.
3) Request a java.sql.Connection object from the DriverManager. This request will lead to a search performed by the DriverManager
4) The DriverManager searchs through all known java.sql.Driver implementations for the one that connects with the URL you specified in step 1. The DriverManager keeps a list of classes that implement the java.sql.Driver Interface. JDBC requires the Driver class to register itself (or be registered)
5) The DriverManager reports the results of the search. One of two things can occur: the DriverManager may or may not find a match. If it does not find a match, DriverManager throws an exception back to your application.
6) If the DriverManager finds a driver that it can connect after your URL is recognized, the Driver creates a database connection using the properties specified in your code.
7) Once the database connection is created, the Driver provides the DriverManager with an instance of java.sql.Connection. This represents the database connection.
8) The Connection object is passed back to the application by the DriverManager. The application can now use the Connection object to create Statement object to query the database.