/* Java equivalent */ import java.io.*; import java.sql.*; import java.util.*; public class pg{ Connection conn; Statement stmt; public pg() throws ClassNotFoundException, FileNotFoundException, IOException, SQLException { Class.forName("org.postgresql.Driver"); conn = DriverManager.getConnection("jdbc:postgresql:exkom", "andy", ""); conn.setAutoCommit(true); stmt = conn.createStatement(); int last = 10000; int res = stmt.executeUpdate("delete from junk"); GregorianCalendar day = new GregorianCalendar(); String time = day.getTime().toString(); for (int i=0; ierrorMessage unless PGRES_CONNECTION_OK eq $conn->status; # print "Enter a state code :"; # $state_code = ; # chomp $state_code; $result = $conn->exec("delete from junk"); $end = 10000; $t0 = new Benchmark; for ($i=1; $i < $end; $i++) { $result = $conn->exec("insert into junk values($i)"); } $t1 = new Benchmark; $td = timediff($t1, $t0); print " the $end records took :", timestr($td) , "\n" **/