What is the difference between JDBC Statement and Prepared Statement? - ProProfs Discuss
Advertisement

What is the difference between JDBC Statement and Prepared Statement?

Asked by Daniel Frederic, Last updated: Mar 28, 2024

+ Answer
Request
Question menu
Vote up Vote down

2 Answers

C. Bernthal

C. Bernthal

Its kind of my job to give answers

C. Bernthal
C. Bernthal, Teacher, MA, P.hD, Seattle

Answered Oct 08, 2020

You have to know that prepared statements are used so that they can bind queries. They are meant to execute the bind queries. For the JDBC statement, its main goal is to make sure that the SQL query will work properly. Take note that this will not have the ability to provide a pre-compilation.

For the prepared statement, you simply need to copy the SQL from your SQL editor. Then, this will already be executed. You cannot do the same thing for your JDBC statement. When it comes to performance, a lot of people are saying that the prepared statement will be able to work better as compared to JDBC.

Take note that the strategies that you are going to do will always affect the performance that you are going to make.

upvote downvote
Reply 

Millie Brown

Millie Brown

Business is what makes a difference in this world, may that be for good or bad and that's what I love about that.

Millie Brown
Millie Brown, Businessman, Bachelor of Science in Business (BSBA), Nevada,Texas

Answered May 12, 2020

What is the difference between the JDBC statement? JDBC stands for Java Database Community. It is a Java API to connect and execute queries with the database. It is the most popular database for independent connectivity that offers universal information access, especially the information stored in the relational database.

It uses JDRC drivers written in Java programming language to connect any Java usage with the database. Statement and Prepared Statement are classes that represent SQL statements at the runtime. It defines procedures and properties to interrelate with a database utilizing SQL.

A prepared statement is an extended and successful incarnation of the statement. Unlike a JDBC statement, the Prepared statement is a formulated statement, which means when it is executed, the DMBS can run the SQL statement without reading to compare it first.

upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.