Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

log4j JDBCAppender  RSS feed

 
Lalit mishra
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I am new to Log4j can any one send me a sample code for JdbcAppender
I will be really greatful

Thanks
Lalit
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See if these help:

Log4j JDBCAppender

JDBCAppender Example
 
Yeshokiran Nrusimhadevara
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran Pai wrote:See if these help:

Log4j JDBCAppender

JDBCAppender Example


Hi I have used the following set of statements. However this doesnot execute the sql and DB insertions are not successful.
JDBCAppender jDBCAppender = new JDBCAppender();
jDBCAppender.setDriver("oracle.jdbc.driver.OracleDriver");
jDBCAppender.setURL("jdbcracle:thin:@I.P:instance");

jDBCAppender.setUser("username");

jDBCAppender.setPassword("pwd");

jDBCAppender.setSql(sql);

logger.addAppender(jDBCAppender);

jDBCAppender.close();


Please suggest if there are any additions required to the above set.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there and welcome to Javaranch!

Can you please ask your question in a new thread and post the exact contents of your configuration file please
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!