JDBC: Statement Interface


The Statement interface provides methods to execute queries with the database. The statement interface is a factory of ResultSet i.e. it provides factory method to get the object of ResultSet.

Commonly used methods of Statement interface:

  1. public ResultSet executeQuery(String sql): is used to execute SELECT query. It returns the object of ResultSet.
  2. public int executeUpdate(String sql): is used to execute specified query, it may be create, drop, insert, update, delete etc.
  3. public boolean execute(String sql): is used to execute queries that may return multiple results.
  4. public int[] executeBatch(): is used to execute batch of commands.

For example of statement interface follow below links:

See Also :

More on JDBC

Follow below links to learn more on JDBC and solving JDBC related issues :

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s