Once the installation of the appropriate driver is done, it is time to establish the connection of database with the use of JDBC or the Java Database Connectivity. The programming that is needed to establish a JDBC connection is quite simple. Here are the 4 simple steps:
- Importing of JDBC packages: The import statements need to be added to the Java program in order to import required classes in the Java code.
- Registration of JDBC Driver: Here, the JVM or the Java Virtual Machine is made to load the required driver implementation into the memory so that it can fulfill the JDBC request.
- Formulation of Database URL: This is needed to make a well formatted address which will point out to the database that one wishes to connect to.
- Creation of Connection Object: The code to the call for the Driver manager object method in order to establish database connection needs to be done.
Students learn the step by step procedure along with practical’s in the course.