java - ORA-01858 insert log in database -
i writing class in application insert logs oracle database. have used log4j. made these configurations:
<appender name="db" class="org.apache.log4j.jdbc.jdbcappender"> <param name="url" value="jdbc:oracle:thin:@10.60.2.8:1521:dbname"/> <param name="driver" value="oracle.jdbc.driver.oracledriver"/> <param name="user" value="test"/> <param name="password" value="test"/> <layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="insert log_overloadrequest values('%x{today}','%x {currentrequesturi}','%x {username}','%x {uri}','%x {method}','%x {cpuload}','%x {timespent}','%x {lastcpuload}','%x {firstfreememory}','%x {lastfreememory}','%x {appid}','%x {sessionid}')"/> </layout> </appender>
here codes in class:
private logger overloadrequestdb=logger.getlogger("log4j.rootlogger"); timestamp today = new timestamp(system.currenttimemillis()); mdc.put("today", today); mdc.put("currentrequesturi", currentrequesturi); mdc.put("username", "test"); mdc.put("uri", currentrequesturi); mdc.put("method", "test"); mdc.put("cpuload",1234); mdc.put("timespent", 1234); mdc.put("lastcpuload", 123); mdc.put("firstfreememory", 123); mdc.put("lastfreememory", 123); mdc.put("appid", 1); mdc.put("sessionid","123"); overloadrequestdb.debug("test"); overloadrequestdb.info("test");
when run application face error: ora-01858: non-numeric character found numeric expected
i think ths related date, did don't know problem is.
Comments
Post a Comment