酒店登录代码java javaweb酒店管理系统源代码

怎么用JAVA创建一个酒店管理系统登录界面tr align="right"
td用户名:/td
td
s:textfield name="name" onkeypress="if(window.event.keyCode==13){document.frm.password.focus();}"/
/td
/tr
tr
td密码:/td
tds:password name="password"onkeypress="if(window.event.keyCode==13){document.frm.rand.focus();}"/
/td
/tr
tr align="right"
td验证码: /td
td
s:textfield name="rand" size="5" onkeypress="if(window.event.keyCode==13){login();}"/s:textfield /td
/tr
tr
tdinput type="button" value="https://www.04ip.com/post/登陆"/td
/tr
求用Java写的网上订房程序 要有酒店类 房间类 客户类 订房记录类 模拟一个人订房操作酒店类
package fdsa;
public class Hotel {
private StringhotelID;
【酒店登录代码java javaweb酒店管理系统源代码】private String hotelName;
private String hoteladdess;
public StringgetHotelID() {
return hotelID;
}
public void setHotelID(StringhotelID) {
this.hotelID = hotelID;
}
public String getHotelName() {
return hotelName;
}
public void setHotelName(String hotelName) {
this.hotelName = hotelName;
}
public String getHoteladdess() {
return hoteladdess;
}
public void setHoteladdess(String hoteladdess) {
this.hoteladdess = hoteladdess;
}
public String getHotelPhone() {
return hotelPhone;
}
public void setHotelPhone(String hotelPhone) {
this.hotelPhone = hotelPhone;
}
private String hotelPhone;
}
客户类
public class Client{
private String clientName;
private String clientID;
public String getClientName() {
return clientName;
}
public void setClientName(String clientName) {
this.clientName = clientName;
}
public String getClientID() {
return clientID;
}
public void setClientID(String clientID) {
this.clientID = clientID;
}
}
房间类
public class Room{
private String roomID;
private HotelhotelID;
public String getRoomID() {
return roomID;
}
public void setRoomID(String roomID) {
this.roomID = roomID;
}
public Hotel getHotelID() {
return hotelID;
}
public void setHotelID(Hotel hotelID) {
this.hotelID = hotelID;
}
public String getRoomAmount() {
return roomAmount;
}
public void setRoomAmount(String roomAmount) {
this.roomAmount = roomAmount;
}
private String roomAmount;
}
登陆界面的java代码怎么写?import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
class LoginFrm extends JFrame implements ActionListener
{
JLabel lbl1=new JLabel("用户名");
JLabel lbl2=new JLabel("密码");
JTextField txt=new JTextField(15);
JPasswordField pf=new JPasswordField();
JButton btn1=new JButton("确定");
JButton btn2=new JButton("取消");
public LoginFrm()
{
this.setTitle("登陆");
JPanel jp=(JPanel)this.getContentPane();
jp.setLayout(new GridLayout(3,2,10,10));
jp.add(lbl1);jp.add(txt);
jp.add(lbl2);jp.add(pf);
jp.add(btn1);jp.add(btn2);
btn1.addActionListener(this);
btn2.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==btn1)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:MyDB","","");
Statement cmd=con.createStatement();
ResultSet rs=cmd.executeQuery("select * from loginAndpassword where login='"+txt.getText()+"' and password='"+pf.getText()+"'");

推荐阅读