Exception while inserting image in oracle using java

Ads
 

Exception while inserting image in oracle using java

import java.sql.*; import java.io.*; class Oracle2 { public static void main(String args[])throws Exception { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger"); PreparedStatement stmt=con.prepareStatement("update image1 set photo=? where no=1"); File f=new File("Jellyfish.jpg"); FileInputStream fis=new FileInputStream(f); stmt.setBinaryStream(3,fis,(int)f.length()); System.out.println("Image length: "+f.length()); System.out.println("No.of rows affected: "+stmt.executeUpdate()); } }

My Oracle table description is: create table image1(no int, name varchar2(20), photo blob);

Please answer soooooooon....

View Answers

Ads









Related Tutorials/Questions & Answers:
Exception while inserting image in oracle using java
Exception while inserting image in oracle using java  import...[])throws Exception { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost
Insert or retrieve image into oracle 10g by using java
Insert or retrieve image into oracle 10g by using java   How can i insert or retrieve image into oracle10g using java plz i need it urgently,need guidance to do this plz
Advertisements
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
inserting text into text file using java application
inserting text into text file using java application  Hi, I want to insert a text or string into a text file using java application
java code using while loop
java code using while loop  
data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp
data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp   data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp with script of data base plz help me
inserting image into database
inserting image into database  how to insert image into database using struts frame work and spring JDBC
Image using Java coding
Image using Java coding  Hai, Display image in pdf file using Java coding through Xsl file.. Please help me.. xsl file generate the pdf file
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
Upload and display image and text records using JSP and Oracle
Upload and display image and text records using JSP and Oracle  Hi all, I'm using JSP and Oracle 10g. I could retrieve and display records from database. But i couldnot retrieve and display image. I want to store
Storing Multiple image in sql using java
Storing Multiple image in sql using java  Hi, How to store and retrieve a multiple image in sql using java but already i have created sql table if i want to insert a image while runtime execution. Can anyone tell me solution
highlight words in an image using java
want to highlight name in the image using java/jsp/javascript.please help me...highlight words in an image using java  Hai all,In my application left side image is there and right side an application contains textboxes like
How to access the image file from project folder itself while writing to pdf using itext?
How to access the image file from project folder itself while writing to pdf using itext?  I am writing a pdf using itext where i add a image... accomplish this.I am using simple java program to write the pdf.Not a servlet.Thanks
getting error while inserting values in database
getting error while inserting values in database  AddUser.java...(); Context envContext = (Context) initContext.lookup("java:/comp/env..."); if (envContext == null)throw new Exception("Error: No Context
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... characters. To store the image into database using Java we will be required
Retrieving images from the oracle database using jsp and create that rretrieved image as hyperlink
Retrieving images from the oracle database using jsp and create that rretrieved image as hyperlink  I want to insert images into oracle database.I want to retrieve images using jsp and I want to display on the browser.The
Lock while inserting/updating database in multithreaded.
Lock while inserting/updating database in multithreaded.  Hi, I am... 1month, I am facing one issue which is like: One of my thread get struct while inserting/updating to database. I dont know what is the issue but it was never
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
Load Icon Image Exception
Load Icon Image Exception  Load Icon Image Exception
passing xml created using DocumentBuilderFactory as input to oracle stored procedure using java JDBC
passing xml created using DocumentBuilderFactory as input to oracle stored procedure using java JDBC  I want to send the xml as input parameter... and it is to be send using JDBC. Stored procedure in oracle database will contains two
Insert  Image into Database Using Servlet
of inserting image into database table using Servlet. This type of program is useful... Insert  Image into Database Using Servlet   ... to retrieve the image from database using Servlet. After retrieving the image from
Oracle BLOB
Oracle BLOB  Can anyone send me the code for inserting an image or audio into the oracle database using BLOB datatype. Plz...it's useful for my project
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 Retrieve Image From From MySQL Using Java
How To Retrieve Image From From MySQL Using Java In this section we will discuss about how to retrieve image from the MySQL using Java. This example... in Java. To retrieve an image from the database we will have to run the "
Image name,image path into database and image into folder using jsp
Image name,image path into database and image into folder using jsp  How to insert image path and image name into oracle database and image into folder using jsp
Exception Java
Exception Java  Hi, What are the Exception Java? Thanks   Hi, Read it at Java Exception. Thanks

Ads