Data Source Configuration file for m-Power Templates
The Data Source Configuration option allows developers to control how their run-time applications connect to the back-end 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 its sister file, the Servlet Properties file. More information about the Servlet Properties file can be found here.
This file can be accessed via the "Admin Menu". Next, click “Edit Dictionary Files”. From here, select “Data Source Configuration”.
The next window allows you to setup all the properties to connect to the database. For the purposes of this document, we will cover the AS400 Remote Database connection.
The configuration window will look like this:
The values that are important to note are as follows:
On the Data Source column, 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 URL row, there is the following text: jdbc:as400//xxx.xxx.x.xxx;libraries=;translate binary=true;prompt=false
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 in order 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, there are a Username and Password rows, 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: mrc strongly recommends setting your database username and password to never expire, as an expired password can cause problems when attempting to access the interface.
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 connection by clicking the “Copy” button, and give the newly copied connection a unique id (i.e. AS400_remote2). 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: \m-power\mrcjava\WEB-INF\classes\mrc-spring-context.xml