import java.sql.*;
import java.util.Scanner;

// Most useful for creating/adding material to a database
// From the command line:
// java -cp .:smallsql.jar SmallSQLBuild
// Make sure smallsql.jar is in the proper directory.
public class SmallSQLBuild {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("smallsql.database.SSDriver");
        Connection con = DriverManager.getConnection("jdbc:smallsql:testdb?create=true");
        Statement stat = con.createStatement();

        boolean done = false;
        Scanner input = new Scanner(System.in);
        while (!done) {
            System.out.print("Enter command: ");
            String cmd = input.nextLine();
            if (cmd.equals("quit")) {
                done = true;
            } else {
                stat.execute(cmd);
            }
        }
    }
}
