public int nextIntValue() throws DataAccessException {
return (int) getNextKey();
}
nextIntValue将调用getNextKey获取自增int值
@Override
protected synchronized long getNextKey() throws DataAccessException{
if(this.maxId == this.nextId) {
/*
*Need to use straight JDBC code because we need to make sure that the insert andselect
*are performed on the same connection (otherwise we can't be sure thatlast_insert_id()
*returned the correct value)
*/
Connection con = DataSourceUtils.getConnection(getDataSource());
Statement stmt = null;
try{
stmt= con.createStatement();