import java.sql.*; import java.io.*; class MakeTable implements DBConstants { public static void main(String args[]) throws Exception { Class.forName( "oracle.jdbc.driver.OracleDriver" ); Connection conn = DriverManager.getConnection(url, username, password); BufferedReader in = new BufferedReader(new FileReader(table)) ; // Assumes initial data in file of same name as table. Statement stat = conn.createStatement(); stat.executeUpdate( "CREATE TABLE " + table + " (" + "login VARCHAR(10)," + "lastname VARCHAR(20)," + "firstnames VARCHAR(20)," + "email VARCHAR(50)," + "dept VARCHAR(5)" + ")" ) ; String login, lastname, firstnames, email, dept ; login = in.readLine() ; while(login != null) { lastname = in.readLine() ; firstnames = in.readLine() ; email = in.readLine() ; dept = in.readLine() ; stat.executeUpdate( "INSERT INTO " + table + " VALUES (" + "'" + login + "'," + "'" + lastname + "'," + "'" + firstnames + "'," + "'" + email + "'," + "'" + dept + "')" ) ; in.readLine() ; // skip blank line ; login = in.readLine() ; } conn.close(); } }