读一个文件(每行是一条记录,一共60040行),把每一行包装成一个LogBean,存放到Vector里面,
然后把Vector 传给数据库连接,
每行对应一个数据库的insert纪录。
就是说读出所有行,然后insert 到数据库中。
[code="java"]
Vector list = new Vector();
String[] nextLine;
while ((nextLine = reader.readNext()) != null) {
LogBean bean = new LogBean();
bean.setName(nextLine[0]);
bean.setID(nextLine[1]);
bean.setTEAM("TEAM");
bean.setSUB_TEAM("SUBTEAM");
list.add(bean);
rows++;
}[/code]
是在web叶面上处理的。
Tomcat 报错了, 我看了一下报错的文件有60040行 ,就是说我的vector的size 是60040,是不是这会导致outOfMemory?
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.OutOfMemoryError: Java heap space
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.