public void actionPerformed(ActionEvent arg0) {
publicvoidactionPerformed(ActionEventarg0){Stringname=t1.getText();Connectioncon=db.g...
public void actionPerformed(ActionEvent arg0) {
String name=t1.getText();
Connection con=db.getConnection();
try {
String sql="delete from as where name='"+name+"'";
statement=con.createStatement();/////////
int i=statement.executeUpdate(sql);///
} catch (SQLException e) {/////////
e.printStackTrace();
}finally{
db.close();
int i=...有什么作用?为什么是catch(SQLException)而不是Exception 展开
String name=t1.getText();
Connection con=db.getConnection();
try {
String sql="delete from as where name='"+name+"'";
statement=con.createStatement();/////////
int i=statement.executeUpdate(sql);///
} catch (SQLException e) {/////////
e.printStackTrace();
}finally{
db.close();
int i=...有什么作用?为什么是catch(SQLException)而不是Exception 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询