PreparedStatement is a pre compiled statement but where it's
pre compiled ?
Answers were Sorted based on User's Feedback
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 |
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 |
How do java applications access the database using jdbc?
Is there any limitation for no of statments executed with in batchupdate?
Why do we need jdbc?
What isolation level is used by the DBMS when inserting, updating and selecting rows from a database?
Which is faster jdbc or odbc?
What is Connection Pooling ??? How we set up a particular connection within connection pooling ????
What is jdbc class forname?
What are the new features added to JDBC 4.0?
Give me some example for getting connection from connection pooling in JBoss Server. Is Connection Pool default in Server or we have to create it? Who can create Connection Pool in a Team. How it will be accessed by the developer code?
Once I have the Java 2 SDK, Standard Edition, from Sun, what else do I need to connect to a database?
Explain the JDBC Architecture?
What is the full form of jdbc and what is its purpose?