Reputation: 71
I have a database named sales/pre in postgreSQL. While connecting to this database with JDBC application, the characters after forward slash get omitted, and I get the following error:
FATAL: database "sales" does not exist.
Is there a way to escape the forward slash?
Upvotes: 1
Views: 2864
Reputation: 4048
You are using a JDBC URL so you need to url encode your forward slash e.g.
jdbc:postgresql://host:port/sales%2Fpre
Alternatively choose a different database name.
Upvotes: 2