2.我这样配置仅仅是配置了本地的Datasource,在JBoss以外的进程根本lookup不到它,我要
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~什么叫jboss以外的进程?
如何才能配置一个可以让Application looup到的数据源

解决方案 »

  1.   

    to rui_costa10:什么叫做jboss以外的进程!!!!!虽然我不是很了解,但我要告诉你:不会答就别捣乱,本来心情就不好。jboss用同一个进程的JVM来运行Web容器和EJB容器。如果按上面配置DataSource的话,会造成
    只有在同一进程的Web容器和EJB容器可以lookup到这个DataSource,如果我写一个控制台程序(也成为Application),就无法lookup到我配置的数据源。知道了不rui_costa10~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    看见你就烦躁
      

  2.   

    mysql里面是这样的,不知道oracle里可以这样用不
    <data-sources>
       <data-source key="org.apache.struts.action.DATA_SOURCE">
    <set-property property="autoCommit" value="false"/>
    <set-property property="driverClass" value="com.mysql.jdbc.Driver"/>
    <set-property property="maxCount" value="4"/>
    <set-property property="url" value="jdbc:mysql://localhost:3306/chatroom"/>
    <set-property property="user" value=""/>
    <set-property property="password" value=""/>
       </data-source>
      

  3.   

    好像不行,这个是Weblogic里面的配置方法啊
      

  4.   

    \server\default\deploy\有个mysql-ds(我的是关于mysql的,你可以改为oracle)<?xml version="1.0" encoding="UTF-8"?><!-- $Id: mysql-ds.xml,v 1.1.2.1 2003/12/12 19:19:56 starksm Exp $ -->
    <!--  Datasource config for MySQL using 3.0.9 available from:
    http://www.mysql.com/downloads/api-jdbc-stable.html
    --><datasources>  <local-tx-datasource>
        <jndi-name>xxx</jndi-name>
        <connection-url>jdbc:mysql://localhost:3306/xxx</connection-url>
        <driver-class>com.mysql.jdbc.Driver</driver-class>
        <user-name>root</user-name>
        <password></password>
      </local-tx-datasource></datasources>
      

  5.   

    </local-tx-datasource> 
        <local-tx-datasource>
        <jndi-name>MyTestTable</jndi-name>
        <connection-url>jdbc:mysql://192.168.0.10:3306/test?useUnicode=true&amp;characterEncoding=GBK</connection-url>
        <driver-class>org.gjt.mm.mysql.Driver</driver-class>
        <user-name>root</user-name>
        <password></password>
        <min-pool-size>5</min-pool-size>
      </local-tx-datasource>
      

  6.   

    到官方网站看一下的
    www.jboss.org
    jndi-name: The JNDI name under which the DataSource wrapper will be bound. Note that this name is relative to the "java:/" prefix. The full JNDI name of the DataSource will be "java:/" + jndi-name. DataSource wrappers are bound under the "java:/" prefix since they are not usable outside of the server VM. 
    application-managed-security: Specifying this element indicates that application code supplied parameters, such as from getConnection(user, pw), are used to distinguish connections in the pool. 
    security-domain: Specifying this element indicates that either application code supplied parameters, or JAAS Subject based information is to distinguish connections in the pool. The content of the security-domain is the name of the JAAS security manager that will handle authentication. This name correlates to the JAAS login-config.xml descriptor application-policy/name attribute. 
    min-pool-size: This element specifies the minimum number of connections a pool should hold. These pool instances are not created until an initial request for a connection is made. This default to 0. 
    max-pool-size: This element specifies the maximum number of connections for a pool. No more than the max-pool-size number of connections will be created in a pool. This defaults to 20. 
    blocking-timeout-millis: This element specifies the maximum time in milliseconds to block while waiting for a connection before throwing an exception. Note that this blocks only while waiting for a permit for a connection, and will never throw an exception if creating a new connection takes an inordinately long time. The default is 5000. 
    idle-timeout-minutes: This element specifies the maximum time in minutes a connection may be idle before being closed. The actual maximum time depends also on the IdleRemover scan time, which is 1/2 the smallest idle-timeout-minutes of any pool. 
    depends: The depends element specifies the JMX ObjectName string of a service that the connection manager services depend on. The connection manager service will not be started until the dependent services have been started. 
    Additional common child elements for both no-tx-datasource and local-tx