加载JDBC-数据库驱动:java
try{ Class. forName("com.mysql.jdbc.Driver"); } catch(Exception e){}
链接数据库mysql
Connection con; String uri = "jdbc:mysql://192.168.100.1:3309/student?user=root&password=&useSSL=true"; try{ con = DriverManager.getConnection(uri); } catch(SQLException e){ System.out.println(e); }
条件与排序查询:git
where子语句:sql
select 字段 from 表名 where 条件数据库
更新 update 表 set 字段 = 新值 where <条件子句> 学习
添加 insert into 表(字段列表) values (对应的具体的记录)或insert into 表 values (对应的具体的记录命令行
删除 delete from 表名 where <条件子句> code