I have a bunch of errors trying to connect GW to PostgreSQL. I have tried a lot of changes in database-config.xml On of them is:
<database
autoupgrade="full"
name="BillingCenterDatabase"
dbtype="postgresql">
<dbcp-connection-pool
jdbc-url="jdbc:postgresql://localhost/test?user=postgres&password=qwerty;"/>
It gives me fewer errors, but I still can't connect.
[Fatal Error] :25:72: The reference to entity "password" must end with the ';' delimiter.
It pretends I have to to put a semicolon in place of
password;=qwerty
If I put it here, I've got an error: The entity "password" was referenced but not declared. The GW suggestion for the psql is:
Expected: jdbc:postgresql://<host>[:<port>]/<dbname>?user=<user>&password=<password>
Maybe some experienced folks may help me with it?
CodePudding user response:
The ampersand &
in the connection string has to be expressed by the built-in entity &
like this:
jdbc-url="jdbc:postgresql://localhost/test?user=postgres&password=qwerty;"
Otherwise the XML
-parser will try to interpret the following word (here password
) as entity which would have to be terminated by ;
. This explains the misleading error message.
Similar discussion: https://stackoverflow.com/a/3824422/18667225