1

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?

Innoox
  • 15
  • 3
  • The ampersand `&` in the connection string probably has to be escaped as `&`. Similar discussion: https://stackoverflow.com/a/3824422/18667225 – Markus Jul 22 '22 at 21:29
  • @Markus thank you, Sir. Works for me. How can I apply your answer as a solution? – Innoox Jul 23 '22 at 09:59
  • I have added an answer that you can upvote and/or accept. – Markus Jul 23 '22 at 18:24

1 Answers1

1

The ampersand & in the connection string has to be expressed by the built-in entity &amp; like this:

jdbc-url="jdbc:postgresql://localhost/test?user=postgres&amp;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

Markus
  • 5,976
  • 5
  • 6
  • 21