Parent Directory
|
Revision Log
|
Patch
revision 1574 by torben, Sat Jul 9 17:18:59 2011 UTC | revision 1692 by torben, Fri Feb 24 14:26:53 2012 UTC | |
---|---|---|
# | Line 273 public class StationDAO { | Line 273 public class StationDAO { |
273 | String SQL = "SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog,stationcode_metro,address,0.0,aliases " + | String SQL = "SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog,stationcode_metro,address,0.0,aliases " + |
274 | "FROM trainstations WHERE enabled = true"; | "FROM trainstations WHERE enabled = true"; |
275 | ||
276 | ||
277 | StationBean stations = fetchStations(SQL, new NullSetter() ); | |
278 | Collections.sort( stations.entries,nameComparator ); | |
279 | ||
280 | return stations; | |
281 | ||
282 | /* | |
283 | Connection conn = null; | Connection conn = null; |
284 | Statement stmt = null; | Statement stmt = null; |
285 | ResultSet res = null; | ResultSet res = null; |
# | Line 309 public class StationDAO { | Line 316 public class StationDAO { |
316 | stmt.close(); | stmt.close(); |
317 | if (conn != null) | if (conn != null) |
318 | conn.close(); | conn.close(); |
319 | } | }*/ |
320 | ||
321 | } | } |
322 | ||
# | Line 337 public class StationDAO { | Line 344 public class StationDAO { |
344 | return station; | return station; |
345 | } | } |
346 | ||
347 | public boolean hasDisabledStation(final String name) throws SQLException { | |
348 | String SQL = "Select count(*) as antal from trainstations where name = '" + name + "' and enabled=false " ; | |
349 | ||
350 | Connection conn = DBConnection.getConnection(); | |
351 | Statement stmt = conn.createStatement(); | |
352 | ResultSet rs = stmt.executeQuery( SQL ); | |
353 | ||
354 | rs.next(); | |
355 | ||
356 | int antal = rs.getInt(1); | |
357 | ||
358 | rs.close(); | |
359 | stmt.close(); | |
360 | conn.close(); | |
361 | ||
362 | return (antal > 0); | |
363 | } | |
364 | ||
365 | ||
366 | @Deprecated | @Deprecated |
|
ViewVC Help | |
Powered by ViewVC 1.1.20 |