private void createNewID(Connection con, int type) throws SQLException {
        Log.warn("Autocreating jiveID row for type '" + type + "'");

        // create new ID row
        PreparedStatement pstmt = null;

        try {
            pstmt = con.prepareStatement(CREATE_ID);
            pstmt.setInt(1, type);
            pstmt.execute();
        }
        finally {
            DbConnectionManager.closeStatement(pstmt);
        }
    }
Performs a lookup to get the next available ID block. The algorithm is as follows:
<ol>
<li> Select currentID from appropriate db row.
<li> Increment id returned from db.
<li> Update db row with new id where id=old_id.
</ol>

Calls to this method should only occur while a lock has already been acquired.

@return the next available ID block
xmppserver/src/main/java/org/jivesoftware/database/SequenceManager.java