信息编码的具体含义是什么

来源:百度知道 编辑:UC知道 时间:2024/05/29 06:58:02

import java.sql.*;

public class ZqHotel1 {
public void hellosql(String yhm,String hotelname,String roomstyle,String roomprice,String hoteldate,String roomnumber) {

try{Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();}
catch(Exception e){}
String user="sa";
String password="12161216";
Connection con=DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=zq",user,password);
Statement stmt = con.createStatement();

stmt.executeUpdate("insert into hotel(yhm,hotelname,roomstyle,roomprice,hoteldate,roomnumber) values('"+yhm+"','"+hotelname+"','"+roomstyle+"','"+roomprice+"','"+hoteldate+"','"+roomnumber+"')");
stmt.close();
con.close();
}

}