Cannot connect with private network in spring boot to postgres
I'm trying to connect with private network from my api rest. This is the config to connect in the source code
jdbc:postgresql://[${PRIVATE_HOST}]:${PRIVATE_PORT}/${PROD_DB_NAME}
variables
PRIVATE_PORT: 5432
PRIVATE_HOST: postgres.railway.internal
I'm not using own dockerfile
I don't know what i'm doing wrong.
11 Replies
Project ID:
c0c4f992-a272-4995-86d2-dc367a7b9f81
c0c4f992-a272-4995-86d2-dc367a7b9f81
what errors are you getting
java.net.UnknownHostException: [postgres.railway.internal]
jdbc postgres docs says that I must enclose with []
![No description](https://cdn.answeroverflow.com/1206872208312369213/image.png)
Solution
that's for ipv6 addresses, that's a domain name not an ipv6 address
sorry, how I get the ipv6 address to define in the datasource.url ?I thought that's enough x.x
you don't want to get the ipv6 address, I'm saying it's not an ipv6 address, therefore you don't need to enclose it with brackets
I thought I saw that they didn't support IPv4 D:
it's just a domain
it works 🥲 Sorry