Meaningless Drivel is fun!*
The moose likes JBoss/WildFly and the fly likes setting up MS SQL Server as a data source with JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "setting up MS SQL Server as a data source with JBoss " Watch "setting up MS SQL Server as a data source with JBoss " New topic

setting up MS SQL Server as a data source with JBoss

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 573
I am having a few problems trying to set up MS SQL Server as a data source with JBoss.
I am following the instructions in the Using MS SQL Server with JBoss documentation.
As I have j2sdk1.4.0_03 installed I do not have to download a JDBC driver. What I have is the dll file C:\j2sdk1.4.0_03\jre\bin\JdbcOdbc.dll which I guess links to my jdbc drivers, so I need to add JdbcOdbc.dll to my JBOSS file which deals with JDBC drivers.
The problem is that I do not know what this file is called. According to the docs it is called jboss.jcml but that file does not exist.
I am using version jboss-3.2.0RC2_tomcat.4.1.18.
I would be grateful if anyone can tell me what the file is know called.
Thanks Tony
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 573
Further investigation has revealed the following files in the examples directory:
I guess the way forward is to copy these into the JBOSS server directory and modify them for my use.
I am not sure where they should be copied to, I guess it should be the

C:\jboss-3.2.0RC2_tomcat.4.1.18\server\default\conf directory, as this contains all the xml files that are needed at start-up.
Am I correct in this thanks for any help.
Cheers Tony
Darryl A. J. Staflund
Ranch Hand

Joined: Oct 06, 2002
Posts: 303
Hi there,
The only configuration file you'll need to work with (I believe) is mssql-ds.xml. Just modify it and place it in the deploy directory of your default server instance. For instance, if you're using 'default', place the file in '<jboss>/server/default/deploy/'.
The mssql-server.xml will work as well, though I think it's included for 3.0.x backward compatbility. As for 'xa-ds.xml' and 'xa-service.xml', I haven't used them so I can't speak about them :-)
BTW, the '-ds.xml' files are new to JBoss 3.2 so there's not a lot of documentation out on them that I have been able to scope out. That's why I speak conditionally about them.
I can tell you that I've recently switched from 'postgresql-service.xml' to 'postgresql-ds.xml' in my own code and have suffered so serious effects :-)
Darryl A. J. Staflund
Ranch Hand

Joined: Oct 06, 2002
Posts: 303
BTW, you'll also want to place the JDBC driver in the deploy directory as well. If you're working with a DDL, I think you'll have to use a JDBC-ODBC bridge to work with the database and, I have to apologize, I've never used one of these things so I can't help you configure it.
I do know that there are JDBC drivers for MSSQL 2000, however, so look around for them. I believe Microsoft has one available for download.
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 573
Hi Darryl
Thanks very much your mail was a great source of help, and has saved me a lot of time.
What I did was I modified the mssql-ds.xml , downloaded the mssqlserver.jar and put both in my
C:\jboss-3.2.0RC2_tomcat.4.1.18\server\default\deploy directory.
I still have a problem with the following warning message :
10:25:00,453 WARN [LocalTxConnectionManager] Please change your datasource setup to use TransactionManagerService with object name ManagerService
10:25:00,453 WARN [LocalTxConnectionManager] instead of TransactionManager with value java:/TransactionManager
But hopfully will be able to solve it.
Thanks again for your help.
Craig Demyanovich
Ranch Hand

Joined: Sep 25, 2000
Posts: 173
The messages about the transaction manager service can supposedly be ignored, according to posts on the jboss-user mailing list. Changes have been made for RC3 that should address this problem. In fact, RC3 became available yesterday. Download it and give it a try. Do you have any other questions about data source configuration?
Bernie Ferguson

Joined: Apr 16, 2003
Posts: 1
I recently tried the same thing using JBOSS 3.2 and Microsoft SQL Server. I originally copied only the mssqlserver.jar into the deploy directory and received a class not found error for Microsoft's JDBC base class. I went back and copied the msbase.jar and the msutil.jar to the deploy directory and everything works fine. No warnings either.
Prashant Danda

Joined: Mar 24, 2003
Posts: 7
Is it possible to perform connection pooling for this datastore in JBoss.
Any link or code sample in the databasename-ds.xml file would be helpful, the connection pool should it be specified in this file or where to implement it ?

-It is not what the computer can do, It is what YOU can do with it <img src="wink.gif" border="0">
A Oliveira

Joined: May 20, 2003
Posts: 1
Hi! I was wondering how you can set up MSSQL as the default DBMS? I tried by changing the login-config.xml file and adding a new <application-policy> element but it didn't work.
Is this even necessary?
suvasis mukherjee

Joined: Feb 22, 2003
Posts: 5
I followed the following step to get MS-SQL to work:
how to configure MS SQL server in jboss?
1. delete the hsql*-service.xml file in the C:\jboss\jboss-3.0.6_tomcat-4.1.18\server\default\deploy
2. copy the mssql-service.xml file from the C:\jboss\jboss-3.0.6_tomcat-4.1.18\docs\examples\jca directory
into C:\jboss\jboss-3.0.6_tomcat-4.1.18\server\default\deploy
3. change the C:\jboss\jboss-3.0.6_tomcat-4.1.18\server\default\config
a) standardjaws.xml
<type-mapping>MS SQLSERVER2000</type-mapping>

b) standardjbosscmp-jdbc.xml files.
<datasource-mapping>MS SQLSERVER2000</datasource-mapping>

4. in the mssql-service.xml following changes:
<attribute name="ManagedConnectionFactoryProperties">
<config-property name="ConnectionURL" type="java.lang.String">jdbc:microsoft:sqlserver://;DatabaseName=CABIN</config-property>
<config-property name="DriverClass" type="java.lang.String"></config-property>
<!--set these only if you want only default logins, not through JAAS-->
<config-property name="UserName" type="java.lang.String">mina</config-property>
<config-property name="Password" type="java.lang.String">sm4321</config-property>
and also
<depends optional-attribute-name="ManagedConnectionPool">
<!--embedded mbean-->
<mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=XaTxPool,name=MSSQLDS">

5. in the C:\jboss\jboss-3.0.6_tomcat-4.1.18\server\default\config dir
change the login-config.xml file
<application-policy name = "MSSQLDbRealm">
<login-module code = "" flag = "required">
<module-option name = "principal">sa</module-option>
<module-option name = "userName">user</module-option>
<module-option name = "password">passwd</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=XaTxCM,name=MSSQLDS</module-option>
Nguyen Quoc Nguyen

Joined: Nov 29, 2002
Posts: 2
thank alot
Don't get me started about those stupid light bulbs.
subject: setting up MS SQL Server as a data source with JBoss