Solved

Sql prepared stmts

Posted on 2004-04-22
3
244 Views
Last Modified: 2010-03-31
Is there a way to show the SQL behind a prepared stmt.

System.out.println (strSQL); //works when one is composing string sql statement

PreparedStatement pst = null;
...
System.out.println (pst. ?);  //what do I use to see sql here? (After parameters have been assigned, of course)
0
Comment
Question by:Paullkha
  • 2
3 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
Comment Utility
0
 
LVL 14

Accepted Solution

by:
Tommy Braas earned 75 total points
Comment Utility
Unless you write your own driver there is currently no way to do what you want. The closest you can get is by using the method nativeSQL(String sql). You can filter your SQL string through it with the ? placeholders in place.
0
 
LVL 14

Expert Comment

by:Tommy Braas
Comment Utility
=-)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now