deleteprotect.java

来自「宠物医院管理系统 包含宠物的注册 管理 收费 诊断等一系列过程控制 还包含配应」· Java 代码 · 共 31 行

JAVA
31
字号
package yd.pethospital.protectcommom;

import java.sql.*;
import yd.pethospital.share.SystemShare;
import yd.pethospital.protectregister.view.ProtectRegister;

public class DeleteProtect {
	
	public DeleteProtect(){
		try {
			
			SystemShare.getConnection();
			SystemShare.pst=SystemShare.con.prepareStatement("select * from EpidemicInfo ",ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
			
			SystemShare.rs=SystemShare.pst.executeQuery();                                      //rs用于返回SQL语句对数据库的查询等操作  
			SystemShare.rs.absolute(ProtectRegister.BTCK.getSelectedRow()+1);               //记录被选择的行
			
			SystemShare.con.prepareStatement("delete EpidemicInfo where petcode="+SystemShare.rs.getString("petcode")).executeUpdate();   //调用preparement方法进行数据库操作
			ProtectRegister.frame.dispose();
			SystemShare.delsuccess();
			
			new ProtectRegister();
			
		}catch (SQLException e) {
			SystemShare.delfail();
		}
		SystemShare.close();
	}
	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?