2.我这样配置仅仅是配置了本地的Datasource,在JBoss以外的进程根本lookup不到它,我要
~~~~~~~~~~~~~~~~~~~~~~~~~~~什么叫jboss以外的进程?
如何才能配置一个可以让Application looup到的数据源
~~~~~~~~~~~~~~~~~~~~~~~~~~~什么叫jboss以外的进程?
如何才能配置一个可以让Application looup到的数据源
解决方案 »
- Struts默认的语言文件
- java中,字符串拼装完成后,消除末尾的“, ”怎么做?
- 联合主键中,某个主键的值要如何生成?
- 面试问题
- struts 2.x中 Action 之间的转发
- webservice(xfire) 怎么验证调用接口的用户的信息,需要每个接口都验证一次用户信息吗?
- XML编码后处理?
- 有几个难题。。。
- 用resin作项目要负钱吗??
- 在linux上使用mysql,出现Server configuration denies access to data source
- 讨论一下!请问大家都用什么工具开发struts
- 写了一个applet用以和另外一主机实现通讯,可是为什么老是找不到对方地址,写成application却又正常通讯,奇怪!
只有在同一进程的Web容器和EJB容器可以lookup到这个DataSource,如果我写一个控制台程序(也成为Application),就无法lookup到我配置的数据源。知道了不rui_costa10~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
看见你就烦躁
<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>
<!-- 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>
<local-tx-datasource>
<jndi-name>MyTestTable</jndi-name>
<connection-url>jdbc:mysql://192.168.0.10:3306/test?useUnicode=true&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>
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