Connection con = getConnection();
con.setAutoCommit(false);
PreparedStatement stmt = con.prepareStatement(buf.toString());
for (int i = 0; i < arr.length; i++)
{
PerfArticle article = arr[i];
// use Identity to set pk field value
Identity oid = new Identity(article, broker);
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();
}
con.commit();
con.setAutoCommit(true);
stmt.close();