It's not a secret anymore!
The moose likes JBoss/WildFly and the fly likes MSSQL Database configuration with JBOSS-3.0.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "MSSQL Database configuration with JBOSS-3.0.4" Watch "MSSQL Database configuration with JBOSS-3.0.4" New topic

MSSQL Database configuration with JBOSS-3.0.4

ketan modi

Joined: Aug 13, 2003
Posts: 2
I am new to EJB and JBOSS.
I am getting problem in configuration in MSSQL Database with JBOSS-3.0.4.I have to use it for BMP Bean.
I have done following steps for configuration.
1. delete the hsql*-service.xml file in the C:\jboss\jboss-3.0.4\server\default\deploy directory.

2. copy the mssql-service.xml file from the C:\jboss\jboss-3.0.4\docs\examples\jca directory
into C:\jboss\jboss-3.0.4\server\default\deploy

3. change the C:\jboss\jboss-3.0.4\server\default\config
a) standardjaws.xml


<type-mapping>MS SQLSERVER2000</type-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">sa</config-property>
<config-property name="Password" type="java.lang.String"></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.4\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">sa</module-option>
<module-option name = "password"></module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=XaTxCM,name=MSSQLDS</module-option>

and my jboss.xml is

<?xml version="1.0" encoding="UTF-8"?>

and ejb-jar.xml file is
<?xml version="1.0" encoding="UTF-8"?>
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"

and in entity bean i have used following code to access database.
DataSource dataSource = (DataSource)initial.lookup("java:comp/env/jdbc/MSSQLDS");
but after that when i am deploying application it gives warning that : No resouce Manager found for java:/MSSQLDS and when i am
runing my application it gives me jdbc not bound error.
pls help me asap.
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Moving to the JBoss Forum...
ketan modi

Joined: Aug 13, 2003
Posts: 2
At last i have solve my problem.
i have changed code in jboss.xml as below.
and now it is working ok.
I agree. Here's the link:
subject: MSSQL Database configuration with JBOSS-3.0.4
It's not a secret anymore!