Saturday, 1 September 2012

How JDBC Statements are used?


• A Statement is an object, by which we send an SQL statement to the DBMS. 

• We create a Statement object and then execute it.

• For a SELECT Statement, the method used is executeQuery. 

• The Statement that creates or modifies a table is executeUpdate.

• For creating a Statement object an instance of an active connection is required.

• In the following code, we use our Connection object con to create the Statement object

Statement stmt = con . createStatement();

No comments:

Post a Comment