Latest Tutorials| Questions and Answers|Ask Questions?|Site Map


View Questions and Answers by Category


Have Programming Question? Ask it here!

ben mbarek afef
Gallery Photo
2 Answer(s)      a year and 6 months ago
Posted in : Design concepts & design patterns

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.


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"
<%@ page import="java.sql.*" %>
<%@ page import="*, java.awt.image.*, javax.imageio.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Display Data</title>
<form action="#">
<td>Enter Image ID </td>
<td><input type="text" name="id"/></td>
<td><input type="submit" value="Register"/></td>
<%! 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;

    con = DriverManager.getConnection(url,user,psw);
    String sql = "SELECT * FROM image where img_id="+i;
    ps = con.prepareStatement(sql);
    ResultSet rs = ps.executeQuery();
        byte[] img = rs.getBytes("img_data");
        String location = rs.getString("img_location");
        String name = rs.getString("img_name");     
        /*in = new ByteArrayInputStream(img);
        BufferedImage bImageFromConvert =;
        System.out.println("bImageFromConvert : "+bImageFromConvert);
        file = new File(location+"/"+name);
        <IMG SRC="<%=file %>" WIDTH="200" HEIGHT="50" 
catch(SQLException sqe)

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
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
photo uploading
photo uploading  i want the code upload the image in oracle database
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 viwer
photo viwer  i need coding for photo viewer using jsp mysql   Please visit the following link:
create dynamic image gallery jquery
create dynamic image gallery jquery  How to create a dynamic image gallery in Jquery
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
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
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. BufferedImage image=null; JFileChooser chooser = new...()); } } Here I'll get path of the photo in local machine in variable "path" (I
Upload Photo to Server
Upload Photo to Server  Hi I am using NetBeans IDE for developing... i am loading photo. BufferedImage image=null; JFileChooser chooser...()); } } Here I'll get path of the photo in local machine in variable "path
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
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
Slider Gallery plug-in
Slider Gallery plug-in In this section, you will learn to use Slider Gallery plug-in for developing image gallery slider. This shows a demonstration of a slider widget from the jQuery UI library .In this example a image gallery inside
problen in displaying the text and image in gallery using Android
problen in displaying the text and image in gallery using Android   public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); gallery = (Gallery
The National Gallery of Modern Art Delhi
The National Gallery of Modern Art in Delhi One of the top museums for art to visit when in Delhi is the National Gallery of Modern Art. This is a museum.... It is a beautiful museum for people to visit when in Delhi. The National Gallery of Modern
how to upload photo - Java Beginners
have jlabel. i want to view data like photo/picture to jlabel. then i have a button... into database } }); JPanel panel = new JPanel(); JLabel photo...); panel.add(photo); panel.add(browse); panel.add(button); frame.add
View Photo From Db MySql
View Photo From Db MySql  Good Morning Sir, Please help me, I make a small code but i have a error. I want to make viewer photo from database MySql into my project in netbeans. this is my code : try
Image Slide Show using 'Space gallery' plug-in
Image Slide Show using  'Space gallery' plug-in In this tutorial , we will create a slide show using 'Space gallery' plug-in .In this example , two tabs are given. in one tab 'Space gallery' slide show
History of National Gallery of Modern Art Delhi
National Gallery of Modern Art, Delhi India is a country which brings forth... movement, one of them was 'National gallery of Modern Art'. The National gallery of Modern Art was first set up in Delhi, which has collection
How to create and use Facebook Shared Photo Albums?
Video Tutorial - How to create and use Facebook Shared Photo Albums? Facebook Shared Photo Albums is the feature added to the Facebook. It is very user... to use Facebook Shared Photo Albums?. We have also included a video tutorial
iPhone Pick images from Photo Library
iPhone Pick images from Photo Library In this example application we are going to show you how to pick an image from photo library. To choose the photo from the photo library we required to call three different delegates
Flex Image Gallery Slide Show
a versatile photo album, you will have to create your own image gallery... and mesmerizing dynamic photo gallery that will enthrall the viewers...Flex Image Gallery Slide Show Earlier, most of us were fond of storing
YUI Based Lightbox
YUI Based Lightbox       a YUI based image gallery script Read full Description
photoshop : how to make an older photo
How to make an older picture.       In this tutorial we are going to convert a photograph into a old photo, it is not tough now because you have a golden
dewspot       The is rich mashup with impressive user interface. It allows to work with video, map, photo and weather forecast. Developers periodicaly add new features. Wishes
php generate link - PHP
php generate link  How can i generate links in PHP for my photo gallery app
How to give tint color effect
How to give tint color effect Give the tint effect to your photo by this example. This effect will apply on the tree picture so follow this tutorial to learn complete. Take a Picture: Take any picture