title: File writing with blob data
body: <p>I am reading the blob data from Oracle database &amp; writing it to a text file. I have two column in my database called Number &amp; system. I have 100 counts in my table. But only the last row is writing in my text row. below is the code I have tried.</p>
  
  <pre><code>rs =stmt.executeQuery("select Number, system from system");
  Blob lob = null;
  
  
  while (rs.next()) {
    String RECID = rs.getString(1);
    System.out.println("Number"+ Number);
  
    lob=rs.getBlob("system");
    byte[] bdata = lob.getBytes(1, (int) lob.length());
    String text = new String(bdata);
    System.out.println("text"+ text);
  
    System.out.println("rs value"+ lob);
    String test=null;
    test=RECID+":"+text;
    FileOutputStream fos = new FileOutputStream("C:/DataRead/system.txt");
    DataOutputStream dos = new DataOutputStream(fos);
    dos.writeBytes(test);
  
    dos.close();
  }
  }
  catch (Exception e) {
     e.printStackTrace();
  }
  
  }
  }
  </code></pre>
  
  <p>In text file i am getting 100th record only other 99 rows are not writing. </p>