aspose file tools*
The moose likes JDBC and the fly likes connectivity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connectivity" Watch "connectivity" New topic
Author

connectivity

winny dhar
Greenhorn

Joined: Nov 14, 2011
Posts: 13
hello friends..
can you tell me why we use jdbc insted of odbc..what's the basic difference??
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14155
    
  18

JDBC is Java's standard interface to use relational databases. ODBC is another standard that does not have anything to do with Java.

Normally you want to use JDBC from a Java program, just because that's the standard, default way to use relational databases from Java. From the perspective of your program, JDBC is in principle independent of the specific brand and version of database that you use. The JDBC API uses a JDBC driver behind the scenes. That driver is specific to your particular brand and version of database: for example for Oracle you need an Oracle JDBC driver, for MySQL you need a MySQL JDBC driver, etc.

If you want to go through ODBC, then you can get a special JDBC driver that works through ODBC. But this is normally not what you want to do - it adds an unnecessary layer between your application and the database.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
winny dhar
Greenhorn

Joined: Nov 14, 2011
Posts: 13
thankyou..
then were do we use OLE-DB?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14155
    
  18

OLE DB is a Microsoft-specific API for accessing data in databases or from other data sources. It's not something you would normally want to use from a Java program, because it works on Windows only, and I don't even know if there's a way to use it directly from Java.
winny dhar
Greenhorn

Joined: Nov 14, 2011
Posts: 13
ok..thanks..
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

I'm not sure, but I think OLEDB is Microsoft's version of JDBC - an abstraction layer to connect to databases with a uniform interface.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38881
    
  23
I think this discussion might fit better in our JDBC forum. Moving.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connectivity