public class RSHanlderDemo {
//ScalarHandler:获取结果集中第一行数据指定列的值,常用来进行单值查询
@Test
public void tes9() throws SQLException{
QueryRunner runner = new QueryRunner(new ComboPooledDataSource());
Long count = (Long)runner.query("select count(*) from account",new ScalarHandler());
System.out.println(count);
}
//KeyedHandler(name):将结果集中的每一行数据都封装到一个Map里(List
1.增加:insertinto 表 (列名,列名...) values (值,值,值...)
insertinto 表 (列名,列名...) values (值,值,值...),(值,值,值...)
insertinto 表 (列名,列名...) select (列名,列名...) from 表2.删除:deletefrom 表
deletefrom 表 where id=1and name=‘alex‘3.修改:update 表 set name = ‘alex‘where id>14.查询:select*from 表
select*from 表 where id >1select nid,name,gender as gg from 表 where id >15.补充a、条件s...
数据库管理
登陆MySQL[root@lynn-04 conf]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.35-log MySQL Community Server (GPL)Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademark...