jdbcTemplate返回插入ID

public PreparedStatement createPreparedStatement(Connection con)
					throws SQLException {
				PreparedStatement ps = (PreparedStatement) con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
				ps.setString(1, shua_user_name);
				ps.setString(2, shua_user_account);
				ps.setString(3, shua_user_pwd);
				ps.setString(4, shua_user_status);
				ps.setString(5, shua_user_type_id);
				ps.setString(6, shua_user_max_shop_group_number);
				ps.setString(7, shua_user_shop_status);
				ps.setString(8, shua_user_reveive_terminal);
				ps.setString(9, shua_user_cityList);
				ps.setString(10, shua_studio_id);

				return ps;
			}
		}, holder);   holder.getKey().intValue();

你可能感兴趣的:(java)