⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 booktype.java

📁 教材管理系统,一个完整的学校教材管理系统,可以作为大学生课程设计使用
💻 JAVA
字号:
package tom.bean;
import java.sql.*;
import java.util.*;
import tom.bean.Dbconnection;

public class Booktype {
     private int booktypeid;
	 private String booktype;
	 private String action;
	 private String condition;
     private ResultSet rs;
     private int rowcount;
     private String message;
     private int id;
     public Booktype() {
     	booktypeid=0;
     	booktype=null;
     	message=null;
    }
    //
    public void setAction(String s)
    {
    	action=s;
    }
    //
    public void setBooktypeid(int n)
    {
    	booktypeid=n;
    }
    public int getBooktypeid()
    {
    	return booktypeid;
    }
    //
    public void setBooktype(String s)
    {
    	booktype=s;
    }
    public String getBooktype()
    {
    	return booktype;
    }
    //
    public void setId(int n)
    {
    	id=n;
    }
    public int getId()
    {
    	return id;
    }
    public String getMessage()
    {
    	return message;
    }
    //
    public int getRowcount()
    {
    	return rowcount;
    }
    //
    public ResultSet booktypelist()
    {
    	condition="SELECT * from booktype order by booktypeid";
    	Dbconnection e=new Dbconnection();
        e.condb();
    	rs=e.select(condition);
    	rowcount=e.getRowcount();
        message=e.getMessage();
    	return rs;
    }
    //
    public void selectspec()
    {
    	condition="SELECT * from booktype where booktypeid="+booktypeid;
    	Dbconnection e=new Dbconnection();
        e.condb();
    	rs=e.select(condition);
    	try{
    		rs.next();
    		booktypeid=rs.getInt(1);
    		booktype=rs.getString(2);
    	}
    	catch(SQLException f){message="error";}
    }
    public void ManageBooktype()
    {
    	if(action.equals("add"))
    	condition="INSERT INTO booktype VALUES"+"("+booktypeid+","+"'"+booktype+"')";
        if(action.equals("edit"))
        condition="update booktype set booktypeid="+booktypeid+",booktype='"+booktype+"' where booktypeid="+id;
        if(action.equals("delete"))
        condition="DELETE FROM booktype WHERE booktypeid="+booktypeid; 
        Dbconnection e=new Dbconnection();	
        e.condb();
    	e.update(condition);
        message=e.getMessage();
    	  	
    }
    
}

⌨️ 快捷键说明

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