How Do I Use ODBC In A Java Programme?


1 Answers

Rajesh Shri Profile
Rajesh Shri answered
Open Database connectivity (ODBC) is an API which gives programmers access to data using SQL. It has a layered approach and is quite versatile in the sense that if an application is written to ODBC, it can communicate with any data source that has a suitable driver.

In the case of Java, a similar thing exists called JDBC (Java Database Connectivity). Here Java applications are written to the API they can communicate with all data that have the JDBC driver. If JDBC is connected to ODBC then a mechanism can be found by which Java can communicate with any data base management system (DBMS) that has JDBC or OBDC drivers.

The normal method for communicating with a database for Java is to use JDBC.

The first step will be to register the database driver. Following this a specific database URL is used to establish a connection. This connection can be used to create the statement object after which it's possible to interact with the database using SQL, or other means.

Answer Question