java,ssh框架里遍历工作表插入数据到数据库没办法完整运行,也没有报错

原代码如下for (int i = 1; i < sheet.getRows(); i++) {
Integer stuId = Integer.parseInt( sheet.getCell(0, i).getContents());
System.out.println("插入第一行");
String name = sheet.getCell(1, i).getContents();System.out.println("插入第2行");
String nation = sheet.getCell(2, i).getContents();System.out.println("插入第3行");
String sex = sheet.getCell(3, i).getContents();System.out.println("插入第4行");
String birth =sheet.getCell(4, i).getContents();System.out.println("插入第5行");
String address = sheet.getCell(5, i).getContents();System.out.println("插入第6行");
Integer phone = Integer.parseInt( sheet.getCell(6, i).getContents());System.out.println("插入第7行");
Integer identity = Integer.parseInt( sheet.getCell(7, i).getContents());System.out.println("插入第8行");
String pwd = sheet.getCell(8, i).getContents();
System.out.println("插入第9行");
Studentinfo studentinfo = new Studentinfo(stuId, name, nation, sex, birth, address, phone, identity,pwd);
System.out.println("新建学生信息");
System.out.println("准备导入:"+ i +studentinfo.toString());
//保存数据
ses.save(studentinfo);
//每100条数据,提交一次。
if(i%100==0){
tx.commit();
System.out.println("已经导入第"+i/100+"批数据:"+ i +studentinfo.toString());
}图片说明

            有trycath
            try {
        //从指定文件,创建工作表
        book=Workbook.getWorkbook(file);
        //得到工作表
        Sheet sheet = book.getSheet(0);
        r=sheet.getRows()-1;
        //遍历工作表,插入数据到数据库
        for (int i = 1; i < sheet.getRows(); i++) {
            Integer stuId = Integer.parseInt( sheet.getCell(0, i).getContents());
            System.out.println("插入第一行");
            String name = sheet.getCell(1, i).getContents();System.out.println("插入第2行");
            String nation = sheet.getCell(2, i).getContents();System.out.println("插入第3行");
            String sex = sheet.getCell(3, i).getContents();System.out.println("插入第4行");
            String birth =sheet.getCell(4, i).getContents();System.out.println("插入第5行");
            String address = sheet.getCell(5, i).getContents();System.out.println("插入第6行");
            Integer phone = Integer.parseInt( sheet.getCell(6, i).getContents());System.out.println("插入第7行");
            Integer identity = Integer.parseInt( sheet.getCell(7, i).getContents());System.out.println("插入第8行");
            String pwd = sheet.getCell(8, i).getContents();
            System.out.println("插入第9行");
            Studentinfo studentinfo = new Studentinfo(stuId, name, nation, sex, birth, address, phone, identity,pwd);
            System.out.println("新建学生信息");
            System.out.println("准备导入:"+ i +studentinfo.toString());
            //保存数据
            ses.save(studentinfo);
            //每100条数据,提交一次。
            if(i%100==0){
                tx.commit();
                System.out.println("已经导入第"+i/100+"批数据:"+ i +studentinfo.toString());
            }
        }
        //不满100条时,提交
        tx.commit();
    } catch (BiffException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }catch (Exception e) {
    }

    return r;

应该是有异常把 你有没有try catch

有try catch
try {
//从指定文件,创建工作表
book=Workbook.getWorkbook(file);
//得到工作表
Sheet sheet = book.getSheet(0);
r=sheet.getRows()-1;
//遍历工作表,插入数据到数据库
for (int i = 1; i < sheet.getRows(); i++) {
Integer stuId = Integer.parseInt( sheet.getCell(0, i).getContents());
System.out.println("插入第一行");
String name = sheet.getCell(1, i).getContents();System.out.println("插入第2行");
String nation = sheet.getCell(2, i).getContents();System.out.println("插入第3行");
String sex = sheet.getCell(3, i).getContents();System.out.println("插入第4行");
String birth =sheet.getCell(4, i).getContents();System.out.println("插入第5行");
String address = sheet.getCell(5, i).getContents();System.out.println("插入第6行");
Integer phone = Integer.parseInt( sheet.getCell(6, i).getContents());System.out.println("插入第7行");
Integer identity = Integer.parseInt( sheet.getCell(7, i).getContents());System.out.println("插入第8行");
String pwd = sheet.getCell(8, i).getContents();
System.out.println("插入第9行");
Studentinfo studentinfo = new Studentinfo(stuId, name, nation, sex, birth, address, phone, identity,pwd);
System.out.println("新建学生信息");
System.out.println("准备导入:"+ i +studentinfo.toString());
//保存数据
ses.save(studentinfo);
//每100条数据,提交一次。
if(i%100==0){
tx.commit();
System.out.println("已经导入第"+i/100+"批数据:"+ i +studentinfo.toString());
}
}
//不满100条时,提交
tx.commit();
} catch (BiffException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}catch (Exception e) {
}

    return r;

在加个catch(Throwable e){
e.printStackTrace();
} 看看这个有没有异常信息抛出

楼上说的是书写格式,你得听,你得string又到了堆,jc没有那么快清理,还有你的jvm分配了多少的内存、是不是足够?