int nid = id == null ? -1 : id.intValue() + 1;
int current_id = id == null ? -1 : id.intValue();
    private static synchronized void assignId (TableRow row)        throws SQLException    {        String table = canonicalize(row.getTable());        String pk = getPrimaryKeyColumn(table);        Integer id = (Integer) ids.get(table);        int nid = id == null ? -1 : id.intValue() + 1;        if (id == null)        {            String sql = MessageFormat.format                ("select max({0}) from {1}",                 new Object[] { pk, table} );            Statement statement = null;            try            {                statement = getConnection().createStatement();                ResultSet results = statement.executeQuery(sql);                nid = results.next() ? results.getInt(1) : -1;            }            finally            {                if (statement != null)                {                    try                    {                        statement.close();                    }                    catch (SQLException sqle) {}                }            }        }        row.setColumn(pk, nid);        ids.put(table, new Integer(nid));    }