I have been tossing this problem for two days. Today I finally solved it with the help of a colleague (Zhangwei.
1. At first, no sequence s_log was created. Therefore, the sequence s_log must be added to Oracle.
<! -- Add logs -->
<Insert id = "logsave"
Parameterclass = "com. reportcenter. SYS. DTO. operatelogdto">
Insert
T_log (c_autoid, usrcde, usraddress, operation, begintme, endtme, operatetimer, state, message) values (S_log.nextval, # Usrcde #, # usraddress #, # operation #, # begintme #, # endtme #, # operatetimer #, # state #, # message #)
</Insert>
2. the following problem occurs: usrcde (user in the log tableCode) Attribute isNull Value. Therefore, the null value is added to the corresponding code. If it is null, The usercde value is obtained from the login page.
If (request. getsession (). getattribute (constants. usrcde) = NULL ){
USR= Request. getparameter ("Usercde");
} Else {
USR = (string) request. getsession (). getattribute (
Constants. usrcde );
}
Tomcat prompts the following error:
Info [org. springframework. Beans. Factory. xml. xmlbeandefinitionreader]-loading XML bean definitions from class path resource [ORG/springframework/jdbc/support/sql-error-codes.xml]
Info [org. Spring framework. JDBC. Support. sqlerrorcodesfactory]-sqlerrorcodes loaded: [DB2, Derby, H2, hsql, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
Org. springframework. JDBC. uncategorizedsqlexception: sqlmapclient operation; uncategorized sqlexception for SQL []; SQL State [null]; error code [17004];
--- The error occurred in sqlmap-mapping-log-operate.xml.
--- The error occurred while applying a parameter map.
--- Check the logsave-inlineparametermap.
--- Check the parameter mapping for the 'uscde' property.
--- Cause: Java. SQL. sqlexception: Invalid column type; Nested exception is com. ibatis. Common. JDBC. Exception. nestedsqlexception:
--- The error occurred in sqlmap-mapping-log-operate.xml.
--- The error occurred while applying a parameter map.
--- Check the logsave-inlineparametermap.
--- Check the parameter mapping for the 'uscde' property.
--- Cause: Java. SQL. sqlexception: Invalid column type
Caused by: COM. ibatis. Common. JDBC. Exception. nestedsqlexception:
--- The error occurred in sqlmap-mapping-log-operate.xml.
--- The error occurred while applying a parameter map.
--- Check the logsave-inlineparametermap.
--- Check the parameter mapping for the 'uscde' property.
--- Cause: Java. SQL. sqlexception: Invalid column type
At com.ibatis.sqlmap.engine.mapping.statement.generalstatement.exe cuteupdate (generalstatement. Java: 91)
At com. ibatis. sqlmap. Engine. impl. sqlmapexecutordelegate. insert (sqlmapexecutordelegate. Java: 447)
At com. ibatis. sqlmap. Engine. impl. sqlmapsessionimpl. insert (sqlmapsessionimpl. Java: 82)
At org. springframework. Orm. ibatis. sqlmapclienttemplate $9. doinsqlmapclient (sqlmapclienttemplate. Java: 370)
At org.springframework.orm.ibatis.sqlmapclienttemplate.exe cute (sqlmapclienttemplate. Java: 194)
At org. springframework. Orm. ibatis. sqlmapclienttemplate. insert (sqlmapclienttemplate. Java: 368)
At com. reportcenter. SYS. Dao. operatelogdaoimpl. Save (operatelogdaoimpl. Java: 41)
At com. reportcenter. SYS. Service. syslogserviceimpl. Save (syslogserviceimpl. Java: 52)
At com. reportcenter. util. DB. log. Log (log. Java: 61)
At com. reportcenter. SYS. Service. baseservice. doservice (baseservice. Java: 92)
At com. reportcenter. SYS. Controller. logincontroller. handlerequestinternal (logincontroller. Java: 42)
At org. springframework. Web. servlet. MVC. abstractcontroller. handlerequest (abstractcontroller. Java: 153)
At org. springframework. Web. servlet. MVC. simplecontrollerhandleradapter. Handle (simplecontrollerhandleradapter. Java: 48)
At org. springframework. Web. servlet. dispatcherservlet. dodispatch (dispatcherservlet. Java: 858)
At org. springframework. Web. servlet. dispatcherservlet. doservice (dispatcherservlet. Java: 792)
At org. springframework. Web. servlet. frameworkservlet. processrequest (frameworkservlet. Java: 476)
At org. springframework. Web. servlet. frameworkservlet. dopost (frameworkservlet. Java: 441)
At javax. servlet. http. httpservlet. Service (httpservlet. Java: 710)
At javax. servlet. http. httpservlet. Service (httpservlet. Java: 803)
At org. Apache. Catalina. Core. applicationfilterchain. internaldofilter (applicationfilterchain. Java: 290)
At org. Apache. Catalina. Core. applicationfilterchain. dofilter (applicationfilterchain. Java: 206)
At com. reportcenter. util. loginfilter. dofilter (loginfilter. Java: 42)
At org. Apache. Catalina. Core. applicationfilterchain. internaldofilter (applicationfilterchain. Java: 235)
At org. Apache. Catalina. Core. applicationfilterchain. dofilter (applicationfilterchain. Java: 206)
At org. springframework. Web. Filter. characterencodingfilter. dofilterinternal (characterencodingfilter. Java: 96)
At org. springframework. Web. Filter. onceperrequestfilter. dofilter (onceperrequestfilter. Java: 75)
At org. Apache. Catalina. Core. applicationfilterchain. internaldofilter (applicationfilterchain. Java: 235)
At org. Apache. Catalina. Core. applicationfilterchain. dofilter (applicationfilterchain. Java: 206)
At org. Apache. Catalina. Core. standardwrappervalve. Invoke (standardwrappervalve. Java: 233)
At org. Apache. Catalina. Core. standardcontextvalve. Invoke (standardcontextvalve. Java: 175)
At org. Apache. Catalina. Core. standardhostvalve. Invoke (standardhostvalve. Java: 128)
At org. Apache. Catalina. Valves. errorreportvalve. Invoke (errorreportvalve. Java: 102)
At org. Apache. Catalina. Core. standardenginevalve. Invoke (standardenginevalve. Java: 109)
At org. Apache. Catalina. connector. coyoteadapter. Service (coyoteadapter. Java: 263)
At org. Apache. Coyote. http11.http11processor. Process (http11processor. Java: 844)
At org. Apache. Coyote. http11.http11protocol $ http11connectionhandler. Process (http11protocol. Java: 584)
At org.apache.tomcat.util.net. jioendpoint $ worker. Run (jioendpoint. Java: 447)
At java. Lang. thread. Run (thread. Java: 595)
Caused by: Java. SQL. sqlexception: Invalid column type
At oracle. JDBC. dbaccess. dberror. throwsqlexception (dberror. Java: 134)
At oracle. JDBC. dbaccess. dberror. throwsqlexception (dberror. Java: 179)
At oracle. JDBC. dbaccess. dberror. throwsqlexception (dberror. Java: 269)
At oracle. JDBC. Driver. oraclestatement. get_internal_type (oraclestatement. Java: 6164)
At oracle. JDBC. Driver. oraclepreparedstatement. setnull (oraclepreparedstatement. Java: 1316)
At org. Apache. commons. DBCP. delegatingpreparedstatement. setnull (delegatingpreparedstatement. Java: 105)
At com. ibatis. sqlmap. Engine. Mapping. Parameter. basicparametermap. setparameter (basicparametermap. Java: 171)
At com. ibatis. sqlmap. Engine. Mapping. Parameter. basicparametermap. setparameters (basicparametermap. Java: 125)
At com.ibatis.sqlmap.engine.execution.sqlexecutor.exe cuteupdate (sqlexecutor. Java: 79)
At com. ibatis. sqlmap. Engine. Mapping. Statement. generalstatement. sqlexecuteupdate (generalstatement. Java: 200)
At com.ibatis.sqlmap.engine.mapping.statement.generalstatement.exe cuteupdate (generalstatement. Java: 78)
... 37 more
Com. reportcenter. Exception. daoexception: Error. SYS. log. DB. Add; Nested exception is Org. springframework. JDBC. uncategorizedsqlexception: sqlmapclient operation; uncategorized sqlexception for SQL []; SQL State [null]; error code [17004];
--- The error occurred in sqlmap-mapping-log-operate.xml.
--- The error occurred while applying a parameter map.
--- Check the logsave-inlineparametermap.
--- Check the parameter mapping for the 'uscde' property.
--- Cause: Java. SQL. sqlexception: the column type is invalid;