Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Location
    Streetsboro, Oh
    Posts
    2

    Unanswered: connect to mysql via applet on remote server

    If I have missed posts on this, apologies in advance. I've spent the last 3 weeks googling and posting to find a solution.

    I'm running a java applet which needs to connect to mysql on a remote server. I have read some posts that suggest using PHP to act as a proxy. The applet then contacts the proxy. Has anyone done this? Can you offer code snippets that demonstrate this. This seemed like a workable solution until it's time to run the JDBC DriverManager getConnection method: getConnection( url ). It does not like to see anything other than hostname/database?user= .... Attempts to use the php script in there result in Exceptions.

    Any other concrete solutions (aside from signing the applet)?

    I've got a lot of pieces in place: running apache/php on linux. The applet runs and does connect to mysql on the hosting server.

    If I can do this without adding another daemon on the server (ie, jakarta, etc) that would be great. I am not opposed to running a jakarta. If that is the recommendation, how to do this?

    Thank you for any assistance you can provide.

    Dave

  2. #2
    Join Date
    Aug 2003
    Posts
    40
    Typically for this type of behavior I'd use JAVA RMI (remote method
    invocation). The RMI produces stubs/skeletons that permit/overcome
    the security implications you are probably experiencing.

    Since client-side VMs can't see server-side databases (or permit file
    I/O), you would have your server-side application running that
    connects to the database and retrieves the information.

    Your client-side applet will be used to formulate the SQL statements
    you desire and this info is passed, via RMI, to the server-side
    application.

    Once the server-side application retrives the information, only that
    info is returned to the client-side for display.

    Note that if you proceed in this fashion, you'll want to run the
    server-side RMI with threads.

    For complete details, examples, and demos, visit www.java.sun.com.

  3. #3
    Join Date
    Dec 2003
    Location
    Streetsboro, Oh
    Posts
    2

    connecting to MYSQL from applet

    Thank you for the information, it is very helpful.

    I appreciate the timely response and valuable information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •