Re: query manipulation

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Randall Smith <randall(at)tnr(dot)cc>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: query manipulation
Date: 2007-03-20 19:47:13
Message-ID: 54271772-A7CB-47D6-84EC-194A6F2F1A1C@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

You don't want to do that you want proxy PreparedStatement, then
override PreparedStatement.prepareStatement

He is checking the return type of every method to see what is
returning a prepared statement

Dave

On 20-Mar-07, at 3:21 PM, Randall Smith wrote:

> This particular statement:
>
> if(method.getReturnType().isInstance(PreparedStatement.class))
>
> is returning false for my prepared statement. I'm printing the
> type like this:
>
> System.out.println(method.getReturnType());
>
> and it shows type type is:
>
> interface java.sql.PreparedStatement
>
> I'm using Jython to test, and my test program looks like so:
>
> from java.lang import *
> from java.sql import *
> Class.forName("randall.PGProxyDriver")
> con = DriverManager.getConnection
> ('jdbc:postgresql:mydb','myuser','mypass')
> stmt = con.prepareStatement('select * from mytablename where
> myfield = ?')
> stmt.setString(1, myvalue)
> rs = stmt.executeQuery()
>
> How do I match "interface java.sql.PreparedStatement" ?
>
> Randall

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Randall Smith 2007-03-20 21:59:11 Re: query manipulation
Previous Message Randall Smith 2007-03-20 19:21:36 Re: query manipulation