This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need info about Swing and EJB

 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic