Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we use odbc only with java to connect to databases?

Tags:

java

jdbc

odbc

Do we always have to use jdbc with Java programs for making connectivity with database or can we use only odbc for connecting to databases with Java programs?

like image 896
Mishthi Avatar asked Dec 07 '10 15:12

Mishthi


People also ask

Can I use ODBC from Java?

No. ODBC stands for Open Database Connectivity which literally means that it is compatible with all types of languages such as C, C++, Java, etc. JDBC Stands for Java database connectivity i.e only compatible with java language. ODBC was introduced by Microsoft prior to JDBC in 1992.

Which is better ODBC or JDBC?

ODBC is more egalitarian, and is accessible to programs written in a variety of languages, such as Visual Basic, . NET, C# and Fortran. JDBC only works within a Java Runtime Environment. Another key difference between ODBC and JDBC is the set of compliant databases to a given standard.

Is ODBC same as JDBC?

ODBC is an SQL-based Application Programming Interface (API) created by Microsoft that is used by Windows software applications to access databases via SQL. JDBC is an SQL-based API created by Sun Microsystems to enable Java applications to use SQL for database access.

What is ODBC in Java?

Open Database Connectivity (ODBC) is an open standard application programming interface (API) that allows application programmers to access any database.


1 Answers

Sun JRE contains a built-in JDBC/ODBC driver (sun.jdbc.odbc.JdbcOdbcDriver). Here's an example how to use it: http://www.javacoffeebreak.com/articles/jdbc/

The driver was removed in Oracle JRE 8, so use Java version 7 or earlier.

like image 168
rustyx Avatar answered Sep 30 '22 03:09

rustyx