当前位置: 技术问答>java相关
帮帮忙,已经又几人答了,可还不对,分数送上122
来源: 互联网 发布时间:2015-03-10
本文导语: 这样一个问题:当JList中的选中项目改变时,我要把此记录的所有其它字段取出置于界面控件中,我写了以下代码: public void valueChanged(ListSelectionEvent evt) { String selList=(String)lstylrfwzl.getSelectedValue(); in...
这样一个问题:当JList中的选中项目改变时,我要把此记录的所有其它字段取出置于界面控件中,我写了以下代码:
public void valueChanged(ListSelectionEvent evt)
{
String selList=(String)lstylrfwzl.getSelectedValue();
int selList_jiequ_i=selList.indexOf("街区");
int selList_donghao_i=selList.indexOf("栋");
int selList_fanghao_i=selList.indexOf("号");
String selList_jiequ=selList.substring(0,selList_jiequ_i + 2);
String selList_donghao=selList.substring(selList_jiequ_i + 2,selList_donghao_i);
String selList_fanghao=selList.substring(selList_donghao_i + 1,selList_fanghao_i);
String sql11="select * from weiming.酒钢商业用房基本资料库 where 街区='" + selList_jiequ + "' and 栋号='" + selList_donghao + "' and 房号='" + selList_fanghao + "'";
try
{
ResultSet rs_detail=db_jiequ.rs_jiequ(sql11);
if (rs_detail.next())
{
/*
Object get_xiaoqu=(Object)rs_detail.getString("小区");
Object get_jiequ=(Object)rs_detail.getString("街区");
Object get_donghao=(Object)rs_detail.getString("栋号");
Object get_fwzk=(Object)rs_detail.getString("房屋状况");
Object get_syzt=(Object)rs_detail.getString("使用状态");
comxiaoqu.setSelectedItem(get_xiaoqu);
comjiequ.setSelectedItem(get_jiequ);
comdonghao.setSelectedItem(get_donghao);
comfwzk.setSelectedItem(get_fwzk);
comsyzt.setSelectedItem(get_syzt);
*/
txtfanghao.setText(String.valueOf(rs_detail.getInt("房号")));
txtjzmj.setText(String.valueOf(rs_detail.getInt("建筑面积")));
txtzjbz.setText(String.valueOf(rs_detail.getInt("租金标准")));
txtsymj.setText(String.valueOf(rs_detail.getInt("使用面积")));
}
}
catch(Exception ex)
{
System.out.println(ex.getMessage());
System.out.println(sql11);
}
}
运行情况是:
房号,建筑面积,租金标准都能显示,但项目列表框一直改变,不断触发此事件时:错误提示为
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数。
使用面积 一直出不来。
另外,我把上面的/* */去掉时,什么都出不来
完整的错误提示为:
Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='2'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='2'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='55'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='昌明街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='玉泉街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='昌明街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='55'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='2'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='55'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='昌明街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='玉泉街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='昌明街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='55'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='2'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='55'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='昌明街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='玉泉街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
请教
public void valueChanged(ListSelectionEvent evt)
{
String selList=(String)lstylrfwzl.getSelectedValue();
int selList_jiequ_i=selList.indexOf("街区");
int selList_donghao_i=selList.indexOf("栋");
int selList_fanghao_i=selList.indexOf("号");
String selList_jiequ=selList.substring(0,selList_jiequ_i + 2);
String selList_donghao=selList.substring(selList_jiequ_i + 2,selList_donghao_i);
String selList_fanghao=selList.substring(selList_donghao_i + 1,selList_fanghao_i);
String sql11="select * from weiming.酒钢商业用房基本资料库 where 街区='" + selList_jiequ + "' and 栋号='" + selList_donghao + "' and 房号='" + selList_fanghao + "'";
try
{
ResultSet rs_detail=db_jiequ.rs_jiequ(sql11);
if (rs_detail.next())
{
/*
Object get_xiaoqu=(Object)rs_detail.getString("小区");
Object get_jiequ=(Object)rs_detail.getString("街区");
Object get_donghao=(Object)rs_detail.getString("栋号");
Object get_fwzk=(Object)rs_detail.getString("房屋状况");
Object get_syzt=(Object)rs_detail.getString("使用状态");
comxiaoqu.setSelectedItem(get_xiaoqu);
comjiequ.setSelectedItem(get_jiequ);
comdonghao.setSelectedItem(get_donghao);
comfwzk.setSelectedItem(get_fwzk);
comsyzt.setSelectedItem(get_syzt);
*/
txtfanghao.setText(String.valueOf(rs_detail.getInt("房号")));
txtjzmj.setText(String.valueOf(rs_detail.getInt("建筑面积")));
txtzjbz.setText(String.valueOf(rs_detail.getInt("租金标准")));
txtsymj.setText(String.valueOf(rs_detail.getInt("使用面积")));
}
}
catch(Exception ex)
{
System.out.println(ex.getMessage());
System.out.println(sql11);
}
}
运行情况是:
房号,建筑面积,租金标准都能显示,但项目列表框一直改变,不断触发此事件时:错误提示为
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数。
使用面积 一直出不来。
另外,我把上面的/* */去掉时,什么都出不来
完整的错误提示为:
Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='2'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='2'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='55'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='昌明街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='玉泉街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='昌明街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='55'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='2'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='55'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='昌明街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='玉泉街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='昌明街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='55'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='2'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='爱民街区' and 栋号='2' and 房号='55'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='昌明街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='玉泉街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='雍平街区' and 栋号='6' and 房号='8'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='福民街区' and 栋号='3' and 房号='3'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='大众街区' and 栋号='1' and 房号='1'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='7'
[Oracle][ODBC]Invalid column number .
select * from weiming.酒钢商业用房基本资料库 where 街区='车站街区' and 栋号='2' and 房号='5'
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-01000: 超出打开光标的最大数
请教
|
以上是权宜之计,你在事件处理程序中重新触发了此事件。先用上面的程序看看效果。
找到触发事件ListSelectionEvent 的地方再想彻底的解决办法
找到触发事件ListSelectionEvent 的地方再想彻底的解决办法