Spring Boot中SimpleJdbcCall无法识别大写Schema下PostgreSQL函数的问题求助
Spring Boot中SimpleJdbcCall无法识别大写Schema下PostgreSQL函数的问题求助
大家好,我在Spring Boot项目里遇到了一个棘手的问题,想请各位帮忙分析下:
我需要动态传入Schema和函数名来调用PostgreSQL的函数,于是用SimpleJdbcCall来实现,代码如下:
Integer result = new SimpleJdbcCall(datasource) .withSchemaName("TEST") .withFunctionName("get_data") .withReturnValue() .executeFunction(Integer.class);
执行这段代码时,我一直收到错误提示:Unable to determine the correct call signature - no procedure/function/signature for 'get_data'
经过反复测试,我发现问题出在Schema的大小写上:只要把Schema名改成小写,代码就能正常执行;但使用大写的Schema名(比如上面的"TEST")就会触发这个错误。
后来我查阅了PostgreSQL驱动包(PostgreSql-42.2.1.jar)的源码,发现问题的根源在PgDatabaseMetaData类中。
备注:内容来源于stack exchange,提问作者Гончаренко Александр
相关产品推荐
相关产品推荐

