aspose file tools*
The moose likes Other Open Source Projects and the fly likes  log4j JDBCAppender Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark " log4j JDBCAppender " Watch " log4j JDBCAppender " New topic
Author

log4j JDBCAppender

Lalit mishra
Ranch Hand

Joined: Sep 01, 2005
Posts: 99
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
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

See if these help:

Log4j JDBCAppender

JDBCAppender Example


[My Blog] [JavaRanch Journal]
Yeshokiran Nrusimhadevara
Greenhorn

Joined: Apr 27, 2010
Posts: 1
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.


Thanks,
Yeshokiran
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j JDBCAppender