相应代码:
public ArrayList checkSt(String stname) {
ArrayList arrayList = new ArrayList();
DBConnection2 db = DBConnection2.getInstance();
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
String sql = "";
try {
//stname = exChange(stname);//字符串转码
if (stname != null) {
stname = exChange(stname);
if (!stname.equals("")) {
sql = "select * from stinfo where stname like '%"+stname+"%'";
} else {
sql = "select * from stinfo";
}
}
//sql = "select * from stinfo where stname like '%"+stname+"%'";
//sql = "select * from stinfo";
conn = db.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
while (rs.next() && rs != null) {
HashMap hashMap = new HashMap();
hashMap.put("stid", ""+rs.getInt("stid"));
hashMap.put("stname", rs.getString("stname"));
arrayList.add(hashMap);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (stmt != null) {
stmt.close();
}
db.freeConnection(conn);
} catch (Exception e) {
e.printStackTrace();
}
}
return arrayList;
}〖资料来源:计算机毕业论文 www.xiaoniu168.com〗
6、站点信息管理模块
4.4.1 删除站点
(1)模块功能描述
删除站点功能:通过车次的下拉选择框选择车次,进行查询列出该车次的所有站点信息,然后点击删除操作就可以删除该站点。需要注意:因为在车次中从起点站到终点站计算,其所有的站点是一个有次序的排列,所以删除一个站点,则它的下个站点次序号依次减少一位。
第10页继续系统实现部分......