I'm trying to set up a data source in OpenOffice.org to access my local PostgreSQL database using JDBC. (This is a learning experience, not a production system.)
I can access the database ('company') from psql as user tsinclai just fine. I can also send queries from a Java app using JDBC. So far so good.
However, I'm trying to set up a new data source in OpenOffice.org like so:
- In Tools->Data Sources:
Name: Company
Database Type: JDBC
URL: jdbc:postgresql://localhost/company
In the JDBC tab:
JDBC Driver Class: org.postgresql.Driver (This is the same as in my Java app)
URL: Same as above
User: tsinclai
Password Required
The classpath is set correctly. (At least it works when I use plain old Java.)
However, when I try to access the tables, I get the error message:
No connection could be established for the URL jdbc:postgresql://localhost/company
I've also tried using the URL jdbc:postgresql:company (what my Java code sends to JDBC), same problem.
I've checked what online documentation I've been able to Google and snooped through the JDBC and PostgreSQL sites as well as the OpenOffice.org documentation. It seems that it should work, but it doesn't.
Any ideas?