如下: String s[] = null;
int i = 0;
while (columnResult.next()) {
s[i] = columnResult.getString("name");
i++;
}
int i = 0;
while (columnResult.next()) {
s[i] = columnResult.getString("name");
i++;
}
String s[] = new String[MAX_LENGTH];这样分配空间之后也不行,调试的时候
s[i] = columnResult.getString("name");
直接就异常了
String s[];
s=new String[length];
然后再
s[0]=....调用
String string[]=new String9[Size];
这样才OK!
while (columnResult.next()) {
arr.add(columnResult.getString("NAME"));
}从数据库里得到的ResultSet一般用ArrayList来获取
开发时column名在定义的时候一般大写