Compare resultset column with a excel column and if the values match, write data to adjacent column
<p>I have java programe that fetch data ( two columns) from a sql database. And I have a excel file which has three columns. The second column of the excel file and the first column of the result set has be compared. If they match, I want to write the value of the dataset's second column to the 4th column of excel file. I have this code so far. Problem is,this only checks the first cell and not moving to next cells. Please help</p>

<pre><code>   int row = 0;
   while(row &lt; 50) {
       cell = sheet.getRow(row).getCell(1);
       String cellValue = cell.getStringCellValue();
       while (results.next()) {
           String name = results.getString("StationName");
           if(cellValue.equals(name)) {
               System.out.println(results.getString("StationName"));
               System.out.println("Strings matched and values written !!!! ");
               newCell = sheet.getRow(row).getCell(3);
               int Bal = results.getInt(2);
               newCell.setCellValue(Bal);
           } else {
               System.out.println(results.getString("StationName"));
               System.out.println("Strings not matched!!! ");
           }
       }
       row = row + 1;
   }
</code></pre>