Gopu, This query gives you that record as the first element. <blockquote>code:<pre name="code" class="core">select * from table where status = 0 order by id;</pre></blockquote>
You could have your Java code just read the first row. Or you could use a MySql specific statement to limit the result set to just one row. In MySql, I think the statement is "limit 1" at the end of the query.