Exercises · Q9
Q.Distinguish between ODBC and JDBC. Why is JDBC generally preferred for a Java program?
ChseodishaTextbookSubjectiveImportance★★★★★est
64% · 9/14 Questions
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:
| Point | ODBC | JDBC |
|---|---|---|
| Language | language-independent (general) | designed specifically for Java |
| Written in | mostly native (C) code | Java |
| Use from Java | needs a JDBC-ODBC bridge | used directly |
| Portability | tied to the platform's ODBC setup | runs 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.