• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to retrieve blob name from multiple blob rows

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 )

lSbrqry.append("SELECT IMAGE FROM CLWF_IMG_FTP ORDER BY IMG_ID");
UTIL_LOGGER.fnWriteLog("CLWF_ejbIMG_FTPBean","CLWF_ejbIMG_FTPBean(fnRetrieveImage)","lSbrqry="+lSbrqry);

lpstmtretdet=lcnret.prepareStatement(lSbrqry.toString());
lrsret=lpstmtretdet.executeQuery();
while (lrsret.next()){
System.out.println("got record");
Blob image = lrsret.getBlob("IMAGE");
System.out.println("inside ejb image = "+image.toString());

InputStream input = image.getBinaryStream();

//if(image.equals("Winter")){
//FileOutputStream output = new FileOutputStream(lStrFtpImage+"Winter.xml");
FileOutputStream output = new FileOutputStream("c:/jk/Winter.jpg");
//}else{

//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 ((ch=input.read(rb)) != -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.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Store the file name in the same row as the data.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic