Wednesday, February 5, 2014

Small example to make you easily understand about JDBC driver concept

Small example to make you easily understand about jdbc driver concept....

Assume there are 3 persons

A who knows Telugu
B who knows Hindi
C who knows English

Suppose if you want to speak to these 3 guys you should know
3 languages..... right ?

But what sun said is dont learn 3 languages learn jdbc
language

You dont talk in telugu or hindi or english

You talk JDBC language...

and if u want to communicate with A(Telugu)
add telugudriver who translates jdbc language to telugu
when you want to communicate with telugu speaking guy

and if u want to communicate with B(Hindi)
add hindidriver who translates jdbc language to hindi
when you want to communicate with telugu speaking guy

and if u want to communicate with C(English)
add englishdriver who translates jdbc language to english
when you want to communicate with telugu speaking guy

Now u can imagine what will happen if you add
telugudriver to communicate with person C.
It fails right because

telugudriver cant' convert jdbc language to English language
it can only conver jdbc to telugu calls.....

Now u can easily understand that if you want to communicate
with mysql db from jdbc u want mysql related jar file not ojdbc jar,

If you want to communicate with oracle database you need ojdbc jar
not mysql jar which has the capability to convert jdbc calls to mysql database

This concept applies to JNDI also...., in jdbc you will communicate
with databases in JNDI you communicate with directory services.. kind of things...

Hope u understood...........

No comments:

Post a Comment