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