long形字段的问题我曾经遇到过,如果要取long型字段的数值,必须见过处理。
添加新的方法:
/**
* Insert the method´s description here.
* Creation date: (2002-6-4 17:37:55)
*/
public static String getLargerString(java.io.Reader reader) throws Exception {
char[] content = new char[1024000];
char[] buffer = new char[1024];
int len = 0;
int off = 0;
int contentLen = 1024000;
while(true)
{
len = reader.read(buffer);
if( len == -1)
break;
if( off + len > contentLen )
{
char[] tmp = new char[contentLen + 1024000];
System.arraycopy(content, 0, tmp, 0, off);
content = tmp;
contentLen = contentLen + 1024000;
}
System.arraycopy(buffer, 0, content, off, len);
off = off + len;
}
return new String(content, 0, off);
}
在你的程序中需要加入这几段语句:
if(rs.next()){
java.io.Reader reader = (java.io.Reader)rs.getCharacterStream("N_TOTAL_POINT");
String strtmp = (String)getLargerString(reader);
}
这是取long型字段的方法,如果要在数据库中插入long型字段,也需要处理一下