【问题标题】:Using postgreSQL schema with iBatis在 iBatis 中使用 postgreSQL 模式
【发布时间】:2013-05-27 03:38:12
【问题描述】:

我遇到了 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。

提前致谢,

问候,

【问题讨论】:

标签: java jdbc ibatis


【解决方案1】:

如下定义你的连接属性:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-07
    • 2012-02-13
    • 1970-01-01
    • 1970-01-01
    • 2016-11-16
    • 2013-08-21
    相关资源
    最近更新 更多