簡體   English   中英

在JBoss 7中添加池化連接數據源

[英]Adding pooled connection datasource in JBoss 7

我正在從Glassfish更改為Jboss7。我已經在Glassfish服務器中配置了一個數據源,該數據源在服務器池中,但是沒有XA。 我正在嘗試此操作,但是每次我打開admin web gui時,驅動程序元素都會被截斷為<driver name="postgresql" .. /> 由於我無法登錄到應用程序,因此一定有問題。 如何配置在JBoss 7上池化的數據源?

            <drivers>
                <driver name="postgresql" module="org.postgresql">
                    <datasource-class>org.postgresql.ds.PGConnectionPoolDataSource</datasource-class>
                </driver>
            </drivers>

這是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>

在您的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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM