File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes Configure to MS SQL Server 6.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Configure to MS SQL Server 6.5" Watch "Configure to MS SQL Server 6.5" New topic
Author

Configure to MS SQL Server 6.5

Rick Feenstr
Greenhorn

Joined: Jul 11, 2003
Posts: 6
I'm new to JBoss, and attempting to connect it to our MS SQL Server 6.5 database. I'm following the great examples from the O'Reilly JBoss Workbook, appendix A (simple example).
JBoss: jboss-3.2.1_tomcat-4.1.24
OS: Win2K
JDBC Driver: JSQLConnect 2_26
I modified the titandb-ds.xml file, using the examples\jca mssql-ds.xml example, as below, and deployed to the deploy directory:
<datasources>
<local-tx-datasource>
<jndi-name>MSSQLDS</jndi-name>
<connection-url>jdbc:microsoft:sqlserver://QA_DATABASE:1433;DatabaseName=qa_customers</connection-url>
<driver-class>com.jnetdirect.jsql.JSQLDriver</driver-class>
<user-name>uname</user-name>
<password>pw</password>
</local-tx-datasource>
</datasources>

And finally, my jbosscmp-jdbc.xml stuff (I don't know what to put for the datasource-mapping tag, thus the -???- here):
<jbosscmp-jdbc>
<defaults>
<datasource>java:/MSSQLDS</datasource>
<datasource-mapping> -???- </datasource-mapping>
<create-table>false</create-table>
<remove-table>false</remove-table>
</defaults>
<enterprise-beans>
<entity>
(snip)
</entity>
</enterprise-beans>
</jbosscmp-jdbc>
I have copied the JDBC driver jar (JSQLConnect.jar) into jboss\server\default\lib directory. And this jar file is in my classpath too.
Other than the table definition and the JDBC driver, everything else is as in the O'Reilly Appendix A example. The -ds.xml file has also been copied to the deploy directory.
When deploying my application jar, JBoss throws the following exception:
[ObjectName: jboss.j2ee:jndiName=StatesHomeRemote,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc
.xml : datasource-mapping -???- not found]
Of course, -???- is just for this post. I've tried several different values (MSSQL, MS SQLServer, etc.), to no avail. The O'Reilly example just puts "Oracle8" there, without explaining why (simple example).
I'm sure I'm missing some step, some linking XML file between JBoss and my JDBC driver, or something. I just don't know what, yet.
Thanks in advance,
Rick
Rick Feenstr
Greenhorn

Joined: Jul 11, 2003
Posts: 6
Got it working, see http://www.coderanch.com/t/88393/JBoss/jbosscmp-jdbc-xml-datasource-mapping
 
 
subject: Configure to MS SQL Server 6.5