Gallery Photo

Gallery Photo

I need to display a photo gallery with the path stored in oracle with the possibility of their supprission (photo management) (with jsf or with jsp)

View Answers

May 23, 2013 at 7:16 PM

hi friend,

Do not do such task using JSP, Better option is to use Servlet. It will be better than the JSP.

Thanks


May 24, 2013 at 6:55 PM

hi fried,

Try the following code, may this will be helpful for you

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*, java.awt.image.*, javax.imageio.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Display Data</title>
</head>
<body>
<form action="#">
<table>
<tr>
<td>Enter Image ID </td>
<td><input type="text" name="id"/></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Register"/></td>
</tr>
</table>
</form>
<%! String driverName = "com.mysql.jdbc.Driver";%>
<%! String url = "jdbc:mysql://localhost:3306/record";%>
<%! String user = "root";%>
<%! String psw = "root";%>
<%
String imgID = request.getParameter("id");
if(imgID != null)
{
    int i = Integer.parseInt(imgID);
Connection con = null;
PreparedStatement ps = null;
File file = null;
InputStream in = null;

try
{
    Class.forName(driverName);
    con = DriverManager.getConnection(url,user,psw);
    String sql = "SELECT * FROM image where img_id="+i;
    ps = con.prepareStatement(sql);
    ResultSet rs = ps.executeQuery();
    while(rs.next())
    {
        byte[] img = rs.getBytes("img_data");
        String location = rs.getString("img_location");
        String name = rs.getString("img_name");     
        /*in = new ByteArrayInputStream(img);
        BufferedImage bImageFromConvert = ImageIO.read(in);
        System.out.println("bImageFromConvert : "+bImageFromConvert);
        */
        file = new File(location+"/"+name);
        response.setContentType("image");
        response.getOutputStream().write(img);
        response.getOutputStream().flush();
        response.getOutputStream().close();
        %>
        <IMG SRC="<%=file %>" WIDTH="200" HEIGHT="50" 
   BORDER="0">
        <%
    }
}   
catch(SQLException sqe)
{   
    out.println(sqe);
}
}
%>
</body>
</html>









Related Tutorials/Questions & Answers:
Gallery Photo
Gallery Photo  I need to display a photo gallery with the path stored in oracle with the possibility of their supprission (photo management) (with jsf or with jsp)   hi friend, Do not do such task using JSP, Better
photo gallery - Java Beginners
photo gallery  Iam uploading images in the serverusing uploading program, now i need to display all the images from the folder and i dont want give the image path.uploading is the continues process and i need to display
Advertisements
ModuleNotFoundError: No module named 'simple-photo-gallery'
ModuleNotFoundError: No module named 'simple-photo-gallery'  Hi...: No module named 'simple-photo-gallery' How to remove the ModuleNotFoundError: No module named 'simple-photo-gallery' error? Thanks   Hi
photo album
photo album  while syncing photos to my photo album in my iphone, the photo albumj ust got crashed i guess. Under photos option i just have the camera roll option now!! What should i do to get the photo album back
photo uploading
photo uploading  i want the code upload the image in oracle database
photo viwer
photo viwer  i need coding for photo viewer using jsp mysql   Please visit the following link: http://www.roseindia.net/jsp/downloadimage.shtml
Image Gallery
and am having an issue with the image gallery. The goal is to create multiple categories with an image gallery for each. For example,the wedding gallery...="padd-2">our GALLERY </h2> </div> <div class
Image Gallery
and need your guidance. The specific piece of the site is an image gallery... class="padd-2">our GALLERY </h2> </div> <div...="" width="280" height="262"></a> <a href="BIG PHOTO LINK" rel
Adding photo to iPhone simulator
Adding photo to iPhone simulator  Hi, there is no photo in my iPhone simulator.. how can i add one? Please suggest. Thanks
upload photo in xcode
upload photo in xcode  how can i upload a photo in a view in xcode? i am a beginner in xcode please help me
ModuleNotFoundError: No module named 'Gallery'
ModuleNotFoundError: No module named 'Gallery'  Hi, My Python... 'Gallery' How to remove the ModuleNotFoundError: No module named 'Gallery... to install padas library. You can install Gallery python with following command
save uiimage to photo library
save uiimage to photo library  How to saved the clicked picture on camera roll in iPhone. I always want to write the file into photo library.   Save UIImage to photo library Creating a camera application in iPhone need
Photo upload, Download
Photo upload, Download  Hi I am using NetBeans IDE for developing... am loading photo. (adsbygoogle = window.adsbygoogle || []).push... I'll get path of the photo in local machine in variable "path" (I dont know whether
Upload Photo to Server
Upload Photo to Server  Hi I am using NetBeans IDE for developing... i am loading photo. (adsbygoogle = window.adsbygoogle || []).push...()); } } Here I'll get path of the photo in local machine in variable "path" . My question
PHOTO UPLOAD AND DISPLAY - Struts
PHOTO UPLOAD AND DISPLAY  Hi, This is chandra Mohan. I want some help urgently from your side. My problem is I want to upload the photos and display photos usin Struts technology. Please give me some suggestion to me
ModuleNotFoundError: No module named 'mera_photo'
ModuleNotFoundError: No module named 'mera_photo'  Hi, My Python... 'mera_photo' How to remove the ModuleNotFoundError: No module named 'mera_photo' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'natgeo_photo'
ModuleNotFoundError: No module named 'natgeo_photo'  Hi, My Python... 'natgeo_photo' How to remove the ModuleNotFoundError: No module named 'natgeo_photo' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'natgeo_photo'
ModuleNotFoundError: No module named 'natgeo_photo'  Hi, My Python... 'natgeo_photo' How to remove the ModuleNotFoundError: No module named 'natgeo_photo' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'photo-org'
ModuleNotFoundError: No module named 'photo-org'  Hi, My Python... 'photo-org' How to remove the ModuleNotFoundError: No module named 'photo... have to install padas library. You can install photo-org python with following
ModuleNotFoundError: No module named 'photo-calendar'
ModuleNotFoundError: No module named 'photo-calendar'  Hi, My... named 'photo-calendar' How to remove the ModuleNotFoundError: No module named 'photo-calendar' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'photo-gen'
ModuleNotFoundError: No module named 'photo-gen'  Hi, My Python... 'photo-gen' How to remove the ModuleNotFoundError: No module named 'photo... have to install padas library. You can install photo-gen python with following
ModuleNotFoundError: No module named 'photo-import'
ModuleNotFoundError: No module named 'photo-import'  Hi, My Python... 'photo-import' How to remove the ModuleNotFoundError: No module named 'photo-import' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'photo-sorter'
ModuleNotFoundError: No module named 'photo-sorter'  Hi, My Python... 'photo-sorter' How to remove the ModuleNotFoundError: No module named 'photo-sorter' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'photo-uploader'
ModuleNotFoundError: No module named 'photo-uploader'  Hi, My... named 'photo-uploader' How to remove the ModuleNotFoundError: No module named 'photo-uploader' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'unach-photo'
ModuleNotFoundError: No module named 'unach-photo'  Hi, My Python... 'unach-photo' How to remove the ModuleNotFoundError: No module named 'unach-photo' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'photo-dl'
ModuleNotFoundError: No module named 'photo-dl'  Hi, My Python... 'photo-dl' How to remove the ModuleNotFoundError: No module named 'photo-dl... to install padas library. You can install photo-dl python with following
ModuleNotFoundError: No module named 'photo-grid'
ModuleNotFoundError: No module named 'photo-grid'  Hi, My Python... 'photo-grid' How to remove the ModuleNotFoundError: No module named 'photo-grid' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'photo-org'
ModuleNotFoundError: No module named 'photo-org'  Hi, My Python... 'photo-org' How to remove the ModuleNotFoundError: No module named 'photo... have to install padas library. You can install photo-org python with following
create dynamic image gallery jquery
create dynamic image gallery jquery  How to create a dynamic image gallery in Jquery
Upload photo - Java Beginners
Upload photo  Morning, Can you tell me coding how to upload photo. First, i want to browse the photo from my direktory(*.jpg, *.bmp *.gif), then i click this photo and view in my JFrameForm then i have a button to save
Photo Upload - JSP-Servlet
Photo Upload  Dear Sir, I want some help you i.e code for image upload and download using Servle/jsp. Thanks&Regards, VijayaBabu.M  Hi <% //to get the content type information from JSP Request
ModuleNotFoundError: No module named 'aldryn-gallery'
ModuleNotFoundError: No module named 'aldryn-gallery'  Hi, My... named 'aldryn-gallery' How to remove the ModuleNotFoundError: No module named 'aldryn-gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'aldryn-gallery'
ModuleNotFoundError: No module named 'aldryn-gallery'  Hi, My... named 'aldryn-gallery' How to remove the ModuleNotFoundError: No module named 'aldryn-gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'aldryn-gallery'
ModuleNotFoundError: No module named 'aldryn-gallery'  Hi, My... named 'aldryn-gallery' How to remove the ModuleNotFoundError: No module named 'aldryn-gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'kotti_gallery'
ModuleNotFoundError: No module named 'kotti_gallery'  Hi, My... 'kotti_gallery' How to remove the ModuleNotFoundError: No module named 'kotti_gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'leonardo-gallery'
ModuleNotFoundError: No module named 'leonardo-gallery'  Hi, My... named 'leonardo-gallery' How to remove the ModuleNotFoundError: No module named 'leonardo-gallery' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'leonardo-gallery'
ModuleNotFoundError: No module named 'leonardo-gallery'  Hi, My... named 'leonardo-gallery' How to remove the ModuleNotFoundError: No module named 'leonardo-gallery' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'lfs_gallery'
ModuleNotFoundError: No module named 'lfs_gallery'  Hi, My Python... 'lfs_gallery' How to remove the ModuleNotFoundError: No module named 'lfs_gallery' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'myks-gallery'
ModuleNotFoundError: No module named 'myks-gallery'  Hi, My Python... 'myks-gallery' How to remove the ModuleNotFoundError: No module named 'myks-gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'omero-gallery'
ModuleNotFoundError: No module named 'omero-gallery'  Hi, My... 'omero-gallery' How to remove the ModuleNotFoundError: No module named 'omero-gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'oms-gallery'
ModuleNotFoundError: No module named 'oms-gallery'  Hi, My Python... 'oms-gallery' How to remove the ModuleNotFoundError: No module named 'oms-gallery' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'panya-gallery'
ModuleNotFoundError: No module named 'panya-gallery'  Hi, My... 'panya-gallery' How to remove the ModuleNotFoundError: No module named 'panya-gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'sphinx-gallery'
ModuleNotFoundError: No module named 'sphinx-gallery'  Hi, My... named 'sphinx-gallery' How to remove the ModuleNotFoundError: No module named 'sphinx-gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'wagtail-gallery'
ModuleNotFoundError: No module named 'wagtail-gallery'  Hi, My... named 'wagtail-gallery' How to remove the ModuleNotFoundError: No module named 'wagtail-gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'aldryn-gallery'
ModuleNotFoundError: No module named 'aldryn-gallery'  Hi, My... named 'aldryn-gallery' How to remove the ModuleNotFoundError: No module named 'aldryn-gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cmsplugin_gallery'
ModuleNotFoundError: No module named 'cmsplugin_gallery'  Hi, My... named 'cmsplugin_gallery' How to remove the ModuleNotFoundError: No module named 'cmsplugin_gallery' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'djangocms-gallery'
ModuleNotFoundError: No module named 'djangocms-gallery'  Hi, My... named 'djangocms-gallery' How to remove the ModuleNotFoundError: No module named 'djangocms-gallery' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-gallery'
ModuleNotFoundError: No module named 'django-gallery'  Hi, My... named 'django-gallery' How to remove the ModuleNotFoundError: No module named 'django-gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'feincms-gallery'
ModuleNotFoundError: No module named 'feincms-gallery'  Hi, My... named 'feincms-gallery' How to remove the ModuleNotFoundError: No module named 'feincms-gallery' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'gallery-dl'
ModuleNotFoundError: No module named 'gallery-dl'  Hi, My Python... 'gallery-dl' How to remove the ModuleNotFoundError: No module named 'gallery-dl' error? Thanks   Hi, In your python environment you

Ads