Development Environment: Redflag Server 4.1 DB2 8.1 Windows 2003 WebLogic 8.1 SP2 (I Personal Machine) Problem: The program has not been issued in the App connection method. But in the NET mode, it is always reported at an error when processing a large amount of data insertion. The error message is as follows: ----- Currently inserted detailed ID: 75353, specific project number: 3815, Nanxing four road light installation, civil engineering project ----- Currently inserted detailed ID: 75354, specific item number: 3829, three Holy River Her Surge Reconstruction (Nanhai Avenue ~ South Block) ----- Currently inserted Detail ID: 75355, Specific Item No .: 3840, San Holy River Surge Reconstruction (Nanxun ~ South Qi Road) ----- Current Insert Detail ID: 75356, specific item number: 3863, 2001 repair road asphalt ----- Currently inserted detailed ID: 75357, specific project number: 3872, South 1st Road (Nishi Bridge north Dhabi Road) Road , Drainage - add a detailed error message 2 -: nulljava.lang.nullpointerException at com.ibm.db2.jdbc.net.sqlexceptionGenerator.addWarning (Unknown Source)
at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code (UnknownSource) at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code (UnknownSource) at COM.ibm.db2.jdbc.net.DB2PreparedStatement.execute2 (Unknown Source) at COM.ibm.db2.jdbc.net.DB2PreparedStatement.executeUpdate (Unknown Source) at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate (PreparedStatement.java:94) at com.gever.pfms.budgetexe.index.dao. impl.IndexDetailDAOImpl.add (IndexDetailDAOImpl.java:299) at com.gever.pfms.budgetexe.index.dao.impl.IndexDetailDAOImpl.add (IndexDetailDAOImpl.java:429) at com.gever.pfms.budgetexe.index.bo. impl.IndexBOImpl.importAllBudget (IndexBOImpl.java:157) at com.gever.pfms.budgetexe.index.action.IndexAction.importIndex (IndexAction.java:101) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun. Reflect.nativeMethodAccessorImpl.invoke (NativeMethodaccessorImpl.java:39) at sun.reflect.deLegati ngMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke (Method.java:324) at cn.com.windy.struts.action.ActionBaseX.performMethod (ActionBaseX.java:130) at cn .com.windy.struts.action.ActionBaseX.execute (ActionBaseX.java:58) at org.apache.struts.action.RequestProcessor.processActionPerform (RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process (RequestProcessor.java: 274) at Org.Apache.Struts.Ation.ArtionsServlet.Process (ActionServlet.java:1435) at Org.Apache.Struts.At Org.Apache.Struts.At (ActionServlet.java: 523)
at javax.servlet.http.HttpServlet.service (HttpServlet.java:760) at javax.servlet.http.HttpServlet.service (HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl $ ServletInvocationAction.run (ServletStubImpl.java : 971) at weblogic.servlet.internal.ServletStubImpl.invokeServlet (ServletStubImpl.java:402) at weblogic.servlet.internal.TailFilter.doFilter (TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl. java: 27) at com.gever.pfms.util.SetCharacterEncodingFilter.doFilter (SetCharacterEncodingFilter.java:33) at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:27) at weblogic.servlet.internal.WebAppServletContext $ ServletInvocationAction .run (WebAppServletContext.java:6356) at weblogic.security.acl.internal.AuthenticatedSubject.doAs (AuthenticatedSubject.java:317) at weblogic.security.service.SecurityManager.runAs (SecurityManager.java:118) at weblogic .servlet.internal.WebAppServletContext.invokeServlet (WebAppServletContext.java:3635) at weblogic.servlet.internal.ServletRequestImpl.execute (ServletRequestImpl.java:2585) at weblogic.kernel.ExecuteThread.execute (ExecuteThread.java:197) at weblogic. kernel.ExecuteThread.run (ExecuteThread.java:170) is inserted into the program data I below: public int add (IndexDetailVO vo, Connection con) throws DefaultException, Exception {int ret = -1; PreparedStatement st = null; helper.setAutoClose ( False); try {
String sql = "INSERT INTO TINDEXDETAIL" "(FID, FJTXMBH, FJTXMMC, FYEAR, FDWID, FYSKMID, FZCXMID," "FYWKSID, FZJLYBH, FQZHJID, FYT, FWJYJ, FWJLJ, FINMONEY, FOUTMONEY," "FSFZFCG, FSFDAP , FSfbmys, FZBLYID, FZJXZID, FJFLXID, FTJLXID, "FZY, FTYPE, FZID, FDOWNSTATATE, FLAG" " " " " (?,?,?,?, ?, " "?,?,?,?,?,?,?,?,?,?, " "?,?,?,?,? ,?,?,?) "; if (con == null) system.out.println (" ----con is null ------ "); ST = Con.PrepareStatement (SQL );
System.out.println ("----- Current inserted Detail ID: Vo.getFID () ", specific item number: Vo.getfjtxmbH () " Vo.getfjtxmmc ());
IF (vol.getfid (). Equals (")) {vo.valueof (idManager.nextid (pubconstant.tindexdetail_id));}
/ / For the SQL parameter Numeric St.SETLONG (1, long.parselong (VO.GETFID ());
St.setstring (2, vol.getfjtxmbh (). Trim ()); st.setstring (3, vol.getfjtxmmc (). Trim ()); st.setstring (4, vol.getfyear (). Trim ()) IF (Vo.getfdWid ()! = Null &&! Vo.getfdWid (). Equals (")) st.setlong (5, long.parselong (volSfdwid ())); else st.setnull (5, Types.bigint;
IF (Vo.getFyskmid ()! = null &&! Vo.getfyskmid (). Equals (")) st.setlong (6, long.parselope (vol.getfyskmid ())); else st.setnull (6, Types .Bigint);
IF (vo.getfzcxmid ()! = null &&! Vo.getfzcxmid (). Equals (")) St.SETLONG (7, long.parselong ()); else St.Setnull (7, Types .Bigint); if (Vo.getfywksid ()! = Null&&&&vo.getfywksid (). Equals (")) st.setlong (8, long.parselong ()); else st.setnull (8, Types.bigint);
IF (vol.getfzjlybh ()! = null &&! Vo.getfzjlybh (). Equals (")) st.setlong (9, long.parselope (vol.getfzjlybh ())); Else St.setnull (9, Types .Bigint);
IF (Vo.getfqzhjid ()! = null &&! Vo.getfqzhjid (). Equals (")) st.setlong (10, long.parselong ()); else st.setnull (10, Types .Bigint); St.setString (11, vol.getfyt (). Trim ()); st.setstring (12, vol.getfwjyj (). Trim ()); st.setstring (13, voltfwjlj (). TRIM ());
IF (Vo.getfinMoney ()! = null &&! Vo.getfinMoney (). Equals (")) St.SetDouble (14, double.Parsedouble (Vo.getfinMoney ()); else St.setnull (14, Types .Double); if (Vo.getfoutMoney ()! = Null&&! Vo.getfoutMoney (). Equals (")) st.setdouble (15, double.parsedouble (volutmoney ()); else St.setnull (15, Types.double);
St.setString (16, vol.getfsfzfcg (). Trim ()); st.setstring (17, vol.getfsfdap (). Trim ()); st.setstring (18, volbmys (). Trim ()) ;
IF (Vo.getfzblyid ()! = null &&! Vo.getfzblyid (). Equals ("")) st.setlong (19, long.parselope ()); Else St.setnull (19, Types .Bigint);
IF (Vo.getfzjxzid ()! = null &&! Vo.getfzjxzid (). Equals (")) st.setlong (20, long.parselong ()); else st.setnull (20, Types .Bigint); if (vo.getfjflxid ()! = Null&&! Vo.getfjflxid (). Equals (")) st.setlong (21, long.parselong ()); else st.setnull (21, Types.bigint);
IF (Vo.Getftjlxid ()! = null &&! Vo.getftjlxid (). Equals (")) st.setlong (22, long.parselong (vol.getjlxid ()); else st.setnull (22, Types .Bigint);
St.setString (23, vol.getfyt (). Trim ()); st.setstring (24, vol.getFTYPE (). Trim ()); st.setlong (25, long.parselong (Vo.getfzid ()) );
IF (Vo.getfgroupID ()! = null &&! Vo.getfgroupId (). Equals (")) st.setlong (26, long.parselong (volSfGroupID ()); else st.setnull (26, Types .Bigint);
St.setstring (27, vol.getfdriect (). TRIM ());
IF (Vo.getFoldIndex ()! = null &&! Vo.getFoldIndex (). Equals (")) st.setlong (28, long.parselong (vol.getFoldIndex ()); else st.setnull (28, Types .Bigint);
St.setstring (29, voltfdownstate (). Trim ()); st.setstring (30, voltftype (). Trim ());
IF (ST == NULL) System.out.println ("- st null -:"); ret = st.executeUpdate ();} catch (sqlexception e) {RET = -1; con?rollback (); system .out.println ("- Add fine error message 1 -:" E.GETLOCALIZEDMESSAGE ()); system.out.println ("- error code 1 -:" E.GETERRORCODE () "/" E.GETSQLSTATE ()); E.PrintStackTrace (System.out);} cat = -1; con?rollback (); system.out.println ("- Add Detail error message 2 -: " E.GETLOCALIZEDMESSAGE ()); E.PrintStackTrace (System.out); throw new defaultException (E.GetMessage (), defaultException.Error);} finally {try {if (st! = null) st.close () ;} Catch (sqlexception e) {E.PrintStackTrace (System.out);} // system.out.println ("------- Increase from the table ---------: " RET); Return Ret;}
}