Solved

Sql prepared stmts

Posted on 2004-04-22
3
283 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

734 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