Tried it, still no joy.
Right, the problem becomes even stranger.
I have created a JSP page which looks up the datasource and connection. Using this connection I insert and query the database.
This works fine.
Running the same code inside the application again returns the "Invalid object name" exception.
How in the world is this possible?