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

Retrieving the Query after values are set in Prepared Statement

 
ShivPrakash Srivastava
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

I am using Preparestatement to query the database.For this Iam setting the values and execute the queries. Is there any way by which I can get the final query which is build after all the data values are set in preparedstatement . It is very time consuming to check for the faulty data value through Java , when you have large number of columns. Can any one suggest me the best way to accomplish this.

Thanks and Regards Shiv
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The quick way I do it is to use the trace utility in my database to see the eventual procedure run, which is easy to do if you are familiar with your database.

You might consider p6spy also. It logs everything JDBC does including the values it binds in PreparedStatements.
 
Armando Perdomo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe p6spy is a great solution but it doesn't have a client and it is not easy to setup the first time. That was the reason we implemented a new solution integrating everything - Elvyx. I am pretty sure Elvyx could be useful on this kind of tasks.

BTW, it is working fine, but we need feedback from people like you. It will help us to improve the tool. Any idea, comment, etc will be appreciated.

Greetings, Armando Perdomo ;-)
http://www.elvyx.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic