Here in this code I am trying to retrieve MySQL database contents such as "images, id, product details " into table created on JSP page. But on compilation it shows: " Unknown column 'id' in 'where clause' " message. I have tried a lot but, unable to retrieve image from database to table created in JSP page.The image stored in database is Blob image. Can anyone guide me how to retrieve images one after one in table from database to JSP page. Thanks in advance.
As Jeanne says, you don't have an 'id'column in your database table. You haven't shown us the table itself, but you later try and extract a prod_id from result set, so maybe that's the actual name?
As for the image, you cannot place the image on the page as a single action like this.
HTML does not work like that.
What you need to do is place an <img> tag whose src attribute points to a servlet on your server whose job is to return images. That servlet will accept the prod_id(?) in the request and pull the BLOB from the db for that row and stream it back.
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database