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


房间信息里面的是从数据库中调出来的.
把房间信息里面选中的行点击添加,加到开单房间的表中去!
****************************************************
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-8-6 22:58:11编辑过]



gRBdDLJm.png (119.38 KB)
搜索更多相关主题的帖子: 数据 
2007-08-06 22:56
无缘今生
Rank: 2
等 级:新手上路
威 望:3
帖 子:523
专家分:7
注 册:2007-6-25
得分:0 
首先获取在“房间表”中选中的列,然后再根据此信息的位置从数据库中提取。

时不再来!!!
2007-08-08 15:23



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




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

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