Unix Technical Forum

Testing JDBC Prepared Statements

This is a discussion on Testing JDBC Prepared Statements within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> Hello dear developers, We are beginning to have a bunch of SQL statements in an evolving application, and are ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-16-2008, 01:43 PM
Daniel Migowski
 
Posts: n/a
Default Testing JDBC Prepared Statements

Hello dear developers,

We are beginning to have a bunch of SQL statements in an evolving
application, and are facing the problem, that every rename of a database
attribute (refactor early and often , breaks some of our statements.

To find what we broke, we are currently looking for postgresql to
prepare all the statements, without actually executing them, and to see,
which fail.

As far as I understand, the JDBC API wraps the internal implementation
of PreparedStatements from the user (and with PostgreSQL, there is a
distinction between client/server side prepared statements, anyway).

Is it possible with the PostgreSQL JDBC driver (leaving the JDBC API
space is allowed) to serverside prepare a statement without executing it?

With best regards,
Daniel Migowski

--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-16-2008, 01:43 PM
Kris Jurka
 
Posts: n/a
Default Re: Testing JDBC Prepared Statements



On Wed, 14 May 2008, Daniel Migowski wrote:

> Is it possible with the PostgreSQL JDBC driver (leaving the JDBC API
> space is allowed) to serverside prepare a statement without executing
> it?


PreparedStatement.getParameterMetaData will prepare a statement without
executing it.

Kris Jurka

--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-16-2008, 01:43 PM
Daniel Migowski
 
Posts: n/a
Default Re: Testing JDBC Prepared Statements

Kris Jurka schrieb: On Wed, 14 May 2008, Daniel Migowski wrote:
Is it possible with the PostgreSQL JDBC driver (leaving the JDBC API space is allowed) to serverside prepare a statement without executing it?
PreparedStatement.getParameterMetaData will prepare a statement without executing it.
Thank you. I also already helped me with something like statement.executeQuery("PREPARY test AS "+myQueryToTest), but your variant does apropriate query parsing, which seem better.

With best regards,
Daniel Migowski




--


|¯¯|¯¯| IKOffice GmbH Daniel Migowski | | |/| Mail: dmigowski@ikoffice.de | | // | Nordstr. 10 Tel.: 0441 21 98 89 52 | | \\ | 26135 Oldenburg Fax.: 0441 21 98 89 55 |__|__|\| http://www.ikoffice.de Mob.: 0176 22 31 20 76



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:42 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com