--- android/TrainInfoService/src/dk/thoerup/traininfoservice/db/StationDAO.java 2011/07/09 17:18:59 1574 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/db/StationDAO.java 2012/02/24 14:26:53 1692 @@ -273,6 +273,13 @@ String SQL = "SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog,stationcode_metro,address,0.0,aliases " + "FROM trainstations WHERE enabled = true"; + + StationBean stations = fetchStations(SQL, new NullSetter() ); + Collections.sort( stations.entries,nameComparator ); + + return stations; + + /* Connection conn = null; Statement stmt = null; ResultSet res = null; @@ -309,7 +316,7 @@ stmt.close(); if (conn != null) conn.close(); - } + }*/ } @@ -337,6 +344,23 @@ return station; } + public boolean hasDisabledStation(final String name) throws SQLException { + String SQL = "Select count(*) as antal from trainstations where name = '" + name + "' and enabled=false " ; + + Connection conn = DBConnection.getConnection(); + Statement stmt = conn.createStatement(); + ResultSet rs = stmt.executeQuery( SQL ); + + rs.next(); + + int antal = rs.getInt(1); + + rs.close(); + stmt.close(); + conn.close(); + + return (antal > 0); + } @Deprecated