标题:[求助]从表中提取一行数据
只看楼主
scamp0510
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-4-19
 问题点数:0 回复次数:0 
[求助]从表中提取一行数据




房间信息里面的是从数据库中调出来的.
把房间信息里面选中的行点击添加,加到开单房间的表中去!
****************************************************
public void jComboBox1_actionPerformed(ActionEvent e) {
String aa=jComboBox1.getSelectedItem().toString();
for(int j=0;j<30;j++){
for (int i = 0; i < table.getRowCount(); i++) {
table.removeRow(i);
}
}
try {
Statement s = numclass.numclass().createStatement();
ResultSet rs = s.executeQuery("select idroom,yumoney from room where room1='"+aa+"'");
while(rs.next()){
Object[] cells={rs.getString(1),rs.getString(2)};
table.addRow(cells);
}

} catch (SQLException ex1) {
}
}
public void jButton1_actionPerformed(ActionEvent e) {
int a=jTable1.getSelectedRow();
int b=jTable1.getSelectedColumn();
//table.getValueAt(a,table[b]);
//table1.insertRow(jTable1.getSelectedRow());
}

}
怎么提取房间信息表中的数据

搜索更多相关主题的帖子: 数据 
2007-08-06 22:49



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-160812-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015403 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved