File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How to update a image using servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to update a image using servlet?" Watch "How to update a image using servlet?" New topic

How to update a image using servlet?

Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 211

Hi all,

I am new in image uploading and updating I uploaded an images in my project and want to update a image usingservlet using id which is PK in society table.
But I am not able to get it. Please help me.

this is my code for uploading image:

thanks in advanc.

jeya velan

Joined: Feb 07, 2011
Posts: 9

Do not understand what your problem is.
If getting the generated PK is the problem, than you can use the below code if you are using Prepared Statement and
your database supports identity columns
Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 211


I want to say that this above code for image uploading when I create a society (means residential or commercial area)form but when I want to update this form then what is the process use for updating the only images.

I updated all the form field in one servlet and want to update two images in a seprate servlet because I am using two forms in one jsp........
this is my project task flow when I searching societies then it will show a Update button onclick this button will go on edit_society based on society id e.g. SOC000001 and so on after then this page action will go for UpdateImageSociety servlet which is below after this jsp.

this is the jsp page...

and now the edit_society2.jsp

This is the servlet for all text field updation..

table is here...

So this the flow but I am not able to update only images
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

Ram Dev chandran,
Your post was moved to a new topic.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: How to update a image using servlet?
jQuery in Action, 3rd edition