Galera como proceder pra retorna um int a partir desta consulta?
vlwww
public int getServiceNameCode(String shDes) throws SQLException {
int max;
try{
String strQuery = "select sncode from mpusntab " +
" where shdes = " + shDes;
Query query = this.getSession().createSQLQuery(strQuery);
[color=red]max = query.???????;[/color]
}catch(Exception e){
e.printStackTrace();
}
return max;
}