小编Ser*_*nez的帖子

在多个表oracle上授予SELECT

我有3个表table1,table2,table3.我想将这些表授予(例如选择)给用户user1.

我知道我可以批准:

grant select on table1 to user1;
grant select on table2 to user1;
grant select on table3 to user1;
Run Code Online (Sandbox Code Playgroud)

我可以仅使用1个查询将3个表授予user1吗?

谢谢

select grant oracle11g

15
推荐指数
3
解决办法
12万
查看次数

在请求中标题{"Accept":"application/octet-stream"}时返回JSON错误

从其他WebService返回一些错误时我遇到了一些问题.

使用标头发出请求{"Accept":"application/octet-stream"} (ResponseEntity<InputStreamResource>如果所有进程都顺利,则服务返回文档).

当所有过程顺利进行时,文档下载得很好,但是当发生错误并且代码跳转到@ControllerAdvice并尝试返回JSON错误时.当试图返回JSON弹簧崩溃时出现问题:

org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation 
Run Code Online (Sandbox Code Playgroud)

以下是一些代码的示例:

调节器

@RequestMapping(value = "/test", method = RequestMethod.GET, produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_OCTET_STREAM_VALUE })
    public ResponseEntity<CustomError> test() throws Exception {
        throw new Exception();
    }
Run Code Online (Sandbox Code Playgroud)

ControllerAdvice

@ControllerAdvice
public class ExceptionHandlerAdvice {
    private static final Logger logger = LogManager.getLogger(ExceptionHandlerAdvice.class);

    @ExceptionHandler({Exception.class,Throwable.class})
    @ResponseBody
    public ResponseEntity<CustomError> handleUnhandledException(Exception exception) {
        CustomError error = new CustomError(exception.getMessage());
        return new ResponseEntity<CustomError>(error, HttpStatus.INTERNAL_SERVER_ERROR);
    }

}
Run Code Online (Sandbox Code Playgroud)

CustomError:

public class CustomError {

    private String errorDescription;

    public CustomError(String errorDescription) …
Run Code Online (Sandbox Code Playgroud)

java rest json web-services spring-boot

5
推荐指数
1
解决办法
539
查看次数

String.replace()Python删除第一个巧合

在string.replace的Python文档之后,我正在尝试替换字符串,例如"843845ab38".如何才能使string.replace(旧的,新的)只替换第一个巧合?

例:

a="843845ab38"
a.replace("8","")
print a
Run Code Online (Sandbox Code Playgroud)

我正在寻找的解决方案是"43845ab38",用空格替换前8个.

python replace

0
推荐指数
1
解决办法
588
查看次数

标签 统计

grant ×1

java ×1

json ×1

oracle11g ×1

python ×1

replace ×1

rest ×1

select ×1

spring-boot ×1

web-services ×1