Results 1 to 4 of 4
  1. #1
    Felissa is offline Member
    Join Date
    Jun 2007
    Posts
    95
    Rep Power
    0

    Default Connect applet with mysql

    Well, what I'm wondering is how I could have an applet on a website which could query a MySQL database local on the server.

    I appreciate that this may not be the most secure thing in the world as Java can be dissassebled quite easily if you want to, but I'm not too worried about that as of the moment, I'm more interested in "is it possible" and "how would this affect the end-user".

    Also, I'm quite interested in using java for TCP connections with other applications and how I could set up a connection and send simple data between them.

    Thanks

    Felissa:p

  2. #2
    Eric is offline Senior Member
    Join Date
    Jun 2007
    Posts
    111
    Rep Power
    0

    Default

    Java has the ability to connect to and query a database provided you have the proper driver for that database platform. I've personally only done this with DB2. Here is an example I googled that shows an applet connecting to and querying an Oracle database

    So provided there is a driver for MySql then you should be able to connect and query your database.

    And a nice article on how to set up and use, with sample java source code near the bottom of the page.

    I'll be honest, I don't know whether the driver needs to be installed Client side or Server side or both. However, since it's an applet that's not running on client machines, I think you'll be ok.

    Greetings

    Eric

  3. #3
    Daniel is offline Member
    Join Date
    Jun 2007
    Posts
    91
    Rep Power
    0

    Default

    You create an applet that pulls contents from your website via HTTP calls and the response would be in xml data format.

    Your applet then processes the xml data and renders the contents inside it as html or how ever you which to display the contents.

    If you use this approach, then you don't have to worry about jdbc unless your website runs on JSP/Servlet technology.

    In other words, you can use PHP/ASP/ASP.NET/Perl/Ruby on Rails etc...to connect to your database...generate xml data...and then render the contents in your applet.
    This approach is used by Flash developers...and has been tested...and works like a charm.

    Greetings
    Daniel:o

  4. #4
    JToolTip is offline Member
    Join Date
    Jul 2007
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by Daniel View Post
    You create an applet that pulls contents from your website via HTTP calls and the response would be in xml data format.

    Your applet then processes the xml data and renders the contents inside it as html or how ever you which to display the contents.

    If you use this approach, then you don't have to worry about jdbc unless your website runs on JSP/Servlet technology.

    In other words, you can use PHP/ASP/ASP.NET/Perl/Ruby on Rails etc...to connect to your database...generate xml data...and then render the contents in your applet.
    This approach is used by Flash developers...and has been tested...and works like a charm.

    Greetings
    Daniel:o
    CLEVER! :) good job.

Similar Threads

  1. connect two applet
    By dg_iiita in forum Java Applets
    Replies: 0
    Last Post: 02-15-2008, 01:59 PM
  2. Connect applet with mysql
    By baltimore in forum Java Applets
    Replies: 1
    Last Post: 08-07-2007, 06:39 AM
  3. connect to MSDE
    By leonard in forum JDBC
    Replies: 1
    Last Post: 08-06-2007, 04:37 PM
  4. connect to microsoft access
    By bbq in forum JDBC
    Replies: 1
    Last Post: 07-09-2007, 03:33 AM
  5. Replies: 4
    Last Post: 06-08-2007, 06:15 AM

Posting Permissions

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