This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 8836

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
Blob Clob
Unsupported data conversion
Display multiple images in JSP from MySql
FTP Dowload JPG & XML files only... USing* from FTP server
Zipping files