标签:stat c中 hiberna resultset 取数 update col prepare mybatis
使用prepareStatement(String sql, int autoGeneratedKeys) 来定义PreparedStatement对象。并且指定:PreparedStatement.RETURN_GENERATED_KEYS 。
PreparedStatement psmt = conn.prepareStatement(sql, PreparedStatement.RETURN_GENERATED_KEYS); psmt.executeUpdate(); ResultSet keyResultSet = psmt.getGeneratedKeys(); keyResultSet.next(); long num =keyResultSet.getLong(1);
标签:stat c中 hiberna resultset 取数 update col prepare mybatis
原文地址:https://www.cnblogs.com/myitnews/p/11871221.html