Table of Contents Previous Next



You can use executeUpdate() with any SQL command that does not return a result set. Some simple syntax examples using executeUpdate() with SQL commands follow:
To use the UPDATE command with executeUpdate() to update a row:
To use the DELETE command with executeUpdate()to remove a row from a table:
To use the DROP TABLE command with executeUpdate() to delete a table from a database:
To use the CREATE TABLE command with executeUpdate() to add a new table to a database:
stmt.executeUpdate("CREATE TABLE tablename (fieldname NUMBER(4,2),
fieldname2 VARCHAR2(30))");
To use the ALTER TABLE command with executeUpdate() to change the attributes of a table:
stmt.executeUpdate("ALTER TABLE tablename ADD COLUMN colname BOOLEAN");


Table of Contents Previous Next