Oracle9iAS Containers for J2EE独立版指南--(OC4J数据源配置、调用 与 RMI)

类别:Java 点击:0 评论:0 推荐:

 OC4J配置的数据源,如果被OC4J自己内部运行的程序调用没有问题
如:oc4j903\j2ee\home\config\data-sources.xml中

在</data-sources>到</data-sources>之间添加
<data-source class="com.evermind.sql.ConnectionDataSource" location="jdbc/PortalDB"
           password="assgis"
           username="portal"
           url="jdbc:oracle:thin:@172.18.2.6:1521:apps"
           inactivity-timeout="30"
           max-connections="50"
           max-connect-attempts="2"
           min-connections="4"
           connection-driver="oracle.jdbc.driver.OracleDriver"
           schema="PortalDB"
           name="PortalDB"/>
则在程序中调用:
 DataSource dataSource = (DataSource) context.lookup("jdbc/PortalDB");
没有问题;

如果是RMI远程调用,会出现如下错误:
 'javax.naming.NamingException: Not in an application scope - start Orion with
the -userThreads switch if using user-created threads'

本文地址:http://com.8s8s.com/it/it11100.htm