加載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