Can anyone point to tutorial where i can see step by step connecting to RDS from Java. I already downloaded SDK and was able to connect to S3. But the SDK doesnt have any example of connecting to RDS .. And also on web couldnt find anything useful...
3 Answers
got it , its simple connecting to any other jdbc with . The problem i had was that my ip address didnt have permission to access the DB. Which i resolved by putting the ip address in AWS console

- 7,925
- 23
- 70
- 97
-
1I'm also having the same problem but haven't figured out yet. Can you post some more explanation of how you came up with the solution? – Nipuna Jun 27 '11 at 15:33
-
@Nipuna check the security group of the rds instance – committedandroider Jun 04 '19 at 00:20
This AWS tutorial uses RDS to store application data and also shows you the other requirements such as setting Inbound Rules.

- 9,637
- 4
- 24
- 38
I mainly followed this guide, ignoring the .sql files, thymeleaf UI, "model.addAttribute("cities", cities);" part, and the html file: https://zetcode.com/springboot/postgresql/
My application.properties file looks like this
postgres.comment.aa=https://zetcode.com/springboot/postgresql/
spring.main.banner-mode=off
logging.level.org.springframework=ERROR
spring.jpa.hibernate.ddl-auto=none
spring.datasource.initialization-mode=always
spring.datasource.platform=postgres
spring.datasource.url=jdbc:postgresql://your-rds-url-here.us-east-1.rds.amazonaws.com:yourDbPortHere/postgres
spring.datasource.username=postgres
spring.datasource.password=<your db password here>
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
If you have custom schemas, you can append "?currentSchema=users" to the url:
spring.datasource.url=jdbc:postgresql://your-rds-url-here.us-east-1.rds.amazonaws.com:yourDbPortHere/postgres?currentSchema=users
Thanks to this SO answer for the schema: Is it possible to specify the schema when connecting to postgres with JDBC?
These other couple links also helped https://turreta.com/2015/03/01/how-to-specify-a-default-schema-when-connecting-to-postgresql-using-jdbc/
https://doc.cuba-platform.com/manual-latest/db_schema_connection.html

- 229
- 4
- 12