/*************************************************************************** 
  test.java -- Create empty tables for factory project.
 
  revision history:
  -----------------
  0.01 gh 01/1999
 ***************************************************************************/ 

import java.lang.*;
import java.net.*;
import java.sql.*;
import java.util.*;

public class test {
  String url, s;
  Connection c;
  Statement stmt;
  String SQLstmt;

  test () {
    try { 
      System.out.println("\nloading JDBC class \"postgresql.Driver\"...");
      Class.forName("postgresql.Driver");

      url = "jdbc:postgresql://miranda:5432/factory";
      System.out.println("\nconnecting to " + url + "...");
      c = DriverManager.getConnection(url, "factory", "factory"); 
      stmt = c.createStatement ();
      System.out.println("\ncreating skid table...");        
      SQLstmt = "CREATE TABLE skids ("
              + "  this char(4),"
              + "  that int"
              + ")";
      stmt.executeUpdate(SQLstmt);
      System.out.println("\nclosing connection...");
      c.close();				      
    } catch (Exception e) {
      System.out.println (e.getMessage());
      System.exit(1);
    }
  }

  //////////////////////////////////////////////////////////////////////////
  // entry point:
  //////////////////////////////////////////////////////////////////////////
  public static void main(String argv[]) {
    new test();
  }
}

