• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC vs C++ Native libraries

 
Andrea Cacciarru
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that with JDBC I can use directly specific db drivers, provided by the db manufacturer. How can I do this? There is any disadvantage to use Java JDBC instead C++ native libraries (e.g. performances)?

Bye
Andrea
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34965
378
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Andrea Cacciarru:
I know that with JDBC I can use directly specific db drivers, provided by the db manufacturer. How can I do this? There is any disadvantage to use Java JDBC instead C++ native libraries (e.g. performances)?

Andrea,
These aren't mutually exclusive. You can use a native library driver with JDBC.

Welcome to JavaRanch!
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Andrea Cacciarru:
There is any disadvantage to use Java JDBC instead C++ native libraries (e.g. performances)?

Depends on the database, and possibly where the application is running relative to the database, and maybe other things.

For example, if you're using Oracle, and if your Java application is running on the database server (and nowhere else), and if you use the OCI driver (a C++ library with a Java wrapper) and if you connect to the database using IPC instead of TCP (assuming your DB's OS supports IPC), then and only then
will your application be significantly faster, by eliminating a lot of networking-related overhead. (IPC is "inter-process communication). However, most people can't put their apps on the database server. For them, for Oracle, as of Oracle 9i the native driver isn't significantly faster than the pure Java driver, at least in common usage.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic