StringBuffer itb = new StringBuffer( "jiqlAutoIncrementInt_").append(sqp.getTable());
JGNameValuePairs o = JIQLGDataUtil.getWhereEqual(itb.toString(),"tablefield",f);
Transaction trans = null;
try{
//(f + " getAutoIncrementInt " + o);
if (o != null)
{
ct = o.getInt("incrementvalue") + 1;
Hashtable h = null;
while (true){
h = readTableValueWhereEqual(sqp,sqp.getTable(),f,new Integer(ct));
if (h == null || h.size() < 1)
break;
ct = ct + 1;
}
Hashtable hash = new Hashtable();
hash.put("tablefield",f);
hash.put("incrementvalue",ct);
//trans = JIQLGDataUtil.getTransaction();
JIQLGDataUtil.update(itb.toString(),hash,o.getKeyId());
//trans.commit();
}
else{
ct = ct + 1;
Hashtable hash = new Hashtable();
hash.put("tablefield",f);
hash.put("incrementvalue",ct);
JIQLGDataUtil.put(itb.toString(),hash) ;
}
//trans.commit();
}catch (Exception e){
if (trans != null)
trans.rollback();
e.printStackTrace();
///(e);
throw new SQLException(e.toString());
}