一个jsp的课程设计:电子商务网站
源代码在线查看: room.java
/*
* room.java
*
* Created on 2007年11月18日, 下午12:29
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package dbpack;
import java.sql.SQLException;
/**
*
* @author weiyunbo
*/
public class room {
private StringBuffer str=new StringBuffer();
/** Creates a new instance of room */
public room() {
try {
dbConnect db=new dbConnect();
db.rs=db.sat.executeQuery("select top 4 * from room");
while(db.rs.next()){
str.append(""+db.rs.getString("roomname")+"");
}
db.doClose();
} catch (SQLException ex) {
ex.printStackTrace();
}
}
public StringBuffer getStr() {
return str;
}
public void setStr(StringBuffer str) {
this.str = str;
}
}