Add a data source using developer tools
We can add a data source to the application using the developer tools.
- In the Project Explorer view, expand liberty_name > servers > server_name > server.xml, and select Open.
- In the design view, select Server Configuration, and click Add.
- On the Select item to add to Server Configuration: page, select Data Source and fill in the JNDI name.
- On the Data Source Details panel, alongside JDBC Driver, click Add.
- On the Configure a JDBC driver page,
- In the Library ref: field, select an option
from the drop-down list, or click Add to create a new one.
- In the Fileset ref: field, select an option from the drop-down list, or click Add to create a new one.
- In the Base directory field, type a path for your base directory or click Browse to locate a library location path. Use the drop-down arrow next to Browse to choose between browsing for a relative path or browsing for an absolute path.
- In the Includes field, type the name of the data source, for example derby.jar, or click Browse to locate the data source archive file we want to include.
- In the Excludes field, type the archives we want to exclude, or click Browse to locate the data source archive file we want to exclude.
- In the Fileset ref: field, select an option from the drop-down list, or click Add to create a new one.
- In the Library ref: field, select an option
from the drop-down list, or click Add to create a new one.
- Your JDBC data source has been added to the application.