I am trying to create a war file using spring boot and to deploy on a remote secured linux vm where postgres sql is installed,I want to use services to get data(read only operations) from db.
I had written code for this and used below application.properties:
spring.datasource.url=jdbc:postgresql://localhost/test ---localhost refers to the remote linux vm here
spring.datasource.username=test
spring.datasource.password=test
spring.jpa.generate-ddl=true
Now,when I do a maven install to generate war file,I am getting below exception:
2017-04-25 04:49:36.588 INFO 9184 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2017-04-25 04:49:38.084 ERROR 9184 --- [ main] o.a.tomcat.jdbc.pool.ConnectionPool : Unable to create initial connections of pool.
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.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:262) ~[postgresql-9.4.1212.jre7.jar:9.4.1212.jre7]
Probably,its trying to connect to my localhst for getting postgres sql db details,but I want this to connect to remote linux vm,need pointers on this.