Solved

Sql prepared stmts

Posted on 2004-04-22
3
265 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
ID: 10896097
0
 
LVL 14

Accepted Solution

by:
Tommy Braas earned 75 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

825 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