java-tutorials

Thursday, January 17, 2008

JDBC-ODBC Bridge Driver:

The Type 1 driver translates all JDBC calls into ODBC calls and sends them to the ODBC driver. ODBC is a generic API. JDBC-ODBC Bridge Drivers enable a java application to use any database that supports ODBC drivers. Java application cannot directly interact with ODBC driver, for this reason we use JDBC-ODBC Bridge Driver that works as interface b\w application and ODBC driver. To use JDBC-ODBC Bridge Driver you need you installed ODBC driver in your client computer







Advantage
The JDBC-ODBC Bridge allows access to almost any database, since the database's ODBC drivers are already available.

Disadvantages
• 1. Since the Bridge driver is not written fully in Java, Type 1 drivers are not portable.
2. A performance issue is seen as a JDBC call goes through the bridge to the ODBC driver, then to the database, and this applies even in the reverse process. They are the slowest of all driver types.
3. The client system requires the ODBC Installation to use the driver.
4. Not good for the Web.

Data Base Connectivity in java

Database connectivity in java

To develop application that communicated with database to perform following task:
• Store and update the data in data base.
• Retrieve the data stored is data base and present it to users in proper format.

Sun Micro system included API as part of J2SDK to develop java application that can communicate with the database

JDBC Architecture






Java application cannot directly communicate with database to submit data and retrieve the result of the query. This is because database can only interpret SQL statement not java language statement. So, JDBC Architecture provides mechanism to translate java statement to SQL statement.

JDBC Architecture classified into two layers:
• JDBC Application layer:
Java application uses java API to interact with JDBC Drivers.
JDBC driver is software that a java application uses to access data base. JDBC driver manager of JDBC API connects the java application to the Driver.

• JDBC Driver Layer:
Act as interface b\w a java application and database. This layer contains Driver Such as SQL driver or Oracle driver which enables connectivity to the data base.

How JDBC Driver Layer works:
1. A driver sends request of java application to database.
2. After processing the request, database sends the response back to driver.
3. Driver translates response to the JDBC API.
4. JDBC API forwards it to the java application.

JDBC Drivers

Java support four types of Drivers
• JDBC-ODBC Bridge Driver
• Native API Partly-java driver
• JDBC-Net Pure-Java driver
• Native Protocol Pure-Java driver

Wednesday, January 16, 2008

Introduction

Friends,

Java is a programming language originally developed by Sun Microsystems and released in 1995 as a core component of Sun's Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to bytecode which can run on any Java virtual machine (JVM) regardless of computer architecture.

In this blog, I will be keep posting basic and advance java tutorials. This wil be useful to the graduating engineering students, job seekers, and enployees who are new in Java.

~Pushpa