Solved

Retrieving data from remote server in an applet.

Posted on 2004-09-22
5
200 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Apps blocked by Java 9 88
diffSum example 4 50
hashmap order 17 37
What browser will run Java? 7 55
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

856 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