I am getting this error that I can't quite wrap my head around. The code segment calls a mysql stored function that basically assigns an available id number.
This is the code:
try
{
CallableStatement call_proc = conn.prepareCall( "{ ? = call getAvailableId(?, ?) }" );
call_proc.registerOutParameter(1, Types.INTEGER);
call_proc.setString(2, tableName);
call_proc.setString(3, "vendor_id");
call_proc.execute();
int idNumber = call_proc.getInt(1);
vendor.setVendorID(idNumber);
call_proc.close();
}catch (SQLException s)
{
out.println(s.toString());
}
And testing has found that it crashes at cstmnt.execute() for some malicious reason. This is the exact error statement:
java.sql.SQLException: Invalid use of group function
Please help.