dbTalk Databases Forums  

JDBC question: show PreparedStatement

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss JDBC question: show PreparedStatement in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joolz
 
Posts: n/a

Default JDBC question: show PreparedStatement - 01-31-2008 , 03:35 AM






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!

Reply With Quote
  #2  
Old   
Markus Tazl
 
Posts: n/a

Default Re: JDBC question: show PreparedStatement - 02-02-2008 , 03:21 AM






On 31 Jan., 10:35, Joolz <r... (AT) localhost (DOT) localdomain.invalid> wrote:
Quote:
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/j...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


Reply With Quote
  #3  
Old   
Markus Tazl
 
Posts: n/a

Default Re: JDBC question: show PreparedStatement - 02-02-2008 , 03:21 AM



On 31 Jan., 10:35, Joolz <r... (AT) localhost (DOT) localdomain.invalid> wrote:
Quote:
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/j...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


Reply With Quote
  #4  
Old   
Markus Tazl
 
Posts: n/a

Default Re: JDBC question: show PreparedStatement - 02-02-2008 , 03:21 AM



On 31 Jan., 10:35, Joolz <r... (AT) localhost (DOT) localdomain.invalid> wrote:
Quote:
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/j...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


Reply With Quote
  #5  
Old   
Markus Tazl
 
Posts: n/a

Default Re: JDBC question: show PreparedStatement - 02-02-2008 , 03:21 AM



On 31 Jan., 10:35, Joolz <r... (AT) localhost (DOT) localdomain.invalid> wrote:
Quote:
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/j...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


Reply With Quote
  #6  
Old   
Markus Tazl
 
Posts: n/a

Default Re: JDBC question: show PreparedStatement - 02-02-2008 , 03:21 AM



On 31 Jan., 10:35, Joolz <r... (AT) localhost (DOT) localdomain.invalid> wrote:
Quote:
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/j...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


Reply With Quote
  #7  
Old   
Markus Tazl
 
Posts: n/a

Default Re: JDBC question: show PreparedStatement - 02-02-2008 , 03:21 AM



On 31 Jan., 10:35, Joolz <r... (AT) localhost (DOT) localdomain.invalid> wrote:
Quote:
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/j...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


Reply With Quote
  #8  
Old   
Markus Tazl
 
Posts: n/a

Default Re: JDBC question: show PreparedStatement - 02-02-2008 , 03:21 AM



On 31 Jan., 10:35, Joolz <r... (AT) localhost (DOT) localdomain.invalid> wrote:
Quote:
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/j...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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.