Answer Posted / rashmi
there are 3 types of statements used in jdbc
------
1.createStatement()
2.preparedStatement()
3.callableStatement()
createStatement returns the object of statement.through this we can call methods belongs
to the statement interface.preparedStatement returns the object of preparedstatement.through this we can call methods belongs
to the preparedstatement interface.
The difference b/w statement and preparedstatement is :
if we use statement the sql querry parses by the database server each and every time.when
we send the request. but by using preparedstatement the sql querry parses only once and that
parsed querry is used every time.
for example if there are 100 sql statements by using statement 100 parsings are necessary.
but by using preparedStatement the parsing is happened only once.so we can save the 99 parsings.
The callablestatement is used to call the storedprocedures.
| Is This Answer Correct ? | 15 Yes | 4 No |
Post New Answer View All Answers
What are types of resultset?
Why we use jdbc instead of odbc?
What are the measures to connect to the db using jdbc?
Does sql allow null values ?
How to get the Database server details in java program?
Is jdbctemplate thread safe?
Which is faster jdbc or odbc?
How can we move the cursor in a scrollable result set?
How can we maintain the integrity of a database by using jdbc?
What is createstatement method in java?
What do you mean by odbc?
What is benefit of using preparedstatement in java?
What causes the "No suitable driver" error?
How to check jdbc connection in java?
What do you mean by two phase commits?