我正在将 Java 表的数据写回我的 MYSQl dB。但是要执行一个 executeBatch 需要 1.241 秒!这是我的代码:
updateLieferant = conn.prepareStatement(
"UPDATE "+dbnames.artikel.name+" SET Abteilung = ? , statusAusmessen = ? , Status = ? "
+" WHERE " +dbnames.auftragsnummer +" = ? " +" AND " +dbnames.artikelnummer +" = ?");
updateLieferant.setString( 1, "blabla" );
updateLieferant.setString( 2, "blabla" );
updateLieferant.setString( 3, "blabla" );
updateLieferant.setString( 4, "blabla");
updateLieferant.setString( 5, "blabla" );
long time = System.nanoTime();
updateLieferant.executeBatch();
time = System.nanoTime()- time;
System.out.println(time/1000000);
输出 1241 毫秒...我做错了什么吗?从这个页面我看到它应该需要大约 100 毫秒。 http://rostislav-matl.blogspot.ch/2011/08/fast-inserts-to-postgresql-with-jdbc.html