July 18th, 2003, 09:48 PM
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.
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.
July 18th, 2003, 11:02 PM
July 20th, 2003, 08:06 PM
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!