2

我面临 iBatis 和 PostgreSQL 模式的问题。当我使用公共模式时,我不会遇到任何问题。一切对我来说都很好。

我的 URL 连接字符串如下所示:

jdbc:postgresql://127.0.0.1:5678/dbname

但是当我尝试使用不同的模式使用同一个数据库时,我总是得到

com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in SqlMapProcessedFiles.xml.  
--- The error occurred while applying a parameter map.  
--- Check the getProcessedFiles-InlineParameterMap.  
--- Check the statement (query failed).  
--- Cause: java.sql.SQLException: ERROR: relation "table name" does not exist

我的 url 连接字符串如下所示:

jdbc:postgresql://127.0.0.1:5678/dbname?searchpath=schemaName

我正在使用 ibatis-2.3.4.726.jar 和 postgresql-8.0-325.jdbc2.jar。

提前致谢,

问候,

4

1 回答 1

1

如下定义您的连接属性:

  • 连接网址:jdbc:postgresql://localhost:5432/postgres并制作
  • search_pathpostgres数据库属性中配置并定义 search_path 变量,如下所示。

示例视图

于 2015-06-09T09:51:16.507 回答