--- dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Database.java 2015/09/27 19:43:24 2711 +++ dao/FuldDaekningWorker/src/main/java/dk/daoas/fulddaekning/Database.java 2015/10/06 21:26:55 2741 @@ -68,6 +68,10 @@ } public void renameResultTables() throws SQLException { + if (LookupMain.test_mode == true) { + throw new RuntimeException("Can not rename tables in test mode"); + } + Constants consts = Constants.getInstance(); String ext = consts.getTableExtension(); @@ -101,17 +105,20 @@ "FROM fulddaekning.adressetabel a " + "LEFT JOIN bogleveringer.postnummerdistributor p on (a.postnr=p.postnr) " + "WHERE rute IS NULL " + //Ingen dækning - //"AND a.postnr BETWEEN ? AND ? " + - "AND a.postnr BETWEEN 8000 and 8600 " + - //"AND a.postnr BETWEEN 9000 AND 9300 " + + "AND a.postnr BETWEEN ? AND ? " + "AND latitude IS NOT NULL " + "AND longitude IS NOT NULL " + "AND gadeid IS NOT NULL " + - "AND (a.distributor IS NULL OR a.distributor<>'LUKKET') " + - "LIMIT 2500"; + "AND (a.distributor IS NULL OR a.distributor<>'LUKKET') " + ; + + if (LookupMain.test_mode == true) { + sql = sql + " LIMIT 100 "; + } + PreparedStatement stmt = conn.prepareStatement(sql); - //stmt.setInt(1, minPostnr); - //stmt.setInt(2, maxPostnr); + stmt.setInt(1, minPostnr); + stmt.setInt(2, maxPostnr); List list = hentAdresseListe( stmt ); alleIkkeDaekkede = list.toArray( new Adresse[ list.size() ] ); @@ -160,6 +167,10 @@ "AND latitude IS NOT NULL " + "AND longitude IS NOT NULL " + "AND a.distributor = ? "; + + if (LookupMain.test_mode == true) { + sql = sql + " AND a.postnr BETWEEN 6000 and 7200 "; + } // Forward only + concur_read_only + fetchsize tvinger driver til at hente en række af gangen (bedre performance ved store result sets) // Se http://dev.mysql.com/doc/connector-j/en/connector-j-reference-implementation-notes.html