Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log SQL Statement...

 
Tejas V Shah
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody,
Can you help me how to log SQL statement
I am using EJB3.0

Thanks in Advance
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15272
37
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This does not belong in the Sun Certification Results forum. Please choose a more appropriate forum next time you ask a question.

I'll move this one to a more appropriate forum.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34372
345
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tejas V Shah:
HCan you help me how to log SQL statement

Log it where? Can you elaborate?
 
Tejas V Shah
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:

Log it where? Can you elaborate?


Temporary consider I want to log it in my local host
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By "localhost" I'm assuming you mean the client host and not the server.

The SQL is happening on the server and that's where you'd want to log it.

You can log it in a million ways, but a common way is to use the log4j package.

You can create a logger for the class you want, and log the query as INFO.

google "log4j" and you find a myriad of resources, if you have any specific questions once you start using it, "Java in General (intermediate)" is likely an appropriate forum to ask
[ May 19, 2008: Message edited by: Bill Shirley ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic