20 |
|
|
21 |
public class DatabaseLayerImplementation { |
public class DatabaseLayerImplementation { |
22 |
|
|
23 |
static boolean DEBUG = false; |
//static boolean DEBUG = false; |
24 |
|
|
25 |
|
|
26 |
public List<Address> getAllAdresses() throws SQLException { |
public List<Address> getAllAdresses() throws SQLException { |
27 |
TimingHelper timing = new TimingHelper(); |
TimingHelper timing = new TimingHelper(); |
28 |
|
|
29 |
String debugFilter = DatabaseLayerImplementation.DEBUG ? " WHERE postnr >= 6000 " : ""; |
//String debugFilter = DatabaseLayerImplementation.DEBUG ? " WHERE postnr >= 6000 " : ""; |
30 |
|
|
31 |
String sql = |
String sql = |
32 |
"SELECT id,vejnavn,husnr,husnrbogstav,kommunekode,vejkode,postnr,gadeid,upper(distributor) AS distributor,dbkbane,latitude,longitude, " |
"SELECT id,vejnavn,husnr,husnrbogstav,kommunekode,vejkode,postnr,gadeid,upper(distributor) AS distributor,dbkbane,latitude,longitude, " |
33 |
+ "rutema,korelistema,ruteti,korelisteti,ruteon,korelisteon,ruteto,korelisteto,rutefr,korelistefr,rutelo,korelistelo,ruteso,korelisteso " |
+ "rutema,korelistema,ruteti,korelisteti,ruteon,korelisteon,ruteto,korelisteto,rutefr,korelistefr,rutelo,korelistelo,ruteso,korelisteso " |
34 |
+ "FROM fulddaekning.adressetabel " |
+ "FROM fulddaekning.adressetabel " |
35 |
+ debugFilter |
//+ debugFilter |
36 |
; |
; |
37 |
|
|
38 |
try ( Connection conn = DBConnection.getConnection(); |
try ( Connection conn = DBConnection.getConnection(); |
114 |
"RuteFr=?, KorelisteFr=?, " + |
"RuteFr=?, KorelisteFr=?, " + |
115 |
"RuteLo=?, KorelisteLo=?, " + |
"RuteLo=?, KorelisteLo=?, " + |
116 |
"RuteSo=?, KorelisteSo=?, " + |
"RuteSo=?, KorelisteSo=?, " + |
117 |
"Distributor=? " + |
"Distributor=?, " + |
118 |
|
"DBKBane=? " + |
119 |
"WHERE id=?"; |
"WHERE id=?"; |
120 |
|
|
121 |
|
|
141 |
stmt.setString(14, addr.korelisteSondag); |
stmt.setString(14, addr.korelisteSondag); |
142 |
|
|
143 |
stmt.setString(15, addr.distributor); |
stmt.setString(15, addr.distributor); |
144 |
stmt.setInt(16, addr.id); |
stmt.setInt(16, addr.dbkBane); |
145 |
|
stmt.setInt(17, addr.id); |
146 |
|
|
147 |
|
|
148 |
stmt.execute(); |
stmt.execute(); |