• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Need info about Swing and EJB

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
author
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks
 
This is my favorite tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic