Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WSAD 512 / PostgreSQL (win) datasource setup

Status
Not open for further replies.

digitalnomad

Programmer
Aug 4, 2006
4
US
Going to detail setup using very brief statements:
1. Using WSAD 5.1.2 on Windows.
2. Installed Postgre 8.1.4.
3. Have postgresql-8.1-407.jdbc3.jar in server classpath (local WSAD test server).
4. Modified [postgre home]\data\pg_hba.conf to include:
local all trust
host all 127.0.0.1 255.255.255.255 trust

5. Set up server with JDBC Provider:
org.postgresql.ds.PGConnectionPoolDataSource
6. set up server with datasource name, no "resource properties"
7. set up web.xml for app with resource reference to the datasource:
a) Type: org.postgresql.xa.PGXADataSource
b) Authentication: Application
c) Sharing: Shareable

Problem/Question: I am getting the following exception when running a test servlet that simply tries to look up the datasource and get a connection. the JNDI lookup is fine, but when I try to get a connection, I get:

org.postgresql.util.PSQLException: FATAL: no PostgreSQL user name specified in startup packet

I assumed I would have to specify a username and password and database URL. what is a startup packet, where is it, and what should it look like? Any help is greatly appreciated. Thank you.
 
Solved. Great reference doc I had not yet found ( describes which datasource implementation to use for the client (specified in the deployment descriptor), and which one to use for the server. Goes on to describe what the "resource properties" are (name-value pairs provided to the datasource). These resource properties, as a whole, comprise what is referred to as the "startup packet". They are serverName, databaseName, user, password (I think there's another one too, but I didn't need it). Hope this helps someone else!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top