This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Swing connection to database using EJB deployed on JBOSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Swing connection to database using EJB deployed on JBOSS" Watch "Swing connection to database using EJB deployed on JBOSS" New topic

Swing connection to database using EJB deployed on JBOSS

Sharad Rangaswamy

Joined: Nov 03, 2004
Posts: 1

My question though it pertains to a Swing issue is actually JBoss related and hence am posting it here

Brief Problem Statement: Web portion of an application connects to database A while Swing portion connects to database B.
How to make Swing portion connect to database A?

Technologies Used : JBoss, Eclipse, SQLServer 2000, Java Swing

I have an application that has a web component and a Swing component. To be clearer I will quickly run through a typical way to access the Swing part of the application

1. Access the web URL
2. Logon
3. Click a link called 'Business Order Application'.

That link opens up a logon dialog box (Swing based) which authenticates the user against the SAME database that step 1 above does.

Now, for testing a new enhancement to the system, I made the web part of the application point to a 'test' DB by modifying the mssql-ds.xml file in the jboss /server/default/deploy directory. Things worked fine.

But when I now access the Swing application, it is still accessing the 'prod' database. So it is obviously not taking the mssql-ds.xml change I made (although the web app does).

Question is, how to make the Swing access the 'test' DB too?

In step 3 above, a .JNLP XML file is called. That XML file points to the following JAR files


The last JAR file is my creation. I have built and rebuilt that file to solve the problem but without success. I am also pasting below the entire JNLP file

<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for SwingSet2 Demo Application MODIFIED -->
<title>Order Management Application</title>
<vendor>APA, Inc.</vendor>
<homepage href="../index.jsp"/>
<description>Order Management Application</description>
<description kind="short">A webstart application to administer business office orders.</description>

<all-permissions />

<j2se version="1.4" />
<jar href="orderApp.jar" />
<jar href="lib/PathologyEjb-client.jar" />
<jar href="lib/jaas.jar" />
<jar href="lib/jboss-client.jar" />
<jar href="lib/jboss-common-client.jar"/>
<jar href="lib/jboss-iiop-client"/>
<jar href="lib/jboss-j2ee.jar"/>
<jar href="lib/jboss-net-client.jar"/>
<jar href="lib/jboss-system-client.jar"/>

<jar href="lib/jbossall-client.jar"/>
<jar href="lib/log4j.jar"/>
<jar href="lib/batik.jar"/>
<jar href="lib/fop.jar"/>
<jar href="lib/avalon-framework-cvs-20020806.jar"/>
<jar href="lib/orderxslt.jar"/>

<jar href="lib/jdom.jar"/>
<jar href="lib/jnlp-servlet.jar"/>
<jar href="lib/j2ee.jar"/>

<jar href="lib/jbossha-client.jar"/>
<jar href="lib/jbossmq-client.jar"/>
<application-desc main-class="edu.uc.pathology.webstart.order.OrderMain" />


Does something need changing in the file above?. How can I make the Swing point to the 'test' DB?

If you need any further info, please let me know.

I agree. Here's the link:
subject: Swing connection to database using EJB deployed on JBOSS
It's not a secret anymore!