大家不要笑我,提个弱智的问题先~
emoam 2003-07-01 09:48:55
以前我写后台的,现在没人写前台,我没事做的时候就写写前台喽,哪里一弄就到处出问题了。
听我慢慢道来啊。
我先在后台写了一个类,想法当然是在前台来调用这个类。
我想把这个类在窗口刚刚打开的时候实现初始化的,其中有这么一段,就是调用类的那一段,死活运行不下去了,情况如下:
currenquery cq = new currenquery();
String str_itemname = null;
ResultSet rs_items = null;
rs_items = cq.InsertItembytablename("campany");
try {
if (rs_items == null) {
System.out.println("rs is null");
}
else {
System.out.println("rs is not null");
}
}
catch (Exception exx) {
System.out.println(exx.toString());
}
System.out.println("run to here");
try {
System.out.println("run to try");
while(rs_items.next()) {
System.out.println("run to while");
str_itemname = rs_items.getObject(1).toString();
System.out.println("run to here2");
//FieldsBox1.addItem(str_itemname);
FieldsBox1.insertItemAt(str_itemname, 0);
System.out.println("run to here3");
System.out.println("插入一个字段:" + str_itemname);
}
}
catch (Exception ex) {
System.out.println("运行异常,结果集可能为空");
}
运行结果如下:
rs is not null
run to here
run to try
不知道怎么着,我在后台写了一个main函数,运行得好好的,可以一直运行到最后,但在前台的时候,却怎么也只能运行到“run to try” ,后面的就不行了。。。
我都要急死了,讨厌死做前台啦,555555555555555,哪位GGJJ有耐心的帮我看一下,如果知道的,一定要告诉我啊。。。