Solved

Retrieving data from remote server in an applet.

Posted on 2004-09-22
5
199 Views
Last Modified: 2010-03-31
I am new to java programming, and I want to make sure I am going in the right direction before spending time on this project.


I have to upload an applet onto a server that I have no control over.
  * No way to change this

That applet needs to connect to a remote server (which I do have control over) and retrieve data from a MSSQL Server database on it.

I was thinking about putting a servlet on the db server that connects to the database and then connecting to that servlet from the applet.

Am I going in the right direction, or is there a better way to do this?

Thanks,
Dan
0
Comment
Question by:_DanElliott
  • 3
  • 2
5 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 12122324
> I have to upload an applet onto a server that I have no control over.
>   * No way to change this

What exactly do you mean here? You mean putting the applet class file onto a server that you do not have control over? Can you be more specific?

0
 
LVL 2

Author Comment

by:_DanElliott
ID: 12122469
Yes, I have to put the class file on someone else's server.  The applet will be served up to a web browser from that server.  I cannot change anything on that server (settings, security, drivers, etc.).
0
 
LVL 35

Expert Comment

by:girionis
ID: 12122597
Does this server have FTP? Do you want to do it programmatically?
0
 
LVL 2

Author Comment

by:_DanElliott
ID: 12122691
I can put the file there with no problems (there is a web interface designed specifically for that purpose).  Maybe i should have left that part out of the original question.  My concern is how to get the data from the database server.
0
 
LVL 35

Accepted Solution

by:
girionis earned 200 total points
ID: 12122903
Open a database conenction from the applet to the server. You will need to sign the applet or chaneg the java.policy file if the db server and the web server are in different computers. For more info on database stuff have a look here: http://java.sun.com/docs/books/tutorial/jdbc/
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question