长春大学宾馆客房管理系统数据库课程设计说明书
conn=DBHelper.getConnection();
ps=conn.prepareStatement("select*fromRoomCatogrywhere
RoomID='"+roomid+"'");
ResultSetrs=ps.executeQuery();
introws=0;
while(rs.next()&&rs.getRow()>0){
Vector<String>//遍历结果集row=newVector<String>();//创建存放记录的hang向量
rows++;//为记录向量赋值
for(intcol=1;col<=rs.getMetaData().getColumnCount();col++){//全部
记录!!!
row.add(rs.getString(col));
}
vector.add(row);
}
if(rows>0){
JOptionPane.showMessageDialog(null,"查询到了"+rows+"条数据!");
}else{
JOptionPane.showMessageDialog(null,"没有查询到数据!");
}
returnvector;
}catch(Exceptione){
JOptionPane.showMessageDialog(null,"查询失败!\n"+e.getMessage());
returnnull;
}finally{
DBHelper.close(conn,ps);
}
}
}catch(Exceptionex){
JOptionPane.showMessageDialog(null,"查询失败!\n"+ex.getMessage());
returnnull;
第-11-页共33页
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库宾馆客房管理系统数据库课程设计说明书(13)在线全文阅读。
相关推荐: