Connecting to a 12c database instance with MapViewer 11.1.1.7.x

Ref:h t t p s : / / b l o g s .oracle.com/oracle_maps_blog/entry/connecting_to_a_12c_database

Connecting to a 12c database instance with MapViewer 11.1.1.7.x

The the jdbc connection string (or jdbc url) for a 12c database now requires a service name instead of a SID.
In MapViewer 11.1.1.7.1 the jdbc info in the map_data_source element in the mapviewer configuration file accepts a service name but requires a different syntax. The relevant details (from the README) are
MapViewer native (non-container) data sources can now use database service name in place of SID. 
To supply a db service name, you will use the same jdbc_sid attribute, but specify the service name 
with double slashes in front, e.g.:

  <map_data_source name="myds"
    jdbc_host="foo.com" 
    jdbc_sid="//mypdb1.foo.com" 
    jdbc_port="1522" 
    ... ...
  />
If you're using 11.1.1.7.0 then you need to use a container data source to connect to a 12c instance.
i.e. instead of using
<map_data_source name="my_12c_test"
                   jdbc_host="mydbinstance"
                   jdbc_sid="//pdborcl12c.foo.com"
                   jdbc_port="1522"
                   jdbc_user="mytestuser"
                   jdbc_password="m2E7T48U3LfRjKwR0YFETQcjNb4gCMLG8/X0KWjO00Q="
                   jdbc_mode="thin"
                   number_of_mappers="6"
                   allow_jdbc_theme_based_foi="false"
                   editable="false"
   />
use
  <map_data_source name="my_12c_test"
                   container_ds="jdbc/db12c"
                   number_of_mappers="6"
                   allow_jdbc_theme_based_foi="false"
                   editable="false"
   />
In my case the Glassfish 3.1.2.2 JDBC connection pool definition was:
Property
url  jdbc:oracle:thin:@mydbinstance:1522/pdborcl12c.rest_of.service.name
Uncheck the Wrap JDBC Objects option in Advanced panel, i.e. the Edit JDBC Connection Pool Advanced properties page.
Add a JDBC resource for that newly created pool and use that in mapviewerconfig.xml as above

-------------------------------------
  <map_data_source name="mvdemo"
                   jdbc_host="127.0.0.1"
                   jdbc_sid="orcl"
                   jdbc_port="1521"
                   jdbc_user="mvdemo"
                   jdbc_password="/4c7cN3xPhUsQvBOkIU6sXFvCBd8IqNw"
                   jdbc_mode="thin"
                   number_of_mappers="3"
                   allow_jdbc_theme_based_foi="true"
                   editable="true"
   />
<map_data_source name="mvdemo12"
           jdbc_host="127.0.0.1"
           jdbc_sid="//pdborcl"
           jdbc_port="1522"
           jdbc_user="mvdemo"
           jdbc_password="s+KWSReMfR4N04s5PkAEXw93eqxWGC7v"
           jdbc_mode="thin"
           number_of_mappers="3"
           allow_jdbc_theme_based_foi="true"
           editable="true"
   />

评论

此博客中的热门博文

XML, XSL, HTML

Input in element.eleme.io

Data URI是由RFC 2397 ACE