Skip to content
Exercises · Q9

Q.Distinguish between ODBC and JDBC. Why is JDBC generally preferred for a Java program?

ChseodishaTextbookSubjectiveImportance★★★★★est
64% · 9/14 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

ODBC — Open Database Connectivity. A general standard, independent of any programming language, that lets any application connect to any database through a driver. It is widely used by desktop and office applications.

JDBC — Java Database Connectivity. Java's own API for database access — a set of classes and interfaces in the package java.sql that lets a Java program run SQL commands on a database.

Differences:

PointODBCJDBC
Languagelanguage-independent (general)designed specifically for Java
Written inmostly native (C) codeJava
Use from Javaneeds a JDBC-ODBC bridgeused directly
Portabilitytied to the platform's ODBC setupruns anywhere Java runs

Why JDBC is preferred for Java. Because JDBC is built for Java:

  • it fits naturally into Java code (Java classes and exceptions),
  • it is platform-independent like the rest of Java, …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.