1.加载驱动
Class.forName(“org.sqlite.JDBC”)
2.创建连接
Connection cn=null;
cn=DriverManager.getConnection("jdbc:sqlite:Student.db);
3.Statement stmt=null;
stmt=cn.createStatement();
stmt.excuteUpdate(“语句”);
加载驱动,用驱动器取得连接,用连接创造statement实例化对象,用stmt执行语句
1.加载驱动
Class.forName(“org.sqlite.JDBC”)
2.创建连接
Connection cn=null;
cn=DriverManager.getConnection("jdbc:sqlite:Student.db);
3.Statement stmt=null;
stmt=cn.createStatement();
stmt.excuteUpdate(“语句”);
加载驱动,用驱动器取得连接,用连接创造statement实例化对象,用stmt执行语句