aspose file tools*
The moose likes I/O and Streams and the fly likes How to retrieve blob name from multiple blob rows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to retrieve blob name from multiple blob rows" Watch "How to retrieve blob name from multiple blob rows" New topic

How to retrieve blob name from multiple blob rows

Kondal reddy

Joined: Sep 23, 2003
Posts: 22
Actually I am storing my Jpg files in a single column as multiple rows. So how can I retrieve as JPG files with same names of before stored jpg file names.(I am rertriving as a single file )


while ({
System.out.println("got record");
Blob image = lrsret.getBlob("IMAGE");
System.out.println("inside ejb image = "+image.toString());

InputStream input = image.getBinaryStream();

//FileOutputStream output = new FileOutputStream(lStrFtpImage+"Winter.xml");
FileOutputStream output = new FileOutputStream("c:/jk/Winter.jpg");

//System.out.println("in EJB else");
System.out.println("inside ejb after putting image = "+image.toString());

// set read buffer size
byte[] rb = new byte[1024];
int ch = 0;
// process blob
while (( != -1) {
output.write(rb, 0, ch);

so any one can help how can I retrieve with my old names when I am storing that file names.
Joe Ess

Joined: Oct 29, 2001
Posts: 8718

Store the file name in the same row as the data.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: How to retrieve blob name from multiple blob rows
Similar Threads
Unsupported data conversion
Display multiple images in JSP from MySql
Zipping files
Blob Clob
FTP Dowload JPG & XML files only... USing* from FTP server