
数据库
Bean冷的心
不要害怕被利用,利用你,证明你有利用价值。
展开
-
MySQL指令大全
-- 创建数据库 create database name; -- 创建数据表 create table name( id int not null primary key auto_increment, name varchar(20) ); -- 查询所有 select * from tablename; -- 不重复查询某一列 distinct select DISTINCT na...原创 2019-08-14 16:06:19 · 1217 阅读 · 2 评论 -
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested
使用新版的Mysql连接jdbc,经常会报这个异常,只需要在 设置URL的时候后面加上:?serverTimezone=GMT%2B8 <property name="url" value="jdbc:mysql://localhost:3306/selection_course?useUnicode=true&characterEncoding=utf-8?serverTi...原创 2019-08-13 12:02:53 · 6007 阅读 · 1 评论 -
Template中execute和update的区别
1、update可以带参数,而execute不可以。例如: jdbcTemplate.update(“update TableA set name = 'Andy’ where id=?”, new Object[] {new Integer(3)}); jdbcTemplate.execute(“update TableA set name = 'Andy’ where id=3”); 2、up...转载 2019-08-13 12:07:57 · 2222 阅读 · 1 评论