/*
 * This sample shows how to list all the names from the EMP table
 */

// You need to import the java.sql package to use JDBC
import java.sql.*;

class Update
{
  public static void main (String args [])
       throws SQLException
  {
    // Load the Oracle JDBC driver
    try {
      Class.forName("oracle.jdbc.driver.OracleDriver");
    } catch (ClassNotFoundException e) {
      System.out.println ("Oracle device driver does not exist");
      System.exit(0);
    }

    // Connect to the database
    // You can put a database name after the @ sign in the connection URL.
    Connection conn =
    DriverManager.getConnection ("jdbc:oracle:thin:@oradev:10521:D", "rramos", "raul");

    // Create a Statement
    Statement stmt = conn.createStatement ();

    String s = "update COFFEES set PRICE=15.99 where COF_NAME='Espresso'";
    int r = stmt.executeUpdate (s);

    r+=stmt.executeUpdate ("delete COFFEES where price=7.99");

    System.out.println(r+" rows where updated/modified");

    // Close the Statement
    stmt.close();

    // Close the connection
    conn.close();   
  }
}
