Re: [JDBC] Prepare Statement - Mailing list pgsql-sql

From Jie Liang
Subject Re: [JDBC] Prepare Statement
Date
Msg-id E7E213858379814A9AE48CA6754F5ECB034518F9@mail01.stbernard.com
Whole thread Raw
Responses Re: [JDBC] Prepare Statement
List pgsql-sql
Kirs,

I re-compile with setUseServerPrepare(true), it works fine, thanks.
However, reading from my log file, what I saw is that five same SELECTs
with different argument, so I am wondering that the PrepareStatement
really save time than individualy execute five SELECTs ???

If I use one "parepare sql command" and five "execute sql commands", the
log file shown what I typed, so I think it really used server side
prepared object!


Any comment?



Thanks.



Jie Liang


-----Original Message-----
From: Kris Jurka [mailto:books@ejurka.com]
Sent: Wednesday, June 16, 2004 9:30 PM
To: Jie Liang
Cc: Tom Lane; pgsql-sql@postgresql.org; pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] Prepare Statement




On Wed, 16 Jun 2004, Jie Liang wrote:

> Kris,
> Thank you for your valuable response, I used the code you list
> following:
>
> [7.5 code example]
>
> Then, the compiler complaint:
> ServerSidePreparedStatement.java:20: cannot resolve symbol symbol  :
> method setPrepareThreshold  (int)
> location: interface org.postgresql.PGStatement
>                 pgstmt.setPrepareThreshold(3); I downloaded
> pg74.213.jdbc2.jar and pg74.213.jdbc2ee.jar at

This example is from the 7.5 documentation and requires a
pgdev.302.jdbcX.jar file.  I mentioned this cvs example because this
functionality is undocumented in the released version.  In the 7.4
version
the enabling of server side statements is only possible via a boolean
flag
at the statement level, namely PGStatement.setUseServerPrepare(true);

Kris Jurka

pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Optimal query suggestion needed
Next
From: InterZone
Date:
Subject: Re: Optimal query suggestion needed