GeeCON Prague 2014*
The moose likes Other Open Source Projects and the fly likes Database connection through Log4j Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Other Open Source Projects
Reply locked New topic
Author

Database connection through Log4j

indu yeturu
Ranch Hand

Joined: Aug 27, 2008
Posts: 123
Hi

am trying to connect to oracle database with log4j.properties file

og4j.appender.A2=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.A2.Driver=oracle.jdbc.driver.OracleDriver
log4j.appender.A2.URL=jdbc racle:thin:@localhost:1521:Indu
log4j.appender.A2.user=scott
log4j.appender.A2.password=indu
log4j.appender.A2.sql=insert into Testing values('English','B')
log4j.appender.A2.layout=org.apache.log4j.PatternLayout

and am getting the error

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

and am able to connect to database with some javaclass with the same details as I supplied to log4j properties file..

thanks
indu


thanks,
indu
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi Indu,

Please only UseOneThreadPerQuestion. Closing this and continuing Here
[ November 06, 2008: Message edited by: Martijn Verburg ]

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
GeeCON Prague 2014
 
subject: Database connection through Log4j