The problem I am encountering seems to be with the JDBC driver.
Acc. to the release note for JSTL 1.0 on the jakarta site one should
be able to use the EL ${null} for the value parameter of
sql:param or sql:dateParam but some drivers do not support the
underlying implementation by jakarta.
Heres the exact text:
Use of null with <sql:param> and <sql:dateParam>
The Standard 1.0 taglib utilizes the
PreparedStatement.setObject(parameterIndex, null) when specifying the
<sql:dateParam value="${null}" type='date'/> or <sql:param value="${null}"
/> actions. Not all JDBC drivers currently support the passing of null to
the PreparedStatement.setObject() method. If you encounter a failure with
your JDBC driver, please execute a SQL DML statement which does not require
<sql:param> or <sql:dateParam> to specify a null value for a given column.
-----Original Message-----
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 3:12 PM
To: 'Tag Libraries Users List'
Subject: RE: Handling null dates
Are you parsing the dates using <fmt:parseDate>? If so, then according to
the spec, the if the input value is null or "" the variable specifed by var
will be removed. You could then use the empty operator to check for a null
value. Hope this helps.
-----Original Message-----
From: Narayan, Anand [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 11:27 AM
To: 'Tag Libraries Users List'
Subject: RE: Handling null dates
Same issue here with null dates.
I need to set the value of a date field to null.
How can I create an object that equates to null?
The JSTL spec for dateParam says that if the value equates to null
the column will be set to null but i have not figured out how
to create a null object in JSP.
Any ideas??
Thanks
Anand Narayan
-----Original Message-----
From: Nic Werner [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 1:27 PM
To: Tag Libraries Users List
Subject: Handling null dates
Greetings,
I have a form that has a lot of date fields, they represent dates someone
attempted to take a test.
There are multiple sets of these for each attempt they have taken, but I run
into trouble if there is only one test attempt, meaning there are blank
dates for the other attempts.
Is there any way I can have the form send over the blank values and JSTL
will just update the database with these blank values? I've tried to detect
if the date is empty and just set the variable to be updated to be blank
with <c:set value="" var="datetaken"/>
but I get invalid column type.
Thanks,
Nic Werner
Link11
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]