Hello I am quite new programming in Jython,
I am working with DB. I a send SQL Statements, but I want to handle the zero rows in Resulset.
rs = dataSource.performQuery(sqlstatement)
rs.moveFirst()
I dont know which condition has to be set when the Resulset doesnt has any row. When I say rs.moveFirst() it sends me an error because there is no rows.I tried many things like:
rs = dataSource.performQuery(sqlstatement)
rs.moveFirst()
while rs.moveNext: --------->This part doesnt work,it enters even there is any row in the rs
result=rs.getrow()
for rows in result:
arr=str(rows.atrr_value)
try:
rs.moveNext()
except:
print"End of loop"
I dont know what else to do in order to break the loop if the rs has no row. What could be a solution?
Thank you for your help!