从报错看来,是在执行
InsertObject.executeUpdate("insert into datecolletion " ...
语句时没有catch(java.sql.SQLException)错误所致,但从你贴出的代码看来,没有这一句,是否还有代码没贴出,看看那些代码是否这个错误。

解决方案 »

  1.   

    1. For Statement object, executeQuery method throws SQLExcpetion.
    public ResultSet executeQuery(String sql)
                           throws SQLException
    2. So, you must catch it.
    try {
    InsertObject.executeUpdate("insert into datecolletion ...");
    }
    catch (SQLException slqe){
    }
      

  2.   

    当然可以 throw Exception 
    不一定是 throw SQLException try {
    InsertObject.executeUpdate("insert into datecolletion ...");
    }
    catch (SQLException sqle){
          //出错处理。
          System.out.println(sqle.toString());
          // %><%= sqle.toString() %><%
    }或者try {
    InsertObject.executeUpdate("insert into datecolletion ...");
    }
    catch (Exception e){
      //出错处理。 
    }