--- android/TrainInfoService/src/dk/thoerup/traininfoservice/LocateStations.java 2009/09/10 18:13:52 308 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/LocateStations.java 2009/09/10 19:00:31 309 @@ -30,7 +30,7 @@ protected String getStations(Connection conn, double latitude, double longitude) throws SQLException { //inner select is workaround from not being able to use a calculated column directly in where clause final String SQL = "SELECT * FROM ( "+ - " SELECT name,latitude,longitude,stationcode, " + + " SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog, " + " earth_distance( ll_to_earth(latitude,longitude), ll_to_earth(?,?))::int AS calcdist " + " FROM trainstations " + " WHERE latitude IS NOT NULL AND longitude IS NOT NULL " + @@ -58,11 +58,15 @@ while (res.next()) { buff.append("\n"); - buff.append("").append( res.getString(1) ) .append("\n"); - buff.append("").append( res.getDouble(2) ) .append("\n"); - buff.append("").append( res.getDouble(3) ) .append("\n"); - buff.append("").append( res.getString(4) ) .append("\n"); - buff.append("").append( res.getInt(5) ) .append("\n"); + buff.append("").append( res.getInt(1) ).append("\n"); + buff.append("").append( res.getString(2) ) .append("\n"); + buff.append("").append( res.getDouble(3) ) .append("\n"); + buff.append("").append( res.getDouble(4) ) .append("\n"); + res.getString(5); + buff.append("").append( !res.wasNull() ) .append("\n"); + res.getString(6); + buff.append("").append( !res.wasNull() ) .append("\n"); + buff.append("").append( res.getInt(7) ) .append("\n"); buff.append("\n"); }