We
have six steps to connect to the database in java. The following steps are used
by Java programmers while using jdbc in their java programs.
2. Creating connection
3. Creating statement
4. Executing queries
5. Retrieving the Results
6. Closing connection
1. Registering the driver :
There are several drivers available in the market we should
first declare a driver which is going to be used for communication with the
database server in a java program.
Registering the driver in 4 ways:
1. By creating an object to Driver class of the driver software.