Am 14.03.2014 11:52, schrieb Davide Micheletti:
> Hi all, i've these code to know if the resultSet is empty
>
> sql = "SELECT MIN(date) FROM table1 WHERE date > " +data1;
>
> Statement s = conn.createStatement();
> ResultSet rset = s.executeQuery(sql);
>
> // it can be empty
> if(rset.next()){
> // DO SOMETHING
> } else {
> // DO OTHER THINGS
> }
>
> but if the resultSet is empty it isn't catched.. Why??
> is for the MIN() function in the SQL?? if yes what can i do??
Are you sure that this is the correct maillist you ask
this question? But to answer your question, you can do it e.g.
"select date from table1 where date > " + data1 + " order by 1 asc limit 1"
Please don't use this code productively since it's vulnerable
to SQL-injection-attacks.
Regards, Lothar
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.