0

Here's the thing, I need to create three dropdown lists each for day, month, year. Once these are selected, after clicking a button, the three selected values need to be concatenated and bound to a date column in a database table.

String month=request.getParameter("month");
String date=request.getParameter("date");
String year=request.getParameter("year");

how to concat these three parameters ...

Edited by nHulk: n/a

2
Contributors
8
Replies
9
Views
6 Years
Discussion Span
Last Post by nHulk
0

String month=request.getParameter("month");
String date=request.getParameter("date");
String year=request.getParameter("year");

plz tell me how to concat these three parameter in to date format(year-month-day) !!! so that it is easy to insert date value in data base...

0

Why do you want "JSP coding", when you're currently using Java coding? Don't tell me you used a scriplet to get those values. Don't tell me that you don't know about ${param.xxx} JSP syntax. Why does everybody dive immediately into JSP and never look at the tutorials?

The J2EE(TM) 1.4 Tutorial
- The Java EE 5 Tutorial
- The Java EE 6 Tutorial

And as far as "concatenating" the values simply "output" them one after the other.

i want to concat those three parameters in date format(year-month-day) so that it is easy to insert in to database

0
String bogus = year + month + date

String date=year+"-"+month+"-"+day;


is it correct ???

0

Did you try it?

Aside from the fact that you should be using PreparedStatement, create an actual Date object from that info, using a Calendar instance probably, and then using PReparedStatements setDate, but judging by the rest of tall this you are already in over your head and have no interest in learning how to do anything properly. A "close-enough-for-government-work" attitude.

0

Did you try it?

Aside from the fact that you should be using PreparedStatement, create an actual Date object from that info, using a Calendar instance probably, and then using PReparedStatements setDate, but judging by the rest of tall this you are already in over your head and have no interest in learning how to do anything properly. A "close-enough-for-government-work" attitude.

ya it working thanks a lot

0

Did you try it?

Aside from the fact that you should be using PreparedStatement, create an actual Date object from that info, using a Calendar instance probably, and then using PReparedStatements setDate, but judging by the rest of tall this you are already in over your head and have no interest in learning how to do anything properly. A "close-enough-for-government-work" attitude.

ya its working thanks a lot

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.