How you can add Image in various different HSSFCell object in poi ?

I've written some code that is adding image but issue is, the cell were I added last image, That cell only showing image apart from that not one other cells are showing images ...

thank you for help ...

My Code is

while(rs.next())

getPicIndex METHOD :-

HSSFCell cell = getHSSFCell(sheet, rowNo, cellNo);

cell.setCellValue(new HSSFRichTextString(rs.getString("TEST_STEP_DETAILS")) );
cell.setCellStyle(style);

String annotate = rs.getString("ANNOTATE");

if(annotate != null){						
        int index = getPicIndex(wb);
	HSSFPatriarch patriarch=sheet.createDrawingPatriarch();
	HSSFClientAnchor anchor = new HSSFClientAnchor(400,10,655,200,(short)cellNo,(rowNo+1),(short)cellNo,(rowNo+1));
	anchor.setAnchorType(1);
	patriarch.createPicture(anchor, index);											
}
cellNo++;

i think you'll found the answer yourself. otherwise:
however , you create for each image a brand new partiarch. public static int getPicIndex(HSSFWorkbook wb){ int index = -1; try { byte[] picData = null; File pic = new File( "C:\\pdf\\logo.jpg" ); long length = pic.length( ); picData = new byte[ ( int ) length ]; FileInputStream picIn = new FileInputStream( pic ); picIn.read( picData ); index = wb.addPicture( picData, HSSFWorkbook.PICTURE_TYPE_JPEG ); } catch (IOException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return index; }
you need to create just one patriarch instance and employ its createPicture way of all images.