for (int i = 0; i < arr.length; i++)
{
// OJB doesn't use a PS-pool (normally the JDBC driver supports statement pooling)
// thus to make this test more fair lookup a new PS for each object
PreparedStatement stmt = con.prepareStatement(buf.toString());
PerfArticle article = arr[i];
// generate PK value
article.setArticleId(nextKey());
stmt.setLong(1, article.getArticleId().longValue());
stmt.setString(2, article.getArticleName());
stmt.setInt(3, article.getMinimumStock());
stmt.setDouble(4, article.getPrice());
stmt.setString(5, article.getUnit());
stmt.setInt(6, article.getStock());
stmt.setInt(7, article.getSupplierId());
stmt.executeUpdate();
stmt.close();
}
con.commit();
con.setAutoCommit(true);