On Mar 20, 2007, at 10:06 AM, Mark Volkmann wrote:
> Postgres has a notion of a "search path" that is a list of schemas
> that are searched to find databases.
> I think I need to add my schema to the search path, but I don't
> know how to do that.
> Any ideas?
I'm making progress. I have some code that just uses JDBC and it works.
My schema name is "sal".
My database name is "XAdemo".
My database URL is jdbc:postgresql://localhost:5432/XAdemo.
I'm using the JDBC driver org.postgresql.Driver in
postgresql-8.2-504.jdbc3.jar.
In my JDBC code, I run this after gettting a Statement.
stmt.execute("set search_path = sal;");
This seems essential for specifying the schema so that the XAdemo
database can be found.
All this works with straight JDBC.
To duplicate this for my code that uses iBATIS under JBoss, I added
this to my postgres-ds.xml file that specifies JNDI datasources.
<new-connection-sql>set search_path = sal;</new-connection-sql>
However, when running with iBATIS I still get the following error
message.
"Apparently wrong driver class specified for URL: class:
org.postgresql.Driver, url: jdbc:postgresql://localhost:5432/XAdemo)"
What does "wrong driver class" mean? I verified that
org.postgresql.Driver is in postgresql-8.2-504.jdbc3.jar and that JAR
is in my WAR. I'm not sure what else to check.
|