The issue is that you're specifying a postgres driver as a JBoss-wide JNDI resource but the postgres jar isn't in the JBoss classpath. Putting the jar in a war won't do because the JNDI resource is shared among all apps.
You'll need to put it either in the server's lib dir or the top level lib dir. Also, I'm surprised you have run the SET for every SQL call. I can set it once via psql and not have to worry about it again. On Tue, 2007-03-20 at 10:52 -0500, Mark Volkmann wrote: > 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.