Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

connectivity  RSS feed

 
winny dhar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends..
can you tell me why we use jdbc insted of odbc..what's the basic difference??
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15885
82
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
winny dhar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thankyou..
then were do we use OLE-DB?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15885
82
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok..thanks..
 
Rob Spoor
Sheriff
Posts: 20937
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Posts: 54024
130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this discussion might fit better in our JDBC forum. Moving.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!