?? table.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 + -