[英]Adding pooled connection datasource in JBoss 7
I am changing from Glassfish to Jboss 7. I have configured a datasource in the Glassfish server which is pooled at the server, but not XA. 我正在从Glassfish更改为Jboss7。我已经在Glassfish服务器中配置了一个数据源,该数据源在服务器池中,但是没有XA。 I am trying this, but each time I open admin web gui the driver element is truncated to <driver name="postgresql" .. />
. 我正在尝试此操作,但是每次我打开admin web gui时,驱动程序元素都会被截断为<driver name="postgresql" .. />
。 Something must be wrong since I can't log on to my application. 由于我无法登录到应用程序,因此一定有问题。 How can I configure a datasource which is pooled on JBoss 7? 如何配置在JBoss 7上池化的数据源?
<drivers>
<driver name="postgresql" module="org.postgresql">
<datasource-class>org.postgresql.ds.PGConnectionPoolDataSource</datasource-class>
</driver>
</drivers>
This is the module.xml: 这是module.xml:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.postgresql">
<resources>
<resource-root path="postgresql-9.2-1002.jdbc4.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
In you domain.xml/standalone.xml you can specify your datasource: 在您的domain.xml / standalone.xml中,您可以指定数据源:
<subsystem xmlns="urn:jboss:domain:datasources:1.1">
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.