简体   繁体   中英

Need help creating SQL Server datasource for JBoss EAP 6.1.0

I am working on a web service application on JBoss EAP 6.1.0, which requires a datasource for SQL Server 2008 to be created. I have downloaded and extracted the sqljdbc jar file, but am not sure where it goes on the application server. I tried referencing the EAP 6.1 configuration guide and a couple of other websites, but that did not help. I would be very grateful if someone could guide me with the steps to register the datasource on the application server.

It goes into your modules folder. You have have something like the following:

<JBOSS_HOME>\modules\com\microsoft\sqlserver\main

Your sqljdbc would be inside the folder structure above. You would also need to create a module.xml file in the same folder similar to:

<module xmlns="urn:jboss:module:1.1" name="com.microsoft.sqlserver">
 <resources>
    <resource-root path="sqljdbc4.jar"/>
 </resources>
 <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
 </dependencies>
</module>

Then finally in your standalone.xml, the datasources section should have a drivers definition that references your module as such:

<drivers>
  <driver name="sqlserver" module="com.microsoft.sqlserver">
    <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
  </driver>
</drivers>

Hope that helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM