Limited Period Offer - Upto 50% OFF | OFFER ENDING IN: 0 D 0 H 0 M 0 S

Log In to start Learning

Login via

  • Home
  • Blog
  • How do JAVA and SQL interac...
Post By Admin Last Updated At 2020-06-11
How do JAVA and SQL interact with each other?

Many people like beginners have a doubt regarding the interaction of JAVA and SQL. Do you think why do these two interact? And also what is the purpose of interaction? Moreover, one more question is what is the advantage of connecting these two?  JDBC will answer you all these questions. Today, in this article, I'll explain to you How do JAVA and SQL interact with each other.

Before going to know How do Java and SQL interact with each other, Let me explain you the purpose of the interaction of JAVA with SQL. Basically, as we know JAVA is an evergreen programming language. Even after the 2 decades of its arrival, its demand has not decreased. So now, we were going to use, this powerful programming language, to interact with databases like SQL. We usually make interaction so as to fetch the data from the databases like SQL. We will make this interaction, through the connection of JDBC.  Let me explain you about JDBC through How do JAVA and SQL interact with each other.

JDBC :

JDBC API is a Java API which is used to interact with traditional databases like RDBMS.  This JDBC works with wide variety of platforms like Windows, Mac etc. This JDBC supports two-tier and three-tier architecture for processing the data.It implements the JDBC interfaces for interacting with servers like Databases.

Before going to know How do JAVA Tutorial and SQL interact with each other, let me  briefly introduce  you to SQL

SQL :

SQL stands for the Structured Query language.It is a language used for processing the data in databases management systems like SQL. This language is basically used for creation, updation, Reading, and deletion of data.These four operations were basically called as CURD operation technically.

 Let me introduce one more new concept in How do  JAVA and SQL interact with each other

Driver :

A driver is nothing but an engine, which especially drives for the data.

Hope you got a clarity regarding, what is JDBC, what is SQL and also what is Driver? Now ill make a move to How do JAVA  and SQL interact with each other .

For making an interaction, we usually have 4 types of drivers for connecting the java with database objects.  Let me explain you one – by –one in detail in How do java and SQL interact with each other

Type – 1 :

This driver is also called a JDBC –ODBC bridge driver .using this driver, we can access the ODBC drivers installed on each machine. ODBC requires the configuration of a system  a Data Source name, that represents the target database

The architecture of this driver is shown below

How do JAVA and SQL interact with each other

Type – 2 :

This type of driver is called the Native API .here the JDBC API calls were converted into Native API  C /C ++ API calls, which were unique in the database. These drivers were being provided by different database vendors.  This driver works just like Type -1 driver. But the vendor specific driver must be installed on each client machine.  Moreover, one thing we need to remember is that we need to change the native API for every change in database.

How do JAVA and SQL interact with each other

Type – 3 :

This type of driver is called JDBC-.Net pure Java. Here a three-tier approach is used for accessing the databases. This JDBC uses the standard client sockets for transferring the data into a middleware.Then, this data will be accessed by the end user. The greatest advantage of this type of driver, no code is required for accessing the data.  Moreover, a single driver can give access to multiple databases

How do JAVA and SQL interact with each other

Type – 4 :

This type of driver is known as 100% pure JAVA. It is used for accessing the vendor's databases directly through a socket. This s the highest performance driver available for databases and is usually provided by a vendor itself.How do JAVA and SQL interact with each other

My dear readers, I hope you got a clarity regarding the types of drivers sued in JDBC connection. Moreover, I hope you got an idea regarding How do JAVA and SQL interact with each other.

For more information on these drivers visit JAVA Online Training.

Recommended  Audience :

Software developers

Project Managers

Team leaders

Prerequisites :

There are nothing much prerequisites requires in order to pursue the JAVA COURSE. It good to have a basic knowledge of C / C++. But not mandatory. Trainers of OnlineITGuru will teach you from the basics if you don’t have a knowledge of these concerts.