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

📄 table.java

📁 这个一个餐厅预定系统,可实现查询目前餐厅预订情况,实现餐桌预订以及就餐时为顾客调节餐桌的情况.
💻 JAVA
字号:
package bookingsystem;

import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.Connection;
import java.sql.SQLException;
/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class Table {
    private String  talno;
    private int places;
    private boolean region;
    private String state;

    public Table(String talno) {
        this.talno = talno;
        Connection cn = ConnectionDB.getCon();
        Statement st = null;
        ResultSet rs = null;
        try{
            String sql = "select TALNO,PLACES,REGION,STATE " +
                    "from T_TABLE where TALNo = '" + talno + "'";
            st =cn.createStatement();
            rs = st.executeQuery(sql);
            if(rs.next())
            {
                this.places = rs.getInt("places");
                this.region = rs.getBoolean("region");
                this.state = rs.getString("state");
            }

        }catch(SQLException  e){
           e.printStackTrace();
        }
        ConnectionDB.close(rs);
        ConnectionDB.close(st);
        ConnectionDB.close(cn);

    }
    public String gettalno()
    {
        return talno;
    }
    public int getplaces()
    {
        return places;
    }
    public boolean getRegion()
    {
        return region;
    }
    public String getState()
    {
        return state;
    }
    public void settalno(String talno)
    {
        this.talno = talno;
    }
    public void setplaces(int places)
    {
        this.places = places;
    }
}

⌨️ 快捷键说明

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