/[projects]/dao/FuldDaekningWorker/src/main/java/dk/daoas/fulddaekning/Database.java
ViewVC logotype

Diff of /dao/FuldDaekningWorker/src/main/java/dk/daoas/fulddaekning/Database.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Database.java revision 2711 by torben, Sun Sep 27 19:43:24 2015 UTC dao/FuldDaekningWorker/src/main/java/dk/daoas/fulddaekning/Database.java revision 2741 by torben, Tue Oct 6 21:26:55 2015 UTC
# Line 68  public class Database { Line 68  public class Database {
68          }                }      
69                    
70          public void renameResultTables() throws SQLException {          public void renameResultTables() throws SQLException {
71                    if (LookupMain.test_mode == true) {
72                            throw new RuntimeException("Can not rename tables in test mode");
73                    }
74    
75                  Constants consts = Constants.getInstance();                  Constants consts = Constants.getInstance();
76                  String ext = consts.getTableExtension();                  String ext = consts.getTableExtension();
77                                    
# Line 101  public class Database { Line 105  public class Database {
105                                  "FROM fulddaekning.adressetabel a " +                                  "FROM fulddaekning.adressetabel a " +
106                                  "LEFT JOIN bogleveringer.postnummerdistributor p on (a.postnr=p.postnr) " +                                  "LEFT JOIN bogleveringer.postnummerdistributor p on (a.postnr=p.postnr) " +
107                                  "WHERE rute IS NULL " +  //Ingen dækning                                  "WHERE rute IS NULL " +  //Ingen dækning
108                                  //"AND a.postnr BETWEEN ? AND ? " +                                  "AND a.postnr BETWEEN ? AND ? " +
                                 "AND a.postnr BETWEEN 8000 and 8600 " +  
                                 //"AND a.postnr BETWEEN 9000 AND 9300 " +  
109                                  "AND latitude IS NOT NULL " +                                  "AND latitude IS NOT NULL " +
110                                  "AND longitude IS NOT NULL " +                                  "AND longitude IS NOT NULL " +
111                                  "AND gadeid IS NOT NULL " +                                  "AND gadeid IS NOT NULL " +
112                                  "AND (a.distributor IS NULL OR a.distributor<>'LUKKET') " +                                  "AND (a.distributor IS NULL OR a.distributor<>'LUKKET') "
113                                  "LIMIT 2500";                                            ;              
114                    
115                    if (LookupMain.test_mode == true) {
116                            sql = sql + " LIMIT 100 ";
117                    }
118                    
119                  PreparedStatement stmt = conn.prepareStatement(sql);                  PreparedStatement stmt = conn.prepareStatement(sql);
120                  //stmt.setInt(1, minPostnr);                  stmt.setInt(1, minPostnr);
121                  //stmt.setInt(2, maxPostnr);                  stmt.setInt(2, maxPostnr);
122    
123                  List<Adresse> list = hentAdresseListe( stmt );                  List<Adresse> list = hentAdresseListe( stmt );
124                  alleIkkeDaekkede = list.toArray( new Adresse[ list.size() ] );                  alleIkkeDaekkede = list.toArray( new Adresse[ list.size() ] );
# Line 160  public class Database { Line 167  public class Database {
167                                          "AND latitude IS NOT NULL " +                                          "AND latitude IS NOT NULL " +
168                                          "AND longitude IS NOT NULL " +                                          "AND longitude IS NOT NULL " +
169                                          "AND a.distributor = ? ";                                          "AND a.distributor = ? ";
170    
171                            if (LookupMain.test_mode == true) {
172                                    sql = sql + " AND a.postnr BETWEEN 6000 and 7200 ";
173                            }
174                    
175                          // 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)
176                          // 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

Legend:
Removed from v.2711  
changed lines
  Added in v.2741

  ViewVC Help
Powered by ViewVC 1.1.20