import java.sql.*;  //import all the JDBC classes



public class CreateJoltData {



    static String[] SQL = {

        "create table JoltData ("+

            "programmer varchar (32),"+

            "day varchar (3),"+

            "cups integer);",

        "insert into JoltData values ('Gilbert', 'Mon', 1);",

        "insert into JoltData values ('Wally', 'Mon', 2);",

        "insert into JoltData values ('Edgar', 'Tue', 8);",

        "insert into JoltData values ('Wally', 'Tue', 2);",

        "insert into JoltData values ('Eugene', 'Tue', 3);",

        "insert into JoltData values ('Josephine', 'Wed', 2);",

        "insert into JoltData values ('Eugene', 'Thu', 3);",

        "insert into JoltData values ('Gilbert', 'Thu', 1);",

        "insert into JoltData values ('Clarence', 'Fri', 9);",

        "insert into JoltData values ('Edgar', 'Fri', 3);",

        "insert into JoltData values ('Josephine', 'Fri', 4);",

    };



    public static void main(String[] args) {

        String URL = "jdbc:odbc:CafeJolt";

        String username = "";

        String password = "";



        try {

            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

        } catch (Exception e) {

            System.out.println("Failed to load JDBC/ODBC driver.");

            return;

        }



        Statement stmt = null;

        Connection con=null;

        try {

            con = DriverManager.getConnection (

                URL,

                username,

                password);

            stmt = con.createStatement();

        } catch (Exception e) {

            System.err.println("problems connecting to "+URL);

        }



        try {

            // execute SQL commands to create table, insert data

            for (int i=0; i<SQL.length; i++) {

                stmt.execute(SQL[i]);

            }

            con.close();

        } catch (Exception e) {

            System.err.println("problems with SQL sent to "+URL+

                ": "+e.getMessage());

        }



    }

}

