Developing Apama Applications > Building Dashboards > Using SQL Data > Setting up SQL database connections > Using a database repository file
Using a database repository file
A Database Repository file may be used to populate the initial values of drop down menus in the Attach to Data dialog. See Application Options for information on how to create a Database Repository file.
It is possible to edit an existing Database Repository file, however the file name sqlrepository.xml cannot be modified. If sqlrepository.xml is not found in the specified directory or your current working directory, Apama will look in the lib directory. If the Database Repository file is not found, drop down menus will remain empty until databases are added from the Application Options dialog or typed directly into the Attach to SQL Data dialog.
To edit an existing Database Repository file, supported tags and attributes are as follows:
*sqlrepository tag, xmlns attribute: Top level tag that includes the namespace attribute xmlns, which must be defined as www.sl.com (xmlns="www.sl.com").
*db tag, name attribute: Database name
*table tag, name attribute: Table name
*col tag, Possible attribute: Column value
An example Database Repository file:
<?xml version="1.0"?>
<sqlrepository xmlns="www.sl.com" version="3.0">
        <db name="SampleDB">
               <table name="production_table">
                        <col>Plant</col>
                        <col>Units in Production</col>
                        <col>Units Completed</col>
                        <col>Status</col>
                        <col>On Schedule</col>
               </table>
               <table name="system_table">
                        <col>System</col>
                        <col>Status</col>
                        <col>%Free Space</col>
                        <col>CPU Usage</col>
                        <col>On Site</col>
               </table>
               <table name="trade_table">
                        <col>Customer</col>
                        <col>Symbol</col>
                        <col>Shares</col>
                        <col>Purchase Price</col>
                        <col>Current</col>
                        <col>High</col>
                        <col>Low</col>
               </table>
       </db>
</sqlrepository>
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.