• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

log4j JDBCAppender

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See if these help:

Log4j JDBCAppender

JDBCAppender Example
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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("jdbc:oracle: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.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic