18 |
|
|
19 |
import dk.daoas.adressevedligehold.beans.Address; |
import dk.daoas.adressevedligehold.beans.Address; |
20 |
import dk.daoas.adressevedligehold.util.DeduplicateHelper; |
import dk.daoas.adressevedligehold.util.DeduplicateHelper; |
21 |
|
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
22 |
|
|
23 |
|
|
24 |
|
|
73 |
} |
} |
74 |
} |
} |
75 |
|
|
76 |
|
@SuppressFBWarnings("SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE") |
77 |
public void renameResultTables() throws SQLException { |
public void renameResultTables() throws SQLException { |
78 |
if (AfstandAndenRuteTask.test_mode == true) { |
if (AfstandAndenRuteTask.test_mode == true) { |
79 |
throw new RuntimeException("Can not rename tables in test mode"); |
throw new RuntimeException("Can not rename tables in test mode"); |
101 |
|
|
102 |
public BoundingBox getBoundingbox(short postnr) { |
public BoundingBox getBoundingbox(short postnr) { |
103 |
BoundingBox bb = bbCache.get(postnr); |
BoundingBox bb = bbCache.get(postnr); |
104 |
return bb.clone();//never return the original / cached object |
return new BoundingBox(bb); //never return the original / cached object |
105 |
} |
} |
106 |
|
|
107 |
|
|
273 |
Constants consts = Constants.getInstance(); |
Constants consts = Constants.getInstance(); |
274 |
|
|
275 |
//logger.info("Starting query"); |
//logger.info("Starting query"); |
276 |
ResultSet res = stmt.executeQuery(); |
try ( ResultSet res = stmt.executeQuery() ) { |
277 |
//logger.info("Starting exec query done"); |
|
|
|
|
|
while (res.next()) { |
|
|
|
|
|
double latitude = res.getDouble(7); |
|
|
double longitude = res.getDouble(8); |
|
|
|
|
|
|
|
|
Address adr = new Address(latitude,longitude); |
|
278 |
|
|
279 |
adr.id = res.getInt(1); |
while (res.next()) { |
280 |
adr.postnr = res.getShort(2); |
|
281 |
adr.vejnavn = vejnavnCache.getInstance( res.getString(3) ); |
double latitude = res.getDouble(7); |
282 |
adr.gadeid = res.getInt(4); |
double longitude = res.getDouble(8); |
283 |
adr.husnr = res.getShort(5); |
|
284 |
adr.husnrbogstav = husnrbogstavCache.getInstance( res.getString(6) ); |
|
285 |
//adr.latitude = res.getDouble(7); |
Address adr = new Address(latitude,longitude); |
286 |
//adr.longitude = res.getDouble(8); |
|
287 |
adr.ruteMandag = ruteCache.getInstance( res.getString(9) ); |
adr.id = res.getInt(1); |
288 |
adr.ho = res.getShort(10); |
adr.postnr = res.getShort(2); |
289 |
|
adr.vejnavn = vejnavnCache.getInstance( res.getString(3) ); |
290 |
list.add(adr); |
adr.gadeid = res.getInt(4); |
291 |
|
adr.husnr = res.getShort(5); |
292 |
if (consts.doCheckHO() == true && adr.ho == 0) { |
adr.husnrbogstav = husnrbogstavCache.getInstance( res.getString(6) ); |
293 |
System.out.println( "Mangler HO" ); |
//adr.latitude = res.getDouble(7); |
294 |
System.out.println( adr ); |
//adr.longitude = res.getDouble(8); |
295 |
System.exit(0); |
adr.ruteMandag = ruteCache.getInstance( res.getString(9) ); |
296 |
|
adr.ho = res.getShort(10); |
297 |
|
|
298 |
|
list.add(adr); |
299 |
|
|
300 |
|
if (consts.doCheckHO() == true && adr.ho == 0) { |
301 |
|
System.out.println( "Mangler HO" ); |
302 |
|
System.out.println( adr ); |
303 |
|
throw new RuntimeException("Mangler HO: "+ adr); |
304 |
|
} |
305 |
|
|
306 |
|
//logger.info( "Adress:" + adr); |
307 |
} |
} |
308 |
|
|
309 |
//logger.info( "Adress:" + adr); |
res.close(); |
310 |
|
stmt.close(); |
311 |
|
|
312 |
|
return list; |
313 |
} |
} |
|
|
|
|
res.close(); |
|
|
stmt.close(); |
|
|
|
|
|
return list; |
|
314 |
} |
} |
315 |
|
|
316 |
} |
} |