I have a j2ee web app(jboss).I need to upload a text file with 10,000 lines to a table in database(MS SQL2000).the table has column:id and record,each line will stored in each row of record column,and id is a identity column.

since jboss and sql server on diffrent server,I don't want upload to jboss ,then use bcp to load file to database since both sql server and jboss need to have permission to access the file,the configuration is hard in the client.

I also tryed to use

ServletInputStream in = request.getInputStream();
in.readLine(line, 0, 128);
to get each line and construct string like :
insert into table(record) values(line)
but to construct string for 10,000 lines use all of cpu.
any idea? thank you.