private void populateTable(Connection connection,String sql,int maxLength) throws SQLException {
  Random rnd=new Random();
  PreparedStatement ps=connection.prepareStatement(sql);
  try {
    for (int i=0; i < RECORD_COUNT; i++) {
      int length=rnd.nextInt(maxLength);
      byte[] data=new byte[length];
      rnd.nextBytes(data);
      ps.setInt(1,i);
      ps.setBytes(2,data);
      ps.execute();
    }
  }
  finally {
    ps.close();
  }
}

private void populateTable ( Connection connection , String sql , int maxLength ) throws SQLException { Random rnd = new Random ( ) ; PreparedStatement ps = connection . prepareStatement ( sql ) ; try { for ( int i = 0 ; i < RECORD_COUNT ; i ++ ) { int length = rnd . nextInt ( maxLength ) ; byte [ ] data = new byte [ length ] ; rnd . nextBytes ( data ) ; ps . setInt ( 1 , i ) ; ps . setBytes ( 2 , data ) ; ps . execute ( ) ; } } finally { ps . close ( ) ; } }
populate table with random data .
