随笔分类 -  mysql

摘要:mysql> show variables like '%character%';+--------------------------+----------------------------+| Variable_name | Value ... 阅读全文
posted @ 2015-10-25 15:56 Tcool 阅读(1520) 评论(0) 推荐(0)
摘要:public TJb checkjbByschool(long id)throws ClassNotFoundException,SQLException { Class.forName("com.mysql.jdbc.Driver"); Connection conne... 阅读全文
posted @ 2015-08-13 15:33 Tcool 阅读(195) 评论(0) 推荐(0)
摘要:按时间倒序出所有的数据mysql> select id,id_no from torder where user = 8 order by createtime desc ;+----+------------------+| id | id_no |+----+------... 阅读全文
posted @ 2015-07-30 17:33 Tcool 阅读(713) 评论(0) 推荐(0)
摘要:首先,将按条件查询并排序的结果查询出来。 1 mysql> select accepttime,user,job from tuser_job where user =8 order by accepttime desc; 2 +---------------------+------+-----... 阅读全文
posted @ 2015-07-27 15:53 Tcool 阅读(7092) 评论(0) 推荐(0)
摘要:1 select DATE_FORMAT(createtime,'%Y-%m'),count(*) from test where user =8 group by DATE_FORMAT(createtime,'%Y-%m');//按月统计数据2 select DATE_FORMAT(create... 阅读全文
posted @ 2015-07-27 14:11 Tcool 阅读(6617) 评论(0) 推荐(0)
摘要:查了一下发现应用程序和mysql数据库建立连接,如果超过8小时应用程序不去访问数据库,数据库就断掉连接 。这时再次访问就会抛出异常。关于mysql自动断开的问题研究结果如下,1、c3p0、HikariCP等连接池配置。2、在自己的程序中插入定时访问数据库的方法,比如使用Timer,Quartz或者s... 阅读全文
posted @ 2015-07-23 18:58 Tcool 阅读(14209) 评论(1) 推荐(0)