SQL语句:增、删、改、查
增:insert into ? values(?,?)
删:delete from where ?=?
改:update ? set ?=? where ?=?
查:select ? from ?
程序连接、操作数据库:
1、加载驱动:Class.forName(“路径”);
2、创建连接:Connection conn = DriverManager.getConnection(“数据库路径”,”用户名”,”登陆密码”);连接成功
3、嵌入SQL语句:Statement stmt = conn.createStatement();
4、执行SQL语句:ResultSet rs = stmt.executeQuery(“SQL语句”);