long startTime;
long stopTime;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@dssw2k01:1521:orcl","scott","tiger");
conn.setAutoCommit(false);
Statement stmt = conn.createStatement();
stmt.executeUpdate(
"insert into testxxxperf ( id, code, descr, insert_user, insert_date ) "+
"values ( 1, '123456789012345678901234567890', " +
"'12345678901234567890123456789012345678901234567890123456789012345678901234567890', " +
"USER, SYSDATE )");
conn.commit();
startTime = System.currentTimeMillis();
ResultSet rset = stmt.executeQuery(
"select id, code, descr, insert_user, insert_date " +
"from testxxxperf where id = 1");
rset.next();
stopTime = System.currentTimeMillis();
rset.close();
stmt.executeUpdate("delete testxxxperf where id = 1");
conn.commit();
stmt.close();
conn.close();
System.out.println( "Elapsed time in milliseconds: " + Long.toString( stopTime - startTime ) );