Path: news.netfront.net!news.glorb.com!postnews.google.com!e10g2000prf.googlegroups.com!not-for-mail
From: Markus Tazl <m_tazl@yahoo.de>
Newsgroups: comp.databases.oracle.tools
Subject: Re: JDBC question: show PreparedStatement
Date: Sat, 2 Feb 2008 01:21:16 -0800 (PST)
Organization: http://groups.google.com
Lines: 26
Message-ID: <e4c64831-de3c-4b44-b03a-c657d4463d4f@e10g2000prf.googlegroups.com>
References: <47a1966c$0$85795$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: 80.139.247.119
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1201944076 2648 127.0.0.1 (2 Feb 2008 09:21:16 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 2 Feb 2008 09:21:16 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: e10g2000prf.googlegroups.com; posting-host=80.139.247.119; 
 posting-account=Lmt_JQoAAABNO1REKjX6pq5catF6-lN8
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.8.1.11) 
 Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe)
Xref: news.netfront.net comp.databases.oracle.tools:26918

On 31 Jan., 10:35, Joolz <r...@localhost.localdomain.invalid> wrote:
> Hello everyone,
>
> A small question about JDBC. When I do something like this:
>
>   PreparedStatement stmt = conn.prepareStatement("select * " +
>     "from fu where bar = ?");
>   stmt.setString(1, "blah");
>   System.out.println(stmt.toString()); // show me what will be asked
>
> I would like to see which query will be sent to the DB (i.e. "select *
> from fu where bar = 'blah'"), which would be very nice for debugging.
> toString() won't do the trick (it gives something like
> "oracle.jdbc.driver.T4CPreparedStatement@1e859c0"). Is there a way to
> solve this? TIA!

Hi,

1) "old" but nice article : http://www.javaworld.com/javaworld/jw-01-2002/jw-0125-overpower.html

2) Info on how to use JDBC driver logging :  http://www.rgagnon.com/javadetails/java-0411.html

best regards
Markus Tazl
--
Markus Tazl
