How to configure a JNDI data source in WebLogic?
Configuring a JNDI datasource in WebLogic requires the following steps:
- Log in to the management console of the WebLogic server.
- Expand the “Domain Configuration” in the left navigation bar and select “JDBC”.
- Select the “Data Source” tab in the right panel.
- Click on the “Create New” button to build a new data source.
- On the data source configuration page, enter the name and JNDI name of the data source. The JNDI name is a unique identifier used in the application to retrieve the data source.
- Choose the appropriate database type and driver, then configure the database connection properties such as URL, username, and password.
- Configure pool settings, such as minimum and maximum connection numbers, idle connection timeout, etc.
- Set up advanced configurations such as the SQL statement used for testing connectivity and connection leak recovery.
- Click on the “OK” button to save the data source configuration.
- Get the data source using the JNDI name in the application and use it for database operations.
After completing the above steps, you have successfully configured a JNDI data source in WebLogic. Your application can now access the data source using the JNDI name and perform database operations with it.