首页  :: 新随笔  :: 管理

2012年4月28日

摘要: Spring为自增长主键值数据库中插入数据后,获得该插入数据的ID的代码示例:publicvoidaddForum(finalForumforum){finalStringsql="INSERTINTOt_forum(forum_name,forum_desc)VALUES(?,?)";KeyHolderkeyHolder=newGeneratedKeyHolder();getJdbcTemplate().update(newPreparedStatementCreator(){publicPreparedStatementcreatePreparedStatement(C 阅读全文

posted @ 2012-04-28 11:48 季枫 阅读(4539) 评论(0) 推荐(0)

摘要: 症状:添加外键保存,没有反映,不能查看到已经添加的外键。1、通过show engines查看对Innodb的支持: 显示为yes才是正确的。disabled就需要改配置2、停止数据库3、修改my.ini 把skip-innodb注释4、删文件 在数据库目录中把ibdata1、ib_logfile0、ib_logfile1 这三个文件删掉5、启动 start mysql 阅读全文

posted @ 2012-04-28 11:35 季枫 阅读(330) 评论(0) 推荐(0)

智读 | 成都会领科技有限公司官网 | 智读App下载 | 每天听本书的博客 | |