2

I'm facing an issue with iBatis and PostgreSQL schemas. When I use the public schema i don't face any issue. Everything worked fine for me.

My URL connection string was like the below:

jdbc:postgresql://127.0.0.1:5678/dbname

But when i tried to use the same database using a different schema i always get

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

My url connection string looks like the below:

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

I'm using ibatis-2.3.4.726.jar with postgresql-8.0-325.jdbc2.jar.

Thanks in advance,

Regards,

Chris Travers
  • 22,769
  • 6
  • 52
  • 166
CharbelBadr
  • 77
  • 1
  • 6
  • 1
    Pg JDBC driver doesn't allow you to specify search path, you have to connect first then set it: http://stackoverflow.com/questions/4168689/is-it-possible-to-specify-schema-when-connecting-to-postgres-with-jdbc – Oliver Kohll Jun 08 '13 at 09:54

1 Answers1

1

Define your connection properties as following:

  • Connection URL : jdbc:postgresql://localhost:5432/postgres and make the
  • Configure the search_path in the postgres database properties and define the search_path variables as show.

Sample View

09Q71AO534
  • 3,820
  • 12
  • 37
  • 67