代码部分如下:
// 删除购物车中的所有选购记录(通过JDBC进行批量删除)
Connection con = session.connection();
Statement stat = con.createStatement();
String sql = "delete from Cartselectedmer where cart=" + cartid;
tx = session.beginTransaction();
stat.executeUpdate(sql);
tx.commit();
if (stat != null)
stat.close();
status = true;
} catch (Exception ex) {
if (tx != null)
tx.rollback();
logger.info("在执行CartServiceImpl类中的clearCart方法时出错:\n");
ex.printStackTrace();
} finally {
MySessionFactory.closeSession();
}
return status;
}
Description Resource Path Location Type
The method connection() is undefined for the type Session CartServiceImpl.java /Eshop/src/com/service line 186 Java Problem
遇到的错误,提示我connection()未定义,但是又找不到原因在哪,在线求助大佬!!!
解决Session中connection()未定义问题
2079

被折叠的 条评论
为什么被折叠?



