PreparedStatement is a pre compiled statement but where it's
pre compiled ?

Answers were Sorted based on User's Feedback



PreparedStatement is a pre compiled statement but where it's pre compiled ?..

Answer / aravind

Hi Manikandansit

There is a small correction in my answer prepared statement
will be parsed for the first time when it executes any query
and there onwards parsed query will be maintained in some
sort of pool....hence next time when it tries to execute
mutilple queries with different values parsing will not
happen again...that's how we say it as precompiled...so this
will reduce the processing time when u have multiple rows of
data to insert..

I hope this will help you...if u r not satisfied with the
answer please do let me know.

Is This Answer Correct ?    12 Yes 0 No

PreparedStatement is a pre compiled statement but where it's pre compiled ?..

Answer / manikandansit

thanks aravind.

Is This Answer Correct ?    5 Yes 1 No

PreparedStatement is a pre compiled statement but where it's pre compiled ?..

Answer / amitabha

What is meant by parsing here?

Is This Answer Correct ?    2 Yes 0 No

PreparedStatement is a pre compiled statement but where it's pre compiled ?..

Answer / aravind

Hi,
in prepared statement when u mention the query that time
only statement will be internaly sent to DB and checks for
the query syntax, so when u execute it directly executes
the statement.

PreparedStatement pstmt = conn.prepareStatement("insert
into table (column2) values ("My Value") where id = 1000");

//pstmt is already compiled

pstmt.execute();

Is This Answer Correct ?    5 Yes 7 No

Post New Answer

More JDBC Interview Questions

What are the ddl statements?

0 Answers  


What is a jdbc connection?

0 Answers  


What is two-phase commit in the database?

0 Answers  


What are restrictions on triggers?

0 Answers  


What does executequery return in java?

0 Answers  






What are clob and blob data types in jdbc?

0 Answers  


What is jdbc servlet?

0 Answers  


What is a datasource in java?

0 Answers  


what is the difference between SENSITIVE and INSENSITIVE?

1 Answers  


Explain the process of creating tables using NetBeans IDE?

0 Answers  


The new features of the JDBC 2.0 API, will be supported for JDBC-ODBC Bridge?

0 Answers  


What is metadata in jdbc?

0 Answers  


Categories