m-Power Documentation
![]() |
![]() |
Understanding the Data Source Configuration file for Web 2.0 Templates
The Data Source Configuration File (also known as the mrc-spring-context.xml file) is instrumental in controlling how your run-time applications connect to the correct database. This file is a global file, meaning that it is applicable across every data dictionary on the system. This file works in conjunction with it's sister file, the Servlet Properties file. More information about the Servlet Properties file can be found here .
This file can be accessed from the Admin tab. Then click on “Edit Data Dictionary Files.” From here, look for the Web 2.0 section, and select “Data Source Configuration”

This file is written in .xml (eXtensible Markup Language), and is broken up into different sections, depending on what Database you wish to connect to at runtime. For the purposes of this document, we will cover the AS400 Remote Database connection.
Our section might look something like this:

The values that are important to note are as follows:
On the 3 rd line, there is an id. It is set to “as400_remote1” This specifically ties to a value in the “Others” tab within the Servlet Properties file. This serves as the unique identifier for this section
On the 5 th line of text, there is the following text “jdbc:as400//72.16.169.180;libraries=CBB2E, CBB2B, MRCAPPLLIB
The IP address tells the connection where to physically find the database.
The “libraries” section specifies a library list . This library list is useful for one of two reasons.
1. If calling an RPG external object, and tables you are chaining to outside of your current RPG library must be referenced here.
2. If you wish to not include the schema name that the application was developed with, at runtime the servlet will attempt to use the schemas off this list to find the appropriate tables.
In either case, similar to an AS400 Library List, the servlet will attempt to work left to right, in order, to find a valid table.
Lastly, the 7 th and 8 th line of text contain a Username and Password, respectively. You must enter a valid username and password so that the Java Database Connection can properly authenticate against your system. Without these valid values, your applications will not run correctly as your database will not allow unauthorized access.
Note : Since this file is global, this will serve as a master connection list. It is possible to connect to multiple databases at runtime, so long as the proper information has been filled out within this file.
Note: If you wish to connect to two or more of the same type of database connection (i.e. Two remote AS400 DBs), simply copy the above section within your own code, and give the newly copied section a unique id. That way you can reference this ID within the Servlet Properties file.
Note: This file can be found in this location on your system's drive: \mrcjava\WEB-INF\classes\mrc-spring-context.xml
































































































