FileDocCategorySizeDatePackage
TestOCIPerfSelect.javaAPI DocExample840Mon Apr 23 18:21:18 BST 2001None

TestOCIPerfSelect

public class TestOCIPerfSelect 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:oci8:@dssnt01","scott","tiger");
  conn.setAutoCommit(false);
  Statement stmt = conn.createStatement();
  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.close();
  conn.close();
  System.out.println( "Elapsed time in milliseconds: " + Long.toString( stopTime - startTime ) );