You would only subclass PreparedStatement as public MyPreparedStatement extends PreparedStatement and override setString method. And in your code use replace PrepareStatement with MyPreparedStatement.
On Thu, Jul 21, 2011 at 5:31 PM, Tomcat Programmer <tcprogram...@yahoo.com> wrote: > >> >> Well may be you won't have less ugly code, but at least it will be hidden >> ;-) >> >> I think the easiest way it to use you own PreparedStatement class. So you >> can do >> any special treatment or workaround in a centralized and unique place. >> > Hi JYL this is a very insightful and interesting solution, which I would not > have thought of. Is this as simple as creating my own class with the derby > version as its superclass and then just overriding the method? That seems > too easy .. is there any catches or pitfalls you can give me a heads up on? > Thanks again for your help! > Adding one specific thought: if I extend the class, how do I get my version > to be instantiated? (this is a web application and so it will be picking up > driver registration and so forth from JNDI.) > >