当前位置:编程学习 > JAVA >>

jboss 7 配置SQL数据库例子

我搞了半天没成功。哪位给个例子。
贴上我的:
\modules\com\sql
sqljdbc4.jar
sqljdbc4.jar.index
module.xml

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.sql">
  <resources>
    <resource-root path="sqljdbc4.jar"/>
        <!-- Insert resources here -->
  </resources>
  <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
  </dependencies>
</module>
<datasource jndi-name="java:jboss/datasources/ot" pool-name="sql2000" enabled="true" jta="true" use-java-context="true" use-ccm="true">
                    <connection-url>
                        jdbc:sqlserver://xxxxxxx:1433;DatabaseName=newot
                    </connection-url>
                    <driver>
                        com.sql
                    </driver>
                    <pool>
                        <prefill>
                            false
                        </prefill>
                        <use-strict-min>
                            false
                        </use-strict-min>
                        <flush-strategy>
                            FailingConnectionOnly
                        </flush-strategy>
                    </pool>
                    <security>
                        <user-name>
                           xxxxx
                        </user-name>
                        <password>
                           xxxxx
                        </password>
                    </security>
                    <validation>
                        <validate-on-match>
                            false
                        </validate-on-match>
                        <background-validation>
                            false
                        </background-validation>
                        <useFastFail>
                            false
                        </useFastFail>
                    </validation>
                </datasource>
                <drivers>
                    <driver name="com.sql" module="com.sql">
                        <driver-class>
                            com.microsoft.jdbc.sqlserver.SQLServerDriver
                        </driver-class>
                    </driver>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>
                            org.h2.jdbcx.JdbcDataSource
                        </xa-datasource-class>
                    </driver>
                    <driver name="com.mysql" module="com.mysql">
                        <driver-class>
                            com.mysql.jdbc.Driver
                        </driver-class>
                    </driver>
                </drivers>
补充:Java ,  Java EE
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,