Home > Archive > PostgreSQL JDBC > November 2005 > Re: Can PostgreSQL do data type automated casting in prepared









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Can PostgreSQL do data type automated casting in prepared
Kris Jurka

2005-11-21, 8:24 pm



On Mon, 21 Nov 2005, Tjioe Ai Xin wrote:

>
> My code is like this: I have query: "Select count(*) / paramPage from
> tblFirst where condition"; The paramPage were filled from parameter
> which I specified as string data type. So I using setString method for
> my prepared statement for passing paramPage value. When I'm using the
> old jdbc driver pg74jdbc3.jar, I got no problem at all. But when I try
> to upgrade my PostgreSQL to 8.0.3. I got problem data type error.
>
> Can PostgreSQL do data type automated casting in prepared statement again?
> So I do not need change my code :)
>


Yes, and no. You can restore the old behavior by adding
?protocolVersion=2 to your connection URL, but using the older protocol
also means some new features and performance gains will be unavailable to
you.

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Tjioe Ai Xin

2005-11-23, 7:24 am

Dear Kris,

Where I can set protocolVersion=2?
And how about the performance?

Thanks in advance.
Xin Xin

On Tuesday 22 November 2005 06:08, Kris Jurka wrote:
>
> On Mon, 21 Nov 2005, Tjioe Ai Xin wrote:
>
>
> Yes, and no. You can restore the old behavior by adding
> ?protocolVersion=2 to your connection URL, but using the older protocol
> also means some new features and performance gains will be unavailable to
> you.
>
> Kris Jurka
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Dave Cramer

2005-11-23, 7:24 am

Please see the following for all the connection parameters.

http://jdbc.postgresql.org/document...tml#connection-
parameters

Dave
On 23-Nov-05, at 7:05 AM, Tjioe Ai Xin wrote:

> Dear Kris,
>
> Where I can set protocolVersion=2?
> And how about the performance?
>
> Thanks in advance.
> Xin Xin
>
> On Tuesday 22 November 2005 06:08, Kris Jurka wrote:
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com