jstl and oracle date format

P

Peter Parker

Is it possible to format the parameter date for oracle query in jstl? For
example, I did the following :

<sql:query var="data" dataSource="${connection}">
select some_name from some_table where birth_date = ?

<sql:param value='${to_date(param.birth_date, "dd/mm/yyyy")}'/> <=
this line does NOT work.
</sql:query>

Please help. Thanks.
 
M

Mindundi

<sql:query var="data" dataSource="${connection}">
select some_name from some_table where birth_date =
to_date("<fmt:formatDate value='${param.birth_date}'
pattern='dd/mm/yyyy'/>", "dd/mm/yyyy")
</sql:query>

Try this one or something similar. fmt are standard formatting tags of jstl.
Good luck, spidey.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,058
Latest member
QQXCharlot

Latest Threads

Top