How to repeat the while Statement in java

try
{

while(rs.next())
{

exx = rs.getInt("ID");
exxx = Integer.toString(exx);