public List getPlatformList(String pf){
String sql="select t4.deviceid,t4.devicetype,t4.devicename,t4.stationid,t4.xpoint,t4.ypoint,t4.platform,t5.downlinkid as downlinkids from t_platform_topo t4 left join (select t1.deviceid,t2.downlinkid from t_platform_topo t1 , t_node_display t2 ,t_station t3 "+
"where t1.stationid=t3.stationid and t2.station=t3.stationname and instr(t2.nodename,t1.devicename)>0 and t1.platform ='"+pf+"' and t1.devicetype=3) t5 on "+
"t4.deviceid = t5.deviceid where t4.platform='"+pf+"'";
return getJdbcTemplate().query(sql, new PlatformTopoMapper());
}
class PlatformTopoMapper implements RowMapper{ public Object mapRow(ResultSet rowSet, int rowNum) throws SQLException {
final PlatformTopoBO bo = new PlatformTopoBO();
bo.setDeviceid(rowSet.getLong("deviceid"));
bo.setDevicename(rowSet.getString("devicename"));
bo.setDevicetype(rowSet.getInt("devicetype"));
bo.setPlatform(rowSet.getString("platform"));
bo.setStationid(rowSet.getInt("stationid"));
bo.setXpoint(rowSet.getInt("xpoint"));
bo.setYpoint(rowSet.getInt("ypoint"));
bo.setDownlinkid(rowSet.getString("downlinkids")); return bo;
}
}红色部分就是发出报错的地方! 数据库查没有问题 可能因为这个t5不是一个实际意义的表 所以不能识别downlinkid 请高手指教下!
String sql="select t4.deviceid,t4.devicetype,t4.devicename,t4.stationid,t4.xpoint,t4.ypoint,t4.platform,t5.downlinkid as downlinkids from t_platform_topo t4 left join (select t1.deviceid,t2.downlinkid from t_platform_topo t1 , t_node_display t2 ,t_station t3 "+
"where t1.stationid=t3.stationid and t2.station=t3.stationname and instr(t2.nodename,t1.devicename)>0 and t1.platform ='"+pf+"' and t1.devicetype=3) t5 on "+
"t4.deviceid = t5.deviceid where t4.platform='"+pf+"'";
return getJdbcTemplate().query(sql, new PlatformTopoMapper());
}
class PlatformTopoMapper implements RowMapper{ public Object mapRow(ResultSet rowSet, int rowNum) throws SQLException {
final PlatformTopoBO bo = new PlatformTopoBO();
bo.setDeviceid(rowSet.getLong("deviceid"));
bo.setDevicename(rowSet.getString("devicename"));
bo.setDevicetype(rowSet.getInt("devicetype"));
bo.setPlatform(rowSet.getString("platform"));
bo.setStationid(rowSet.getInt("stationid"));
bo.setXpoint(rowSet.getInt("xpoint"));
bo.setYpoint(rowSet.getInt("ypoint"));
bo.setDownlinkid(rowSet.getString("downlinkids")); return bo;
}
}红色部分就是发出报错的地方! 数据库查没有问题 可能因为这个t5不是一个实际意义的表 所以不能识别downlinkid 请高手指教下!
解决方案 »
- Continue the previous question
- 请问有哪位使用weblogic,急发一个里面的xbean.jar给我,不胜感激。
- forward(request, response)问题,偶尔空白,随机性的!
- Struts中,ActionMapping怎么跳转到另一个Action方法?
- 请问怎样把http://localhost:8080/test的形式改成www.test.com
- 会mysql请帮忙一下
- 请问哪里有用JSP编写的BBS的源程序,谢谢了?
- 这是什么错误?
- 为什么webapps中建test文件夹,jsp程序不能运行,而在相同的目录下建jsp文件夹却可以运行,这到底是为什么
- rocket mq 被消费的历史消息是否会被永久保存下来?还是会定期做删除?
- 如何做Dtree的双击?
- 问题:linux系统上传文件的格式
我换成按索引取 又报无效的列索引。
bo.setDownlinkid(rowSet.getString(8));
public List<Card> queryCardByname(String sname) {
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
List<Card> list = new ArrayList<Card>();
String sql = "select * from card where sname =?";
con = db.getConnection();
try {
// System.out.println("!!!!!:"+rs.isClosed());
ps = con.prepareStatement(sql);
ps.setString(1, sname);
rs = ps.executeQuery();
while (rs.next()) {
Card cd = new Card();
cd.setSname(StringUtil.repairNull(rs.getString("Sname")));
cd.setCardfbid(StringUtil.repairNull(rs.getString("Cardfbid")));
list.add(cd);
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
this.close(ps, rs, con);
} return list;
}