JDBC




JDBC is a Java API for executing SOL statements. It consists of a set of classes and interfaces written in JAVA programming language. JDBC provides a standard API for tool/database developers and makes it possible to write database applications using a pure JAVA API. Basic JDBC interaction in its simplest form can be broken down into four steps:

1.  Open a connection to the database.
2.  Execute a SQL statement.
3.  Process the results.
4.  Close the connection to the database

Using JDBC API, it isn’t necessary to write one program to access a system database, another program to access an Oracle database, another program to access an Informix database and so on. One can write a single program using a JDBC API and the program will be able to send SQL statement to the appropriate database. And with an application returning JAVA programming language, one also doesn’t have to worry about writing different applications to run on different platforms. The combination of JAVA and JDBC lets programmers write it once it anywhere.

                 Microsoft’s ODBC API is probably the most widely used programming interface for accessing relational databases. It offers the ability to connect almost all databases on all platforms. So why not just use ODBC from JAVA?
         
The answer is that you can use ODBC from JAVA, but this is the best done with the help of JDBC in the form of the JDBC-ODBC bridge. The question now becomes,” Why do we need JDBC?” There are several answers to these questions:

1. ODBC is not appropriate for direct use from JAVA because it uses a C interface. Calls from JAVA to native C code have a number of drawbacks in the security, implementations, robustness and automatic portability of applications.
2. A literal transmission of ODBC C API into a JAVA API would not be desirable. For example, JAVA has no pointers and ODBC makes copies use of them, including the notoriously error-prone generic pointer “void”. You can think of JBBC as ODBC translated into an object oriented interface that is natural for JAVA programmers.

3. ODBC is hard to learn. It makes simple and advanced features together and it has complex options even for simple queries. JBBC on the other hand was design to keep simple thing while allowing more advanced capabilities where required.

4. A JAVA API like JDBC is needed in order to enable a “pure JAVA “solution. When ODBC is used, the ODBC driver manager and drivers must be manually installed on every client machine. When the JDBC driver i.e. written completely in JAVA. However JDBC code is automatically installable, portable and secure on all JAVA platforms from network computers to the mainframe.

Comments

Popular posts from this blog

AUDIO SPOTLIGHTING

Electronic Reconnaissance, ELECTRONIC COUNTERMEASURES (ECM), ELECTRONIC COUNTER-COUNTERMEASURES (ECCM)

INTERFACING OF EEPROM with 8051