随笔分类 - 代码
代码连接--lankerens
摘要:``` @Test public void testStatement() throws Exception { // 1. 获取数据库连接 Connection conn = null; Statement statement = null; try { conn = getConnection2(); // 3. 准备插入的 SQL 语句 Strin...
阅读全文
posted @ 2019-07-07 01:45
烂科人
摘要:``` /* * 通过 JDBC 向指定的数据表中插入一条记录。 * */ @Test public void testStatement() throws Exception { // 1. 获取数据库连接 Connection conn = getConnection2(); // 3. 准备插入的 SQL 语句 String sql = "in...
阅读全文
posted @ 2019-07-07 01:40
烂科人
摘要:``` @Test public void testGetConnection2() throws Exception { System.out.println(getConnection2()); } public Connection getConnection2() throws Exception { // 1. 准备连接数据库的 4 个字符串 // 1) 创...
阅读全文
posted @ 2019-07-05 22:43
烂科人

浙公网安备 33010602011771号