File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Need info about Swing and EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Need info about Swing and EJB" Watch "Need info about Swing and EJB" New topic
Author

Need info about Swing and EJB

ghazanfar khan
Ranch Hand

Joined: Apr 18, 2005
Posts: 81
Hello everyone
I am new to swing component, i ve some question to ask.
I am developing and a reporting tool for some compnay but they want to be done by using java swing, but the company have some office in other countries. My question is that how can java swing application communicate with the database in usa, because it is not the web application.

Can i use EJB architecture is that use full for secure transaction and it is compatible with swing.

I heard about java start web but dont know about much ....

thanks
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
Hello,

Java webstart has nothing to do with the communication that you are going to need between client and server. Webstart is an application distribution mechanism. Using Java Webstart you can put your application on a webserver and it will be downloaded when a user requests it.

Swing and EJB can work together perfectly. There is a problem however. EJB uses RMI and RMI uses different TCP/IP ports to communicate between client and server. EJB/RMI will be blocked by firewalls. It is OK for an Intranet application but not for an internet application.

You can use webservices (eg. Apache Axis) to communicate between your Swing application and your server. This can be done using HTTPS (so it's secure).
Scott Delap
author
Ranch Hand

Joined: Apr 05, 2005
Posts: 73
You might look at some of the HTTP remoting options. Take a look at the various options that Spring provides. Once you plug those in communications is only another layer in your client server app. You can worry about the Swing client and the EJB server components without concering yourself with how objects are moved from point A to B. The only thing that you do have to think about however is that your objects are detached from your server side session. This means you have to worry about keeping various client sessions in synch.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
If you just want to securely connect to a remote database, using EJBs would be way overkill.

In fact, you can already connect a remote DB using plain JDBC. Now you only need to take care that it happens over a secured route - voila!

For details, you should probably start a new thread in the JDBC forum.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
ghazanfar khan
Ranch Hand

Joined: Apr 18, 2005
Posts: 81
thanks for replies, but i m getting confuse wht should i do now b/c it is my first job. Some of dont recommend me eJB, some recommend web service and simple jdbc.
Any good suggestion please and thanks for promt answer. You guys are much experienced than me
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
The general advice would be to start with the simplest solution and see if you can possibly get it to work. In my not so humble opinion, that would be JDBC. Both webservices and EJBs just add complexity on top of that you probably don't need.
ghazanfar khan
Ranch Hand

Joined: Apr 18, 2005
Posts: 81
thanks
 
jQuery in Action, 2nd edition
 
subject: Need info about Swing and EJB
 
Similar Threads
Need Info. JSwing and EJB
Need Info can use swing and ejb
JSP or Swings
J22E definition
what I can do with junit ??