FileDocCategorySizeDatePackage
TestThinPerfSelect.javaAPI DocExample1223Thu Aug 02 18:50:26 BST 2001None

TestThinPerfSelect

public class TestThinPerfSelect extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

  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 ) );