Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JDBC and Relational Databases and the fly likes connector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "connector" Watch "connector" New topic


sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1240
when we use jdbc to connect DATABASE we have to add mysqlconnector.jar to the project.
1) but when we usin odbc we don't need to add any jar files.why?
2) in first case what is the job of the mysqlconnector.jar .is it act as a Driver or else?
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3753

It is a driver. Every database has a different driver and none of them are built into Java by default, therefore you need a database-specific driver for each type of database you want to use.

[OCA 8 Book] [Blog]
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

aruna sameera wrote:
1) but when we usin odbc we don't need to add any jar files.why?

ODBC connection handled by the OS specific files (for Windows, its DLL and DSN services), which, in turn talks with the respective databases registered with it.
JDBC works same but the drivers are incorporated into Java code (Driver, .jar files), which in turn talks with the database. Its all lies in which type of Driver you are using .
I agree. Here's the link:
subject: connector
It's not a secret anymore!