tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Mahar" <DMa...@penson.ca>
Subject RE: [JSTL] How do I enter a null value with <sql:param>?
Date Wed, 19 May 2004 17:19:59 GMT
After reading Section 17.7 of the JDBC specification (available at http://java.sun.com/products/jdbc/download.html),
I now agree that there is a problem with the Microsoft SQL JDBC driver, but there is also
a problem with the official Java JDBC API documentation that does not mention how PreparedStatement.setObject()
handles the case PreparedStatement.setObject(index, null).  I guess we should ask Sun to correct
(or complete) its JDBC API documentation and I need to ask Microsoft to fix its JDBC driver.

However, I still need to fix my problem now.  So, as I have Standard Tag Library source code,
but do not have the source of the Microsoft SQL Server JDBC driver, I will likely change the
<sql:param> implementation so that it invokes PreparedStatement.setNull() when it receives
a null value.  Here is a perfect case where having source code is of tremendous benefit.

Thank you for pointing me in the right direction and being patient with my posts as I worked
through my problem.

Derek

-----Original Message-----
From: Wolfgang Röckelein [mailto:wolfgang.roeckelein@wiwi.uni-regensburg.de] 
Sent: May 19, 2004 10:40 AM
To: Tag Libraries Users List
Subject: Re: [JSTL] How do I enter a null value with <sql:param>?


Keith wrote:
> This was on the Users list and was my problem. But mine had to do 
> specifically with the
> <sql:dateParam> and the Oracle JDBC driver. The regular <sql:param> worked
fine for me 
> when I passed it a null value. 
> 
> Link to the starting thread in the archive:
> http://www.mail-archive.com/taglibs-user@jakarta.apache.org/msg06748.html 

Thanks for digging this out. Both problems boil down to the case that "when setObject(index,
null) is passed in a null value this should be converted 
by the driver to an SQL null" does not work with the JDBC driver (perhaps only 
for certain data types, which could be the cause why you see it only with 
<sql:dateParam>). From my experience I know that the MS SQL JDBC driver has/had 
problems in this area...

Regards,
   Wolfgang


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org

NOTICE: This email contains privileged and confidential information and is intended only for
the individual to whom it is addressed. If you are not the named addressee, you should not
disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail
if you have received this transmission by mistake and delete this communication from your
system. E-mail transmission cannot be guaranteed to be secured or error-free as information
could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.


AVIS: Le présent courriel contient des renseignements de nature privilégiée et confidentielle
et n’est destiné qu'à la personne à qui il est adressé. Si vous n’êtes pas le destinataire
prévu, vous êtes par les présentes avisés que toute diffusion, distribution ou reproduction
de cette communication est strictement interdite.  Si vous avez reçu ce courriel par erreur,
veuillez en aviser immédiatement l’expéditeur et le supprimer de votre système. Notez
que la transmission de courriel ne peut en aucun cas être considéré comme inviolable ou
exempt d’erreur puisque les informations qu’il contient pourraient être interceptés, corrompues,
perdues, détruites, arrivées en retard ou incomplètes ou contenir un virus.  

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message