MCPcopy Create free account
hub / github.com/EthanWang-cn/JavaWeb_Mall / execute

Method execute

src/main/java/smbms/dao/BaseDao.java:73–81  ·  view source on GitHub ↗

查询操作 获取service层统一的connection对象,补充预编译sql语句,返回结果集 @param connection @param pstm @param resultSet @param sql @param params @return @throws Exception

(Connection connection, PreparedStatement pstm,ResultSet resultSet, String sql, Object[] params)

Source from the content-addressed store, hash-verified

71 * @throws Exception
72 */
73 public static ResultSet execute(Connection connection, PreparedStatement pstm,ResultSet resultSet, String sql, Object[] params) throws Exception {
74 //预编译SQL语句,返回一个PreparedStatement实例
75 pstm = connection.prepareStatement(sql);
76 for (int i = 0; i < params.length; i++) {
77 pstm.setObject(i+1,params[i]);
78 }
79 resultSet = pstm.executeQuery();
80 return resultSet;
81 }
82
83 /**
84 * 更新操作,返回受影响的行数

Callers 6

getUserMethod · 0.95
getAllUsersMethod · 0.95
getAllGoodsMethod · 0.95
getGoodsMethod · 0.95
getGoodsBygidMethod · 0.95
getCartGoodsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected