FileDocCategorySizeDatePackage
TestThinPerfCallN.javaAPI DocExample1244Mon Apr 16 18:47:38 BST 2001None

TestThinPerfCallN

public class TestThinPerfCallN extends Object

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

  int i;
  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);
  CallableStatement stmt = null;
  startTime = System.currentTimeMillis();
  stmt = conn.prepareCall(
   "{call testxxxperf$.settestxxxperf( ?, ?, ?, ?, ? )}");
  for (i=1;i<Integer.parseInt(args[0])+1;i++) {
   stmt.setInt(1,i);
   stmt.setString(2,"123456789012345678901234567890");
   stmt.setString(3,"12345678901234567890123456789012345678901234567890123456789012345678901234567890");
   stmt.setString(4,"SCOTT");
   stmt.setDate(5,new java.sql.Date(System.currentTimeMillis()));
   stmt.execute();
  }
  conn.commit(); 
  stopTime = System.currentTimeMillis();

  Statement dstmt = conn.createStatement();
  dstmt.executeUpdate("delete testxxxperf");
  conn.commit();
  dstmt.close();

  stmt.close();
  conn.close();
  System.out.println( "Elapsed time in milliseconds: " + Long.toString( stopTime - startTime ) );