Bug 50817 - The JDBCAppender can't insert log info like this:hello'world
Summary: The JDBCAppender can't insert log info like this:hello'world
Status: NEW
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: 1.2
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-22 09:33 UTC by haowei
Modified: 2011-08-01 17:44 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description haowei 2011-02-22 09:33:30 UTC
If the log content has the "'",then I can't insert into database.

for example:

log.info("hello'world");

then the error information:

log4j:ERROR Failed to excute sql
java.sql.SQLException: ORA-00917: 缺失逗号
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287)
	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:742)
	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:206)
	at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:945)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1167)
	at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1613)
	at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1578)
	at org.apache.log4j.jdbc.JDBCAppender.execute(ESBJDBCAppender.java:92)
Comment 1 haowei 2011-02-22 09:36:43 UTC
Use the jars:

classes12.jar
apache-log4j-1.2.16.jar
commons-logging-1.1.1.jar