22 |
|
|
23 |
|
|
24 |
|
|
25 |
public class Database { |
public class DatabaseRouteDistance { |
26 |
private TaskLogger logger = TaskLogger.getInstance(); |
private TaskLogger logger = TaskLogger.getInstance(); |
27 |
|
|
28 |
int batchCount = 0; |
int batchCount = 0; |
51 |
|
|
52 |
private HashMap<Short,BoundingBox> bbCache = new HashMap<Short,BoundingBox>(); |
private HashMap<Short,BoundingBox> bbCache = new HashMap<Short,BoundingBox>(); |
53 |
|
|
54 |
public Database(Connection conn, boolean isIncremental) throws SQLException,IOException { |
public DatabaseRouteDistance(Connection conn, boolean isIncremental) throws SQLException,IOException { |
55 |
this.conn = conn; |
this.conn = conn; |
56 |
|
|
57 |
String newExt = ""; |
String newExt = ""; |
223 |
// 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) |
224 |
// 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 |
225 |
|
|
226 |
try (PreparedStatement stmt = conn.prepareStatement(sql, java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY)) { |
try (PreparedStatement stmt = conn.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY)) { |
227 |
stmt.setFetchSize(Integer.MIN_VALUE); |
stmt.setFetchSize(Integer.MIN_VALUE); |
228 |
|
|
229 |
stmt.setString(1, distributor); |
stmt.setString(1, distributor); |