Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There will be scenarios where you need to fetch data from external data sources (schemas) other than the implementation schema. In such scenarios, perform the following:

  1. Create a configuration file (XML) for the external schema and define the data source for it.

    Note

    While defining the data source in the configuration file for the external schema, use the following naming convention - <external schema name>_DS, e.g. EXTDB_DS.

    For example, the following sample shows a sample configuration file (ExtDBConfig.xml) for the external schema:

    Code Block
    languagexml
    titleExtDBConfig.xml
    <?xml version="1.0" encoding="UTF-8" ?>
    
    <!DOCTYPE sqlMapConfig      
        PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"      
        "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
        
    <sqlMapConfig>
    	<properties resource="databaseconfig.properties" />
    	<transactionManager type="EXTERNAL">
    		<property name="SetAutoCommitAllowed" value="false"/>
    		<dataSource type="JNDI">
    			<property name="DataSource" value="${EXTDB_DS}"/> <!-- EXTDB_DS is the data source for the external schema. -->
    		</dataSource>
    	</transactionManager>
    	
    	<sqlMap resource="com/intellectdesign/canvas/database/ibatis/${CT_FW_DATABASE_VENDOR}/maps/viewdefn/Default_Function_SqlMap.xml" />
    	<sqlMap resource="com/intellectdesign/canvas/database/ibatis/common/maps/viewdefn/Default_SqlMap.xml" />
    	<sqlMap resource="com/intellectdesign/modelhousesigma/database/ibatis/${CT_FW_DATABASE_VENDOR}/maps/Payments.xml" />
    		
    </sqlMapConfig>


    Info

    In the individual SQL Map files (XML), the select ID must be in the format VIEW_MGR_FRMWK_MNT_SELECT_<SQL_ID>, where the SQL_ID must be specified as the value for the SQL Param Map ID in the App Designer configuration.


  2. Update the databaseconfigSigmadatabaseconfig.properties file to specify the configuration for the external schema. The data source name and the JNDI for the new data source should be configured in the databaseconfig Sigmadatabaseconfig file and the same data source name has to be used in the database configuration XML. ReferĀ Configuration Descriptor: Database for more information on databaseconfigSigmadatabaseconfig.properties.

    The following code snippet shows a sample configuration:

    Code Block
    languagebash
    # Specify the external schema in CT_IBATIS_DATASOURCE_KEYS.
    CT_IBATIS_DATASOURCE_KEYS = CT_MODEL_HOUSESIGMA,EXTDB # EXTDB is a sample external data source key 
    
    # Specify the data source to be used for the external schema (as specified in the configuration XML file).
    EXTDB_DS = java:comp/env/jdbc/EXTDB
    
    # Specify the configuration file for the external schema in the following key format - <DATA_SOURCE_KEY>_<DSXML>:
    EXTDB_DSXML = com/intellectdesign/modelhousesigma/database/ibatis/config/ExtDBConfig.xml