13 firstExample.java // Create a statement object that will be sending your // SQL statements to the DBMS: Statement stmt = conn.createStatement(); // Create the COFFEES table: stmt.executeUpdate( CREATE TABLE COFFEES + (COF_NAME VARCHAR(32), SUP_ID INTEGER, + PRICE FLOAT, SALES INTEGER, TOTAL INTEGER) ); // Populate the COFFEES table: stmt.executeUpdate( INSERT INTO COFFEES + VALUES ( Colombian , 101, 7.99, 0, 0) ); // Get data from the COFFEES table: ResultSet rs = stmt.executeQuery( SELECT COF_NAME, PRICE FROM COFFEES );
{}