Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 6th, 2006, 11:23 AM
Registered User
Join Date: Sep 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to pandeyvic
Default how to save picture in oracle using Blob

please tell me stepwise procedure to store and retrive
images in oracle with java.

  #2 (permalink)  
Old December 2nd, 2006, 03:51 AM
Registered User
Join Date: Dec 2006
Location: , LA, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to pk_ocp Send a message via Yahoo to pk_ocp

I'm writing C# 2005 Express Addition, Dot Net Framework(2.0 or 3.0).
But i think if you've idea about c# then you might be able to complete it.

//Have DataAdapter.
  OracleDataAdapter pAdapter = new OracleDataAdapter("Select * from Employee", con);

//Have Dataset
  DataSet pDataSet = new DataSet("Employee");

//Fill Dataset.
 pAdapter.Fill(pDataSet, "Employee");

0).Have a New Row in Dataset.
 DataRow pRow = pDataSet.Tables["Employee"].NewRow();

1). Load the path of Image that you want to store in Oracle(9i)database.
 if (strImageName1 != "")
    //Read Access to the file chosed by 'Browse' button.
    FileStream fs = new FileStream(@strImageName1, FileMode.Open, FileAccess.Read);

2). Convert it into Stream of data and keep it into an Array of byte.
 //Create a byte array of file stream length
 byte[] ImageData = new byte[fs.Length];

 //Read block of bytes from stream into byte array
 fs.Read(ImageData, 0, System.Convert.ToInt32 fs.Length));

4). Save this stream into your database.
 //Assigning the byte array containing image data.
 pRow["Emp_image"] = ImageData;

5). Don't Forget to Add Row into datase.

6). Don't forget to Update DataAdapter.
 pAdapter.Update(pDataSet, "Employee");

I Hope it works.
If still not clear, don't hesitate to e-mail me.



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
insert image in to oracle blob data type rajesh_bamane Pro VB Databases 3 July 15th, 2006 02:06 AM
How to save a picture in Microsoft Access Database Edward King Java Databases 0 January 4th, 2006 01:27 AM
Display RTF data From oracle BLOB to RichTextBox saravananedu VB How-To 2 July 26th, 2005 12:03 AM
How to disable Right-click to Save Picture As.... bekim HTML Code Clinic 11 January 9th, 2005 02:09 AM
problem in inserting blob data to oracle selphyr JSP Basics 2 December 2nd, 2004 01:44 PM

All times are GMT -4. The time now is 07:05 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.