#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    2
    Rep Power
    0

    how can my java applet to communicate with db


    Ok, I have a java applet (db web app) that has some comboboxes and text fields. I want my applet to be able to present data from a database as well as update delete ect.. the DB.

    Now, I want my applet which by the way is java and not javascript to communicate with a servlet which in turn makes a connection to a DB and sends data back to the applet clientside.

    I know how to make the applet communicate directly with a DB via the web using a type 4 driver but I would like to learn the servlet way.

    Basically, I want to use my java apps gui as the front end and use servlets to do the connection stuff.

    Please help
    E-force!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    No es importante
    Posts
    2,065
    Rep Power
    14
    See if this article is able to offer some assistance.
    http://www.onjava.com/pub/a/onjava/2...0/applets.html
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    2
    Rep Power
    0

    Applets and servlets question


    As far as having your applet communicating with a servlet and vise/versa; is there a portion of the servlet that stays the same (code)? I create numerous applets in java gui (with Text boxes, combo boxes, ect..)

    But the problem is that the only way I know to communicate with the database is by placing all the se database code in my program which presents a problem when it comes to size as well as native errors and such.

    I did not know up until the previous post that I could basically use java gui , compile my program and run it as an applet and then create a servlet that is called from my applet and then the servlet which resides on the server with my database can fetch data from the database and then send it back to the applet where its presented to the user in prescribed textfields, combos, ect...

    My only problem is that I donít know servlets but I do know how to look at code and basically figure out somethings. My question to you is: besides the control names, database name, SQL code, ect.., is there anything else that has to be modified in a servlet that basically does the same thing each time just with a different java web app?

    Once I get the basics down packed as far knowing whats needed in order to have my applet (gui) talk with a servlet which talks with the database then Iíll be straight. The only other thing will be getting the reports feature down.

    Please enlighten me!

    Eforce!

IMN logo majestic logo threadwatch logo seochat tools logo