Connecting Tech Pros Worldwide Help | Site Map

Sending data to a Java Applet

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 04:18 AM
James
Guest
 
Posts: n/a
Default Sending data to a Java Applet

I am trying to set up a PHP file that receives data from an applet via
Java's URL object (this sends a URL so I can place PHP attributes in this),
gets a set of numbers from a database table and sends them back to the
applet.

The part I am unsure of is how to send data back to applet. The applet will
be able to read information back in but I can't find any information on how
to send information out from a PHP file. Obviously there is 'echo' but I am
not sure if it can be used in this situation.

Here is an example of the DB table to clarify the type of data being output
by the PHP script:

Table data:

name data(of type number)
donnie 3
donnie 1
frank 2
donnie 4

and I will simply extract data with an SQL statement such as SELECT * FROM
data where name = 'donnie';

Any help or advice or topics I should be researching would be great.



  #2  
Old July 17th, 2005, 04:19 AM
Andy Hassall
Guest
 
Posts: n/a
Default Re: Sending data to a Java Applet

On Fri, 19 Mar 2004 13:17:32 +0000 (UTC), "James" <nospamheredude@yahoo.com>
wrote:
[color=blue]
>I am trying to set up a PHP file that receives data from an applet via
>Java's URL object (this sends a URL so I can place PHP attributes in this),
>gets a set of numbers from a database table and sends them back to the
>applet.
>
>The part I am unsure of is how to send data back to applet. The applet will
>be able to read information back in but I can't find any information on how
>to send information out from a PHP file. Obviously there is 'echo' but I am
>not sure if it can be used in this situation.[/color]

I think that's exactly what you want, if I'm understanding your requirements.
[color=blue]
>Here is an example of the DB table to clarify the type of data being output
>by the PHP script:
>
>Table data:
>
>name data(of type number)
>donnie 3
>donnie 1
>frank 2
>donnie 4
>
>and I will simply extract data with an SQL statement such as SELECT * FROM
>data where name = 'donnie';[/color]

Just echo out the information from PHP in whatever format the Java applet
wants. Then in Java use java.net.URL.openStream to get an InputStream, and read
and parse the data.

--
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.