hi,

for storing in oracle database u have to use BLOB datatype. The file has to
be inserted in binary fashion for which APIs are there in java. Initially
data has to be entered and for the blob field  write EMPTY_BLOB() like this

insert into sb_emp
values('1113','','','','','','','','','','','','',EMPTY_BLOB());

. and then update that field like this.

FileInputStream fis = new FileInputStream(file);
                PreparedStatement pstmt = dbCon.prepareStatement("update
sb_emp set Eimage=? where empid=?");// (insert into sb_emp
values('1111','','','','','','','','','','','','',EMPTY_BLOB())";//("update
sb_emp set Eimage=? where empid=?");
                pstmt.setBinaryStream(1,fis,(int)file.length());
                pstmt.setInt(2,1113);
                pstmt.executeUpdate();
                pstmt.close();
                fis.close();


Regards,
Vikramjit Singh,
Systems Engineer,
GTL Ltd.
Ph. 7612929-1031


-----Original Message-----
From: Nancy Crisostomo Martinez [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 1:19 PM
To: [EMAIL PROTECTED]
Subject: how to store a document file?


Hi!
Does any of you know how to store a formatted document (text with bolds,
italics, etc) just like a Word document or html file in an Oracle
database?
Do you know what datatype the record must have?
And how does it is stored in programming (Java Code)? you could give me
a trick (Java code) to do it ...

Thanks in advance!!
Nancy.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to