Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sql prepared stmts

Posted on 2004-04-22
3
Medium Priority
?
290 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10896097
0
 
LVL 14

Accepted Solution

by:
Tommy Braas earned 300 total points
ID: 10896191
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
ID: 11099184
=-)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
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 …
Suggested Courses

722 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