太长,我比较重要的方法
.
.
.
//得到论坛公告信息
public ArrayList getTopicNews() {
ArrayList returnArray = new ArrayList();
try {
this.getConnection(); //连接数据库
String sqlStr = "select TITLE,CONTENT,TIME from BBS_TOPNEWS where id='1'";
rs = stmt.executeQuery(sqlStr);
rs.next();
boolean b0 = returnArray.add(rs.getString("TITLE"));//0
boolean b1 = returnArray.add(rs.getString("CONTENT"));//1
boolean b2 = returnArray.add(rs.getDate("TIME").toString());//2
}
catch (Exception e) {
System.out.println("MobileBBS1LKBean中的方法getTopicNews错误: " + e);
}
finally {
this.closeConnect(); //断开数据库
}
return returnArray;
}//end getTopicNews()
.
.
.
/*
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!把下面的这个空的方法一加上,上面的方法就出错:java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
把下面的这个空的方法一去掉则整个程序都没问题了。太奇怪了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
public void abc() {
/**@todo Complete this method*/
}///end addBBS()
.
.
.
//得到论坛公告信息
public ArrayList getTopicNews() {
ArrayList returnArray = new ArrayList();
try {
this.getConnection(); //连接数据库
String sqlStr = "select TITLE,CONTENT,TIME from BBS_TOPNEWS where id='1'";
rs = stmt.executeQuery(sqlStr);
rs.next();
boolean b0 = returnArray.add(rs.getString("TITLE"));//0
boolean b1 = returnArray.add(rs.getString("CONTENT"));//1
boolean b2 = returnArray.add(rs.getDate("TIME").toString());//2
}
catch (Exception e) {
System.out.println("MobileBBS1LKBean中的方法getTopicNews错误: " + e);
}
finally {
this.closeConnect(); //断开数据库
}
return returnArray;
}//end getTopicNews()
.
.
.
/*
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!把下面的这个空的方法一加上,上面的方法就出错:java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
把下面的这个空的方法一去掉则整个程序都没问题了。太奇怪了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
public void abc() {
/**@todo Complete this method*/
}///end addBBS()
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货