📄 deletediagnose.java
字号:
package yd.pethospital.diagnose.jdbc;
import java.sql.*;
import yd.pethospital.share.SystemShare;
import yd.pethospital.diagnoseregister.view.*;
public class DeleteDiagnose {
public DeleteDiagnose(){
try {
SystemShare.getConnection();
SystemShare.pst=SystemShare.con.prepareStatement("select * from DiagnoseInfo ",ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
SystemShare.rs=SystemShare.pst.executeQuery(); //rs用于返回SQL语句对数据库的查询等操作
SystemShare.rs.absolute(DiagnoseRegister.BTCK.getSelectedRow()+1); //记录被选择的行
SystemShare.con.prepareStatement("delete DiagnoseInfo where petcode="+SystemShare.rs.getString("petcode")).executeUpdate(); //调用preparement方法进行数据库操作
DiagnoseRegister.frame.dispose();
SystemShare.delsuccess();
new DiagnoseRegister();
}catch (SQLException e) {
SystemShare.delfail();
}
SystemShare.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -