• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inserting Multiple Images into oracle database using JDBC by reading it from text file

 
Raihan Jamal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how we can insert multiple images into oracle database....

I wanted to insert multiple images into database using JDBC by reading it from the file... and i am passing photos.txt(my text file) as an input parameter... this is my content of photos.txt file and i have copied all the images into the folder
" C:\\photos "

1,in1.jpg,108,19,in-n-out
2,in2.jpg,187,21,in-n-out
3,in3.jpg,308,41,in-n-out
4,in4.jpg,477,52,in-n-out
5,in5.jpg,530,50,in-n-out


and i want to store in1.jpg,in2.jpg,in3.jpg,in4.jpg,in5.jpg into the oracle databse using JDBC.... i have tried a lot using BLOB column.... and i have created my table as

CREATE TABLE PHOTO(
ID NUMBER NOT NULL PRIMARY KEY ,
Name BLOB,
X DOUBLE PRECISION,
Y DOUBLE PRECISION,
Tags VARCHAR2(40)
);


---------------------------------------------------------------------------------------


--------------------------------------------------------------------------------------



As i am able to read one image by my above code in1.jpg in to the oracle databse.... Any suggestions how can i insert multiple images into oracle database by looking at my code or any other changes....
Can you give me the example on the basis of the above code of mine...
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34863
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where are the multiple images coming from? In your example, the image is hard coded.
 
Raihan Jamal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have to read the name of image from the text file as given above.... like in1.jpg in2.jpg
and then from that we have to store the image in the oracle database...


and images are stored in photos folder in C drive
"C:\photos"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic