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

Method executeUpdate

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

更新操作,返回受影响的行数 @param connection @param pstm @param sql @param params @return @throws Exception

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

Source from the content-addressed store, hash-verified

90 * @throws Exception
91 */
92 public static int executeUpdate(Connection connection, PreparedStatement pstm,
93 String sql, Object[] params) throws Exception {
94 int updateRows = 0;
95 pstm = connection.prepareStatement(sql);
96 for (int i = 0; i < params.length; i++) {
97 pstm.setObject(i + 1, params[i]);
98 }
99 updateRows = pstm.executeUpdate();
100 return updateRows;
101 }
102
103 /**
104 *

Callers 1

insertGoodsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected