why my spring app cant connect to DB?

hi guys. im using intellij idea to run my java spring app. i connected my db to the intellij idea.
host: localhost
port:5432
user:us3r
password:p4ss
URL:jdbc:postgresql://localhost:5432/postgres
host: localhost
port:5432
user:us3r
password:p4ss
URL:jdbc:postgresql://localhost:5432/postgres
im using ssh tunnel to connect to database. when i test the connection everything is fine. but the problem arises when i try to start my java spring app. in application.yaml i have this piece of configuration:
spring:
datasource:
platform: postgres
url: jdbc:postgresql://localhost:5432/lms_dev2
username: us3r
password: p4ss
spring:
datasource:
platform: postgres
url: jdbc:postgresql://localhost:5432/lms_dev2
username: us3r
password: p4ss
and when i start the app i get org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. whats wrong? can smb help me out pls? thanks in advance
4 Replies
JavaBot
JavaBot3w ago
This post has been reserved for your question.
Hey @i hate SQL so much its unreal! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
ayylmao123xdd
ayylmao123xdd3w ago
did you create the schema or whatever thats called in postgres lms dev2
JavaBot
JavaBot2w ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?