172 |
|
|
173 |
// Forward only + concur_read_only + fetchsize tvinger driver til at hente en række af gangen (bedre performance ved store result sets) |
// Forward only + concur_read_only + fetchsize tvinger driver til at hente en række af gangen (bedre performance ved store result sets) |
174 |
// Se http://dev.mysql.com/doc/connector-j/en/connector-j-reference-implementation-notes.html |
// Se http://dev.mysql.com/doc/connector-j/en/connector-j-reference-implementation-notes.html |
|
//PreparedStatement stmt = conn.prepareStatement(sql); |
|
175 |
PreparedStatement stmt = conn.prepareStatement(sql, java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); |
PreparedStatement stmt = conn.prepareStatement(sql, java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); |
176 |
stmt.setFetchSize(Integer.MIN_VALUE); |
stmt.setFetchSize(Integer.MIN_VALUE); |
177 |
|
|
216 |
|
|
217 |
saveStmt.addBatch(); |
saveStmt.addBatch(); |
218 |
batchCount++; |
batchCount++; |
219 |
if (batchCount >= 100) { |
if (batchCount >= 1000) { |
220 |
saveStmt.executeBatch(); |
saveStmt.executeBatch(); |
221 |
batchCount = 0; |
batchCount = 0; |
222 |
} |
} |
304 |
|
|
305 |
|
|
306 |
// ////////////////////////////////////////////////////////////////// |
// ////////////////////////////////////////////////////////////////// |
307 |
|
/* |
308 |
@Deprecated |
@Deprecated |
309 |
private BoundingBox getBoundingboxFromDb_old(String postnr) throws SQLException { |
private BoundingBox getBoundingboxFromDb_old(String postnr) throws SQLException { |
310 |
String minPostnr = postnr.replace('x', '0'); |
String minPostnr = postnr.replace('x', '0'); |
400 |
"AND rute is null " + // Træk kun liste på postnumre hvor der er ikke-dækkede adresser |
"AND rute is null " + // Træk kun liste på postnumre hvor der er ikke-dækkede adresser |
401 |
"GROUP BY postnr " + |
"GROUP BY postnr " + |
402 |
"ORDER by postnr"; |
"ORDER by postnr"; |
403 |
*/ |
* / |
404 |
|
|
405 |
|
|
406 |
String sql = "SELECT rpad(left(postnr,?),'4', 'x') as postnr2 " + |
String sql = "SELECT rpad(left(postnr,?),'4', 'x') as postnr2 " + |
432 |
//list.add(8700); |
//list.add(8700); |
433 |
|
|
434 |
return list; |
return list; |
435 |
} |
}*/ |
436 |
|
|
437 |
|
|
438 |
} |
} |