db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Ondruška <peter.ondruska+de...@kaibo.eu>
Subject Re: nulls in prepared statement
Date Thu, 21 Jul 2011 15:35:33 GMT
You would only subclass PreparedStatement as public
MyPreparedStatement extends PreparedStatement and override setString
method. And in your code use replace PrepareStatement with

On Thu, Jul 21, 2011 at 5:31 PM, Tomcat Programmer
<tcprogrammer@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.)

View raw message