import java.sql.*;

class Insert
{
  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 createString;
    createString = "create table COFFEES " +
                   "(COF_NAME varchar(32), " +
                   "SUP_ID int, " +
                   "PRICE float, " +
                   "SALES int, " +
                   "TOTAL int)";


    stmt.executeUpdate (createString);
    System.out.println("Table COFFEES created");

    int r=0;
    r+=stmt.executeUpdate ("insert into COFFEES values ('Colombian', 101, 7.99, 0, 0)");
    r+=stmt.executeUpdate ("insert into COFFEES values ('Espresso',  150, 9.99, 0, 0)");
    System.out.println("A total of "+r+" were rows inserted");

    // Close the Statement
    stmt.close();

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

