Adding a Data Source Administrative

7-2 Oracle Fusion Middleware Users Guide for Oracle MapViewer

7.1.1 Adding a Data Source Administrative

The add_data_source element has the following definition: ELEMENT non_map_request add_data_source ELEMENT add_data_source EMPTY ATTLIST add_data_source name CDATA REQUIRED container_ds CDATA IMPLIED jdbc_tns_name CDATA IMPLIED jdbc_host CDATA IMPLIED jdbc_port CDATA IMPLIED jdbc_sid CDATA IMPLIED jdbc_user CDATA IMPLIED jdbc_password CDATA IMPLIED jdbc_mode oci8 | thin IMPLIED number_of_mappers INTEGER REQUIRED The name attribute identifies the data source name. The name must be unique among MapViewer data sources. Data source names are not case-sensitive. You must specify a container data source name, a net service name TNS name, or all necessary connection information. That is, you must specify only one of the following: ■ container_ds ■ jdbc_tns_name ■ jdbc_host, jdbc_port, jdbc_sid, jdbc_mode, jdbc_user, and jdbc_ password The container_ds attribute identifies a data source name that is defined in the J2EE containers Java Naming and Directory Interface JNDI namespace. For OC4J, it should be the ejb-location attribute of the data source defined in the data-source.xml file. The jdbc_tns_name attribute identifies a net service name that is defined in the tnsnames.ora file. The jdbc_host attribute identifies the database host system name. The jdbc_port attribute identifies the TNS listener port number. The jdbc_sid attribute identifies the SID for the database. The jdbc_user attribute identifies the user to connect to map. The jdbc_password attribute identifies the password for the user specified with the jdbc_user attribute. Note that MapViewer does not change this password string in any way; no conversion to upper or lower case is performed. If the database uses case-sensitive passwords, the specified password must exactly match the password in the database. Note: This request is typically used during development or testing, when you want to add a data source quickly and dynamically without creating a permanent one which would involve editing the mapViewerConfig.xml file. For production use, or to take full advantage of what MapViewer provides with a data source, you should always use a permanent data source. MapViewer XML Requests: Administrative and Other 7-3 The jdbc_mode attribute identifies the JDBC connection mode: thin or oci8. If you specify oci8, you must have Oracle Client installed in the middle tier in which MapViewer is running. You do not need Oracle Client if thin is used for all of your data sources. The number_of_mappers attribute identifies the number of map renderers to be created that is, the number of requests that MapViewer can process at the same time for this data source. Any unprocessed map requests are queued and eventually processed. For example, if the value is 3, MapViewer will be able to process at most three mapping requests concurrently. If a fourth map request comes while three requests are being processed, it will wait until MapViewer has finished processing one of the current requests. The maximum number of mappers for a single data source is 64. Example 7–1 adds a data source named mvdemo by specifying all necessary connection information. Example 7–1 Adding a Data Source by Specifying Detailed Connection Information ?xml version=1.0 standalone=yes? non_map_request add_data_source name=mvdemo jdbc_host=elocation.us.oracle.com jdbc_port=1521 jdbc_sid=orcl jdbc_user=scott jdbc_password=password jdbc_mode=thin number_of_mappers=5 non_map_request Example 7–2 adds a data source named mvdemo by specifying the container data source name. Example 7–2 Adding a Data Source by Specifying the Container Data Source ?xml version=1.0 standalone=yes? non_map_request add_data_source name=mvdemo container_ds=jdbcOracleDS number_of_mappers=5 non_map_request The DTD for the response to an add_data_source request has the following format: ELEMENT non_map_response add_data_source ELEMENT add_data_source EMPTY ATTLIST add_data_source succeed true | false REQUIRED comment CDATA IMPLIED The comment attribute appears only if the request did not succeed, in which case the reason is in the comment attribute. In the following example, succeed=true indicates that the user request has reached the server and been processed without any exception being raised regarding its validity. It does not indicate whether the users intended action in the request was actually fulfilled by the MapViewer server. In this example, the appearance of the comment attribute indicates that the request failed, 7-4 Oracle Fusion Middleware Users Guide for Oracle MapViewer and the string associated with the comment attribute gives the reason for the failure data source already exists. ?xml version=1.0 ? non_map_response add_data_source succeed=true comment=data source already exists non_map_response

7.1.2 Removing a Data Source Administrative