SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also http://www.slf4j.org/codes.html#log4j_version
0 DEBUG [main] org.apache.ibatis.logging.LogFactory - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
31 DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource - PooledDataSource forcefully closed/removed all connections.
31 DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource - PooledDataSource forcefully closed/removed all connections.
31 DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource - PooledDataSource forcefully closed/removed all connections.
31 DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource - PooledDataSource forcefully closed/removed all connections.
140 DEBUG [main] org.apache.ibatis.transaction.jdbc.JdbcTransaction - Opening JDBC Connection
483 DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource - Created connection 6259058.
483 DEBUG [main] com.te.mybatis.persitence.ifance.PersonDao.insertperson - ooo Using Connection [com.mysql.jdbc.JDBC4Connection@5f8172]
483 DEBUG [main] com.te.mybatis.persitence.ifance.PersonDao.insertperson - ==> Preparing: insert into person(username) values('tomcat23')
530 DEBUG [main] com.te.mybatis.persitence.ifance.PersonDao.insertperson - ==> Parameters:
530 DEBUG [main] org.apache.ibatis.transaction.jdbc.JdbcTransaction - Rolling back JDBC Connection [com.mysql.jdbc.JDBC4Connection@5f8172]561 DEBUG [main] org.apache.ibatis.transaction.jdbc.JdbcTransaction - Resetting autocommit to true on JDBC Connection [com.mysql.jdbc.JDBC4Connection@5f8172]
561 DEBUG [main] org.apache.ibatis.transaction.jdbc.JdbcTransaction - Closing JDBC Connection [com.mysql.jdbc.JDBC4Connection@5f8172]
561 DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource - Returned connection 6259058 to pool.
运行插入语句始终不能成功,但是一直没有注意这个语句
530 DEBUG [main] org.apache.ibatis.transaction.jdbc.JdbcTransaction - Rolling back JDBC Connection [com.mysql.jdbc.JDBC4Connection@5f8172]
想一想在insert里面也没有用到事务啊,不知道是什么原因?
在执行语句出添加事务提交 就可以插入成功 ,
SqlSession sqlsesstion = sc.openSession();
sqlsesstion.insert("insertperson", person);
sqlsesstion.commit(); //还不知道是什么原因要提交事务才可以插入数据成功,但是每一次似乎都对数据库产生了影响
sqlsesstion.close();
有一点乱 !!!