mysqljavaweblinux
//查询当前店铺 -自定义类别
public list findshopcovertype(string shopcode){
string sql = "select a.shop_code,a.cover_type_code,a.cover_type_name from shop_cover_type a where a.shop_code = ?";
final list list = new arraylist();
shopcovertypedao.getjdbctemplate().query(sql, new object[]{shopcode},new rowcallbackhandler(){
@override
public void processrow(resultset rs) throws sqlexception {
// todo auto-generated method stub
shopcovertype sct = new shopcovertype();
sct.setcovertypecode(rs.getstring("cover_type_code"));
sct.setshopcode(rs.getstring("shop_code"));
sct.setcovertypename(rs.getstring("cover_type_name"));
list.add(sct);
}
});
return list;
}
这是我本地的一个方法 在linux下会报错 看我的sql 是 String sql = "SELECT A.`shop_code`,A.`cover_type_code`,A.`cover_type_name` FROM `shop_cover_type` A WHERE A.`shop_code` = ?";from shop_cover_type在linux下 hibernate 查的是 from cx. shop_cover_type因此会报错找不到这个表 (Table 'cx.shop_cover_type' doesn't exist)很多表都是这样前面多了个 cx.第一次把项目布到linux 遇到很多问题 谢谢大jia

java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号