Basic HTML version of Foils prepared 4 Feb 98

Foil 10 Statement Class

From Overview of JDBC and its use with CORBA or Java RMI CPS616 Technologies of Information Age -- Spring 1998. by Nancy McCracken(Sangetta Aggarwal, Udayan Parvate, Tom Pulikal)


1 Use connection to send SQL statements to database: Statement stmt = conn.createStatement( ); ResultSet rs = stmt.executeQuery("select * from table1"); The return value of the method executeQuery is a single result set.
2 The method executeUpdate is used for
  • insert, update and delete statements, which return no. of rows affected by change
  • DDL statements such as create table, drop table, . . .
3 The method execute is used for SQL statements that may return more than one result set or update count.

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Nov 29 1998