Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating an access database thru a JSP

Status
Not open for further replies.

jackrookie

Programmer
Jun 10, 2002
1
US
I hate to do this, but I have a very rookie request.
I need to update a form to an access database from a webpage

All field validation is done on the client(JS), I just need to pass the variables to a jsp script, access the database, update a record, and send an email to the administrator.

The webpage, jsp page, and the access database will all be on the same web server.

i can type the update query, but that is about it at this point! Can someone help me with the jsp script and the database connection? I am sure there are plently of examples out there! Can someone help me find one?

any help is always appreciated!

--------------------


 
Here is something I posted quite a while back on this subject: thread197-107796.
 
if you have several jsps pages accessing the same database
its always better to create a bean for database connection
and use an instance of that bean to connect to the backend
rather than repeating the same code everywhere and modifications can also be made easily.

To update the database at runtime you can use

PreparedStatement stmt=null;
stmt=con.prepareStatement("update tablename set variable1=?,variable2=?);
stmt.setdatatype(1,value1);//set values for place holders(?)
stmt.setdatatype(2,value2);
stmt.executeUpdate();

Pria..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top