Skip to Content
1
Jun 14, 2022 at 06:51 PM

SAP HANA JDBC Driver: how to escape & char used in a password inside a connection string

280 Views Last edit Jun 15, 2022 at 08:51 AM 2 rev

Hi,

I am trying to connect to SAP HANA database with JDBC Driver using a connection string, and the password contains the & char (e.g. jdbc:sap://192.168.1.50:443/?encrypt=true&user=USER&password="My&Passwd")

I escaped the whole password with double-quotes (which correctly escapes other special chars) but I always received an authentication failed error.

I tried also to escape the & char in many ways (e.g. &&, \&, %26), but none works.

Do someone know if there is a way to escape the & char?

Thanks

Enrico