File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Help on PreparedStatement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Help on PreparedStatement" Watch "Help on PreparedStatement" New topic

Help on PreparedStatement

Mondli Mabaso

Joined: Sep 26, 2003
Posts: 18
Slight problem with PreparedStatement. I am attempting to retrieve the actual SQL String object from the PreparedStatement without luck. I want to this because I want to save the SQL strings in a file.

Do u have any ideas - your help will be greatly appreciated.

Thank u


Everything is Ok @ the end, if its not OK, then its not the END
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Can you show us your code?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

Mondli, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

Please read this for more information.

Forum Bartender

[Asking smart questions] [About Bear] [Books by Bear]
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32819

You can use a DebuggableStatement. JavaRanch describes this option in more detail. Alternatively, you can use the open-source P6Spy

This is a good question that Dave gets to answer every couple of months. I added it to the FAQ.

[edited to switch from wiki to UBB formatting]
[ October 03, 2005: Message edited by: Jeanne Boyarsky ]

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Help on PreparedStatement
It's not a secret anymore!