Hibernate--调用存储过程获取返回值

CallableStatement statement = getSession().connection().prepareCall(
                "{call sp_get_keyword_code(?, ? ,? ,?, ?)}");
        statement.setString(1, parentCode);
        statement.setInt(2, 2);
        statement.setString(3, "W");
        statement.setInt(4, 1);
        statement.registerOutParameter("out_code", Types.VARCHAR);
        statement.executeUpdate();
        String keycode = statement.getString("out_code");

  开发者博客www.developsearch.com

你可能感兴趣的:(Hibernate)