用jdbc实现的话类似下边的代码,希望可以帮到你
try{
Class.forName(driverName);
Connection con=DriverManager.getConnection(url,userName,password);
String sql=”delete from t_emp where id=?”;
PreparedStatement pst=con.prapareStarement(sql);
pst.setInt(id);
pst.executeUpdate();
catch( Exception e){
e.printStackTrace();
}