• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Logging Oracle Prepared/Callable Statements

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know of a simple way of logging an Oracle prepared/callable statement? I tried calling toString() but all I receive is the object reference.

I believe the Oracle libraries have some functionality for producing their own logs but I'd rather a simpler solution which allows me to log just what I need.

Thanks
 
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried log4jdbc? This library acts as a jdbc driver, logs the statements and delegates the request to underlying real driver.
 
J Rosetto
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Santhosh.

Unfortunately I am looking for a solution which will allow me to produce the log entries (using our company's bespoke logging library), rather than delegating the logging responsibility to another library.

I notice that the OraclePreparedStatement has a method called getRevisedSql(). I am guessing this provides what I need. Unfortunately I am using Commons DBCP, which means I only have access to DelegatingPreparedStatements which wrap the OraclePreparedStatements and so I have no access to this method.
 
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic