211 |
} |
} |
212 |
|
|
213 |
public static void saveRequestLog(String brugerid, String postnr, String adresse, SearchResult result) throws SQLException { |
public static void saveRequestLog(String brugerid, String postnr, String adresse, SearchResult result) throws SQLException { |
214 |
|
String setVar = "set sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' "; |
215 |
|
|
216 |
String sql = "INSERT INTO logs.hentruteinformation (postnr,adresse,vejnavn,googlevejnavn,husnr,husnr_bogstav,etage,lejlighed,rest,brugerid,status, indlast) " + |
String sql = "INSERT INTO logs.hentruteinformation (postnr,adresse,vejnavn,googlevejnavn,husnr,husnr_bogstav,etage,lejlighed,rest,brugerid,status, indlast) " + |
217 |
"VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW() )"; |
"VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW() )"; |
218 |
|
|
219 |
|
|
220 |
|
|
221 |
try ( Connection conn = DBConnection.getConnection(); |
try ( Connection conn = DBConnection.getConnection(); |
222 |
|
Statement setStmt = conn.createStatement(); |
223 |
PreparedStatement stmt = conn.prepareStatement(sql); |
PreparedStatement stmt = conn.prepareStatement(sql); |
224 |
) { |
) { |
225 |
|
|
226 |
|
setStmt.execute(setVar); |
227 |
|
|
228 |
|
|
229 |
stmt.setInt( 1, safeInt(postnr) ); |
stmt.setInt( 1, safeInt(postnr) ); |
230 |
stmt.setString( 2, adresse); |
stmt.setString( 2, adresse); |
231 |
stmt.setString( 3, result.splitResult.vej); |
stmt.setString( 3, result.splitResult.vej); |