--- android/TrainInfoService/src/dk/thoerup/traininfoservice/db/StationDAO.java 2011/06/08 15:38:11 1504 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/db/StationDAO.java 2011/06/08 15:45:41 1505 @@ -97,49 +97,7 @@ } } - public StationBean dumpAll() throws SQLException { - - String SQL = "SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog,stationcode_metro,address,0.0,aliases " + - "FROM trainstations WHERE enabled = true ORDER BY id"; - - Connection conn = null; - Statement stmt = null; - ResultSet res = null; - - - try { - conn = DBConnection.getConnection(); - - stmt = conn.createStatement(); - res = stmt.executeQuery(SQL); - - // Does mostly the same as convertResultset() - StationBean stations = new StationBean(); - while (res.next()) { - StationEntry entry = convertSingleRow(res); - - Array arr = res.getArray(10); - if (arr != null) { - String[] aliases = (String[]) arr.getArray(); - entry.setAliases(aliases); - } - - stations.entries.add( entry ); - - } - return stations; - - } finally { - if (res != null) - res.close(); - if (stmt != null) - stmt.close(); - if (conn != null) - conn.close(); - } - - } /* * this code requires theses statements are run on database in order to do ILIKE searches against aliases (which is defines as array of varchar(64) ) @@ -248,6 +206,52 @@ return null; } } + + //used to create full dump in order to populate Google Appengine DB + @Deprecated + public StationBean dumpAll() throws SQLException { + + String SQL = "SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog,stationcode_metro,address,0.0,aliases " + + "FROM trainstations WHERE enabled = true ORDER BY id"; + + Connection conn = null; + Statement stmt = null; + ResultSet res = null; + + + try { + conn = DBConnection.getConnection(); + + stmt = conn.createStatement(); + res = stmt.executeQuery(SQL); + + // Does mostly the same as convertResultset() + StationBean stations = new StationBean(); + while (res.next()) { + StationEntry entry = convertSingleRow(res); + + Array arr = res.getArray(10); + if (arr != null) { + String[] aliases = (String[]) arr.getArray(); + entry.setAliases(aliases); + } + + stations.entries.add( entry ); + + } + return stations; + + + } finally { + if (res != null) + res.close(); + if (stmt != null) + stmt.close(); + if (conn != null) + conn.close(); + } + + } @Deprecated public static String getStationName(int stationID) {