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

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -