The user-provided service is the right choice to make any existing on-premises database, DB2 in your case, available for a Cloud Foundry app on Bluemix Local (actually any Cloud Foundry instance).
- Log in to Bluemix/Cloud Foundry
- Create the user-provided service
- Bind the service to an app
You can also update the properties of an user-provided service.
To specify properties during creation use:
cf cups db2-testdb -p '{"jdbcURL" : "jdbc:db2://yourMachine.com:50000/TESTDB"}'
To later on change properties (update-user-provided-service):
cf uups db2-testdb -p '{"jdbcURL" : "jdbc:db2://yourMachine2.com:40000/TESTDB02"}'
To bind the service to an app use either the GUI or the following command:
cf bind-service yourAppName db2-testdb
Your app would then be able to find the service via the VCAP_SERVICES
variable and read out the value for jdbcURL
. See this blog entry for details.