Results 1 to 6 of 6

Thread: Displaying an Image In a JSP With a Access database

  1. #1
    Join Date
    Nov 2009
    Posts
    1,340

    Displaying an Image In a JSP With a Access database

    Hello, I am working on the java programming language. And while working on it, as I am having database of the access. I want to take the image from my database and then simply want to display that image to the Jsp page. I have tried to do this, but I am not able to get the solution for this purpose. If you are having any type of suggestion for this then please provide some help to get the solution.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Displaying an Image In a JSP With a Access database

    Hey, I am also having same problem. I also want to perform the same. I am alos having the database in access and want to display an image whose link is stored into the database. I am trying to use the code below:
    Code:
    <td> <input type ="img" name ="img" src ="<% = c.getImgCamping ()%>"> </ td>
    It is not working and now I want to get some help from which I can able to get the solution for my problem.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Displaying an Image In a JSP With a Access database

    Hello, I think you must need to make use of the code below and get the solution for your problem.

    Code:
    <td> <img src ="<% out.println (container.getImgCamping ())%>" name ="img"> </ td>
    You just need to add the code below in your program and get your problem solved.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Displaying an Image In a JSP With a Access database

    I think that you must need to check the path correctly in your program. In your database paths are stored on the server which is most of the time came from the C drive. And as we know that the jsp page is executing at the client side.
    I advise you create a directory on your web site files stored in it and send a link to the either the form or to the images.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Displaying an Image In a JSP With a Access database

    Hello, I think the program below will simply solve your problem:
    Code:
    ResultSet resultset=st.executeQuery("select * from images");
    while(resultset.next())
    {
    byte arr[] = resultset.getBytes(4);
    String get_price=resultset.getString(5);
    res.setContentType("pic/gif");
    res.getOutputStream().write(arr);
    out.println("Price in Rs. "+get_price);
    }
    res.getOutputStream().flush();
    res.getOutputStream().close();

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Displaying an Image In a JSP With a Access database

    I think solution for this technique is the simple code below:
    Code:
    <h1> Testing </ h1>
    <table border =1 bgcolor ="FFFFCC">
    <tr>
    <th> First </ th>
    <th> Pic </ th>
    To edit <th>image </ th>
    </ tr>
    <tr>
    <input type = "hidden" name = "id" value ="<%= r.getIdRegion ()%> ">
    <td> <input type = "text" name = "name" value = "<% out.println (r.getNomRegion ()); %>"></ td>
    <td> <img src ="<%= container.getImgRegion ()%> "alt =" No d 'photo available"/> </ Br> </ td> <td> <input type ="file"First ="modif"> </ td>
    </ tr>
    And for displaying the area and other things make use of the code below:
    Code:
    </ td>
    <td> <input type ="text" name ="test"</ td>
    <td> <textarea name ="check" rows ="4" cols ="50"> </ textarea> </ td>
    <td> <input type ="file" name ="imgcreation"</ td>
    </ tr>

Similar Threads

  1. problem with displaying image
    By ibiangalex in forum Software Development
    Replies: 1
    Last Post: 27-10-2010, 03:31 AM
  2. Displaying an image and text in a JSP
    By samualres in forum Software Development
    Replies: 7
    Last Post: 20-03-2010, 10:43 AM
  3. Displaying an image with Qt
    By Zool in forum Software Development
    Replies: 3
    Last Post: 08-12-2009, 11:57 AM
  4. Scan image into an Access database
    By Okies in forum Windows Software
    Replies: 2
    Last Post: 22-05-2009, 01:37 PM
  5. Insert image in access database from vb 6.0
    By Vireshh in forum Software Development
    Replies: 2
    Last Post: 22-01-2009, 09:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,720,088.63520 seconds with 17 queries