Discussion Locked

Statements in JDBC

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How many types of statments are there in Java?

3 replies

by tech geek

There are currently 3 types of statements:
1. Statement
This type will work on all databases.
It is the easy of the three types to do.
You simpily create a sql statement using
a string and then use the statement to execute it.

2. PreparedStatement
This type will not work on all databases.
Using this type if you are going be executing
the same sql statement multiple times. It actually creates an object in the database and all you have to do is can values and re-execute the statment.Great for inserts.

3. CallableStatement
This statement is used to run procedures stored in the database.

If you have any more questions or want some examples let me know.

by vickydicky

Thnx aanmmh@earthlink.net for clearing my doubts. All these I know, but I thought there might be some more.

This discussion is closed to new replies.