Java Training: -Explain JDBC (Java Database Connectivity) and its different section?

Published on by javainterviewseries

JAVA interacts with database using a common database application programming interface called as JDBC. JDBC allows a developer to write applications that is database independent. So the developer will be interacting with JDBC API rather than getting in to complications of the database.JDBC allows you to write Java code, and leave the platform (database) specific code to the driver. JAVA was designed to be platform independent and JDBC takes java one step ahead making java database code database independent. That means if you use JDBC for connectivity for SQL Server you can run the same code without changing for ORACLE.

 

jdbc1.jpg

Figure: - JDBC as a layer

 

Different sections in JDBC: -


There are four major components in JDBC. Below is the diagram which shows the four major sections and the way they interact to achieve the final “resultset”.

 

jdbc2.jpg


Figure: - JDBC in detail

 

Driver manager section creates the connection object. Connection object create the statement object with the required SQL which is then executed against the database. And finally database gives the result back in the resultset.

 

See the following starter video on Servlet: -

 

 

Click to get Java Training

 

Regards,

 

Get more Java training stuffs from author's blog

To be informed of the latest articles, subscribe:

Comment on this post

adams sams 07/06/2012 10:51

thanks for giving this much information about JDBC