To connect to DB using JNDI you have to perform the following steps:
- Log onto PaaS dashboard
- Create an environment
- Add database node into your environment
- Modify some configuration files in a web-app
- Create a connection in a java-class
Let’s do it step-by-step:
1. Create environment with database (MySQL in our case):

2. Create a new user in a database:
|
|
How to create new user – click here.
3. Modify configuration files in your web-application:
- context.xml
|
|
- web.xml
|
|
4. Create connection in java-class:
|
|