13 |
|
|
14 |
import dk.daoas.daoadresseservice.DaekningsType; |
import dk.daoas.daoadresseservice.DaekningsType; |
15 |
import dk.daoas.daoadresseservice.beans.Address; |
import dk.daoas.daoadresseservice.beans.Address; |
16 |
|
import dk.daoas.daoadresseservice.beans.AliasBean; |
17 |
import dk.daoas.daoadresseservice.beans.ExtendedBean; |
import dk.daoas.daoadresseservice.beans.ExtendedBean; |
18 |
import dk.daoas.daoadresseservice.beans.HundredePctBean; |
import dk.daoas.daoadresseservice.beans.HundredePctBean; |
19 |
import dk.daoas.daoadresseservice.beans.LoggedAddress; |
import dk.daoas.daoadresseservice.beans.LoggedAddress; |
84 |
} |
} |
85 |
} |
} |
86 |
|
|
87 |
|
public static List<AliasBean> getAliasList() throws SQLException { |
88 |
|
|
89 |
|
|
90 |
|
String sql = "SELECT postnr,vejnavn,aliasvejnavn " + |
91 |
|
"FROM bogleveringer.vejtabelprod " |
92 |
|
; |
93 |
|
|
94 |
|
try ( Connection conn = DBConnection.getConnection(); |
95 |
|
Statement stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); |
96 |
|
) { |
97 |
|
|
98 |
|
stmt.setFetchSize(Integer.MIN_VALUE); |
99 |
|
|
100 |
|
ResultSet res = stmt.executeQuery(sql); |
101 |
|
|
102 |
|
DeduplicateHelper<String> vejCache = new DeduplicateHelper<String>(); |
103 |
|
|
104 |
|
List<AliasBean> list = new ArrayList<AliasBean>( 5000); |
105 |
|
while (res.next()) { |
106 |
|
|
107 |
|
AliasBean ab = new AliasBean(); |
108 |
|
ab.postnr = res.getInt(1); |
109 |
|
ab.vejnavn = vejCache.getInstance( res.getString(2) ); |
110 |
|
ab.aliasVejnavn = vejCache.getInstance( res.getString(3) ); |
111 |
|
|
112 |
|
list.add(ab); |
113 |
|
} |
114 |
|
|
115 |
|
res.close(); |
116 |
|
|
117 |
|
System.out.println("Loaded " + list.size() + " aliase beans"); |
118 |
|
|
119 |
|
return list; |
120 |
|
} |
121 |
|
|
122 |
|
} |
123 |
|
|
124 |
public static List<ExtendedBean> getExtendedAdresslist() throws SQLException { |
public static List<ExtendedBean> getExtendedAdresslist() throws SQLException { |
125 |
String debugFilter1 = DatabaseLayer.DEBUG ? " WHERE orgPostnr = 8700 " : ""; |
String debugFilter1 = DatabaseLayer.DEBUG ? " WHERE orgPostnr = 8700 " : ""; |
126 |
String debugFilter2 = DatabaseLayer.DEBUG ? " AND orgPostnr = 8700 " : ""; |
String debugFilter2 = DatabaseLayer.DEBUG ? " AND orgPostnr = 8700 " : ""; |