当前位置:Gxlcms > 数据库问题 > jdbc执行Statement接口的步骤

jdbc执行Statement接口的步骤

时间:2021-07-01 10:21:17 帮助过:23人阅读

    5)执行sql语句:

stsm.executeUpdate(sql);

    6)输出:

    7)关闭连接:

 1 if (stsm != null) {
 2             try {
 3                 stsm.close();
 4             } catch (SQLException e) {
 5                 // TODO Auto-generated catch block
 6                 e.printStackTrace();
 7                 throw new RuntimeException(e);
 8             }
 9         }
10 
11         if (conn != null) {
12             try {
13                 conn.close();
14             } catch (SQLException e) {
15                 // TODO Auto-generated catch block
16                 e.printStackTrace();
17                 throw new RuntimeException(e);
18             }
19         }

 

  

jdbc执行Statement接口的步骤

标签:word   jdbc   mysql   sql   步骤   catch   date   throw   sts   

人气教程排行