/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/StationDAO.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/StationDAO.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 649 by torben, Mon Feb 8 19:25:12 2010 UTC revision 650 by torben, Mon Apr 19 19:04:34 2010 UTC
# Line 155  public class StationDAO { Line 155  public class StationDAO {
155                          return result;                          return result;
156                                                    
157           }           }
158                     public static String getStationName(int stationID) {
159                     String station = "";
160    
161                     Connection conn = null;
162                     try {
163                             conn = DBConnection.getConnection();
164                             Statement stmt = conn.createStatement();
165                             ResultSet rs = stmt.executeQuery("SELECT name FROM trainstations WHERE id=" + stationID);
166                             if (rs.next()) {
167                                     station = rs.getString(1);
168                             }
169    
170                     } catch (Exception e) {        
171                     } finally {
172                             try {
173                                     if (conn != null && !conn.isClosed())
174                                             conn.close();
175                             } catch (Exception e) {}
176                     }
177    
178                     return station;
179             }
180  }  }

Legend:
Removed from v.649  
changed lines
  Added in v.650

  ViewVC Help
Powered by ViewVC 1.1.20