java - Using spring-cloud-aws, when connecting to an RDS instance, where do I specify the database? -
i'm using spring-cloud-aws connect rds instance (in case mysql) on aws.
the docs specify how create connection specific rds instance (see below), don't explain how select specific database within rds instance.
<jdbc:datasource id="datasource" db-instance-identifier="myrdsinstance" username="${rdsusername}" password="${rdspassword}"> </jdbc:datasource>
they go on show how datasource can injected spring bean can instantiate jdbctemplate... dandy.
i failing see can specify/change database want run queries against?
hoping downwards lack of rds/spring cloud knowledge!
the connection database done using configured database within rds instance. can connect "default" database , configure explicit defaultcatalog mysql.
the next illustration (based on should trick
<jdbc:datasource id="datasource" db-instance-identifier="myrdsinstance" username="${rdsusername}" password="${rdspassword}"> <jdbc:pool-attributes initialsize="1" defaultcatalog="mydb" testonborrow="true" validationquery="select 1" /> </jdbc:datasource>
we provide additional back upwards explicitly configure db in rc1 or maybe rc2.
java spring amazon-web-services amazon-rds spring-cloud
No comments:
Post a Comment