aspose file tools*
The moose likes JNLP and Web Start and the fly likes Can we say it a distribuited application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Can we say it a distribuited application" Watch "Can we say it a distribuited application" New topic
Author

Can we say it a distribuited application

Babar Qadri
Ranch Hand

Joined: Oct 12, 2004
Posts: 51
New to JWS (Java Web Start).

Consider a desktop swing application that is accessing a DB on the same machine.

1- Now can we distribute it via JWS?

2- Can it able to access the DB from some other machine (via any JDBC Driver written in pure java)?

3- Can we say it a distributed application after making it accessable via JWS?

4- And what if the Database is on some other machine and that machine is a part of network but doesn't have a live IP. Can we access that DB from the application running on some other machine(not on the same network) via JWS?

Thanks. Waiting for your helpful response.


babar
Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243
Originally posted by Babar Qadri:

1- Now can we distribute it via JWS?


Yes. You can use webstart to distribute your .jar file that contains your application.


2- Can it able to access the DB from some other machine (via any JDBC Driver written in pure java)?


Yes. You can specify that your application needs a JDBC driver, which you can have downloaded as part of your application. Check out some tutorials on .jnlp files.


3- Can we say it a distributed application after making it accessable via JWS?


I guess, though it already sounds like it is a distributed application anyway without webstart -- client program, database server ...


4- And what if the Database is on some other machine and that machine is a part of network but doesn't have a live IP. Can we access that DB from the application running on some other machine(not on the same network) via JWS?


If you can't access this other computer anyway, then webstart won't have a chance either. But this is done everyday and is really not a problem. It is just a matter of specifying the database server that your application will need to talk to. We do this in a configuration file that gets included as a program argument in our .jnlp files. The configuration file has an entry like:



As long as the machine is accessible by the client computers, it doesn't matter if it's not registered with the DNS, or anything like that. I'm not sure if I've hit the mark with this response.

Cheers, Jared.


SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410


4- And what if the Database is on some other machine and that machine is a part of network but doesn't have a live IP. Can we access that DB from the application running on some other machine(not on the same network) via JWS?


A common approach to this problem is to create a proxy servlet that handles all the database communication. This has the advantage of not requiring special ports to be opened on your server or on the client's firewall in order for your app to work. The Servlet can either send text or serialized Java objects back to the client app.
With this approach, it is also easier to insure that sensitive data gets transmitted only over SSL.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Babar Qadri:
1- Now can we distribute it via JWS?


Yes of course. But it doesn't mean that it makes your application, a distributed application.


2- Can it able to access the DB from some other machine (via any JDBC Driver written in pure java)?


If both the client(where the app deployed using JWS) and the DB is on the same network.

If over the internet then you have to right some specific component for that, as Ben already gave the idea to use servlet. Otherwise, a seperate database is required on the client in order to run that JDBC app successfully on the client.


3- Can we say it a distributed application after making it accessable via JWS?


JWS doesn't make any difference in this regard. If your application is a distributed application then it would remain a distributed app. If your application is a desktop application then again it remains the desktop app.

If an application access a DB, which is on some other machine, doesn't make it distributed.


4- And what if the Database is on some other machine and that machine is a part of network but doesn't have a live IP. Can we access that DB from the application running on some other machine(not on the same network) via JWS?


Nothing more to say. I think I have already discussed it.
[ December 07, 2005: Message edited by: Adeel Ansari ]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
You can refer to Java Web Start Overview.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can we say it a distribuited application