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



Home Answers Viewqa Java-Beginners How to Store Image using JSF
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Ashraf Shaida
How to Store Image using JSF
0 Answer(s)      3 years and 3 months ago
Posted in : Java Beginners


Hi How to upload images in db. using jsf. For jsf photo uploading .. I used this one code for upload image..

But this code haven't option to upload any images . i want to store image in db for that second thing have done it..It also check the image extension......

public void save(Registrationbean bean) { try {

        PreparedStatement ps =null;
        FileInputStream fis = null;

        String uname =bean.getUname();

        Blob img2 =bean.getImge();
        File img = new File("img2");


        String qry = "insert into application_table(name,image)values('"+ uname+"','"+img2+"')";

        fis = new FileInputStream(img);
        ps.setBinaryStream(2, fis,   (int)img.length());
        ps = con.prepareStatement(qry);
        System.out.println("save registration::::" + ps);

        stmt.executeUpdate(qry);
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

Any one plz Guide me.


Advertisement
View Answers

Related Tutorials/Questions & Answers:
How to Store Image using JSF
How to Store Image using JSF  Hi How to upload images in db. using jsf. For jsf photo uploading .. I used this one code for upload image.. But this code haven't option to upload any images . i want to store image in db
How to store an image in database
How to store an image in database  Hi........... How to store an image in postgresql using a query. I mean tell me the way to store an image using datatype. I am using the datatype bytea but tell me how to insert the image
Advertisements
How to store image into database
How to store image into database  Hi, all I want to store image into database using Java. Can anyone help me that how can i store image into database... through the following link How To Store Image Into MySQL Using Java
how to store and retrieve image using struts2 and hibernate integration
how to store and retrieve image using struts2 and hibernate integration  how to store and retrieve image using struts2 and hibernate integration? plz help !! thanks in advance
how to store image in oracle express edition using servlet
how to store image in oracle express edition using servlet  strong text how to store image in oracle express edition using servlet?   Please visit the following link: Servlet Insert image into MySQL database
How To Store Image Into MySQL Using Java
How To Store Image Into MySQL Using Java In this section we will discuss about how to store an image into the database using Java and MySQL. This example explains you about all the steps that how to store image into MySQL database
how to store image in folder and stored image path in mysql database using JSP
how to store image in folder and stored image path in mysql database using JSP  how to store image in folder and stored image path in mysql database using JSP
How to store user name,city,state,image path into database and image into folder using jsp
How to store user name,city,state,image path into database and image into folder using jsp  How to store user name,city,state,image path into database and image into folder using jsp
How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java
How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java  How To Store... and then retrieve them in image gallery using java
image store in oracle using jswing
image store in oracle using jswing  hello ,ihave searched the image store in oracle using jswing but i did not find the code please help me
how to store image file and videofile in ms access database using java? - JDBC
how to store image file and videofile in ms access database using java?  how to store image file and video file in ms access database using java
how to store and retrieve image from database
how to store and retrieve image from database  how to store and retrieve images into database(oracle) and how to retrive images from database using jsp   Here is a jsp code that insert and retrieve image from mysql
Store image from html img tag into mysql db using java
Store image from html img tag into mysql db using java  Hi. How to get the image displayed in the < img > tag of HTML and store it in the mysql database using java? Thanks in advance
how to store and then immediately retrieve when store the image into database?
how to store and then immediately retrieve when store the image into database?  how to store and then immediately retrieve when store the image into database?   Here is a jsp code that insert and retrieve image from
access image from ajax store in mysql using jsp
access image from ajax store in mysql using jsp  access image from ajax store in mysql using jsp (code to access image captured by camera and store in mysql
how to store image upload path to mssql database
how to store image upload path to mssql database  hi there!!, i need help in storing the image upload path into the database. basically i just use file select to upload the image from jsp to database. however when i click submit
how to store image upload path to mssql database
how to store image upload path to mssql database  hi there!!, i need help in storing the image upload path into the database. basically i just use file select to upload the image from jsp to database. however when i click submit
how to store image upload path to mssql database
how to store image upload path to mssql database  hi there!!, i need help in storing the image upload path into the database. basically i just use file select to upload the image from jsp to database. however when i click submit
how to store image upload path to mssql database
how to store image upload path to mssql database  hi there!!, i need help in storing the image upload path into the database. basically i just use file select to upload the image from jsp to database. however when i click submit
image store and get it back
image store and get it back  store the image in the oracle using blob... store the image in table but at time of reading it back it never shows me the image and how to convert the image file into binary format.... so that i can store
How can store image in server folder when deployed with a .war file?
How can store image in server folder when deployed with a .war file?  Hi all; When I am using application.getRealPath() , it return null when deployed with a .war file and when I use hard code it shows syntax error or path
store the image in the oracle using blob and get it back - JDBC
store the image in the oracle using blob and get it back  hi i am facing problem in the following code . this code can store the image in table but at time of reading it back it never shows me the image ..so plz try this code
store the image in the oracle using blob and get it back - JDBC
store the image in the oracle using blob and get it back  hi i am facing problem in the following code . this code can store the image in table but at time of reading it back it never shows me the image ..so plz try this code
store and retrive image from the database
store and retrive image from the database  please provide me with the code and the explanation of what each line does for the below query. -how to store and retreive images from sql database using sql commands -how to store
image store in database - JDBC
image store in database  Dear Deepak Sir, If I want to store image... to store image into database. Check at http://www.roseindia.net/servlets/insert...; Inserting Image in Database Table http://www.roseindia.net/jdbc/jdbc-mysql/insert
Unable to store the image into database
Unable to store the image into database  Hello, I have created below...); }   Hi, Please check the thread How to Insert image into database... of image. I have debug the JSP program and found that HTML form pass only image
How I Upload File and Store that file name in Database using JSP
How I Upload File and Store that file name in Database using JSP  Hi All, I m the beginner in JSP and I want to upload the file and store that file... form like Emp name, Emp id, city, address and one employee profile image(upload
how to fetch image from mysql using jsp
how to fetch image from mysql using jsp  how to fetch image from mysql using jsp
how to store data in other table using servlet and jsp
how to store data in other table using servlet and jsp  pls can anyone tell how to store data in other table using servlet and jsp and want to display that data too.and the data in first table must be same.pls help
How to store values in a database using JSTL? - JSP-Servlet
How to store values in a database using JSTL?  I want to store values in a database... How can i store in database? Here is my code... This wil extract details and displays in a table format... Now i want to store these values
how to store and retrieve images int and from the database using php
how to store and retrieve images int and from the database using php  please anyone can help me in storing the images and retrieve it back from the Mysql database using php
Advertisements
 

 

 

DMCA.com