Checking if SELECT statement returns Empty set in Java, Mysql -
i filled array using .split(" ") on string containing paragraph of text scanned webpage. insert each element of array table if said word not exist in table. each word should exist in table once.
i using following statement check if word exists in table already:
select * table word = "**word check for**";
in java program, how can check if statement returns empty set or not? i.e. condition of if statement? check if above select query returns 0 rows?
thanks,
if resultset.next() returns true word present in table , no need check number of rows.
this way query db 2 times. rather consider using stored procedure.
Comments
Post a Comment