• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc

 
vinoth ar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i heard while reading... in jdbc that API will define interface and the driver has to implement that... what that exactly mean?? what is happening behind the scene... anyone explain in nice manner...'
thanks

vino
 
Omar Al Kababji
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simply that its like saying "hey if you want to be a JDBC Driver you have to talk my language" and this is obtained by forcing the vendor to implement specific interfaces defined by SUN. the same is for the Servlets.


i will give you a simple example suppose i want to force someone to specify an XML definition of his object contents, at this point i would implement an interface such like this one



now anyone who wants to speak my language should implement this interface and provide a definition for the "toXML()" method, at this point i don't care what type of definition he did, i just know that his class implements my interface and so i can call the toXML() method from the objects created using his class. (polymorphisim)

hope i helped you ;)

(peace)
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each DB has its own way of obtaining a connection and doing several actions on it. The JDBC API provides a contract how to interact with DB using Java. It's intented to be DB independent. Each DB manfacturer could write its own JDBC API implementation for it so that one only need to replace the JDBC implementation (the JDBC driver) when one would switch from DB. No changes in JDBC code are needed then.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65217
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vinoth ar, please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

Using a title of "jdbc" in a forum completely dedicated to questions on JDBC isn't very helpful. This is the second topic you've started with this title. How are we to tell them apart? What if everyone named every topic in this forum "jdbc"?

Please go back and change your post to add a more meaningful subject by clicking the
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic