Hi I am new to Java.I am working on a small project where i have to store some Strings and date into database using servlet MVC.
I Have created a java class in Model package,in which i have created a parameterized Function to make connection.
When you say "getdate" what exactly does that mean? It sounds like you're hoping to get a date from somewhere. Have you thought about where you might get it from? I notice you got a "name" from the request, would you be getting the date from the request as well? You need to explain your design to us.
First we would like you to attempt at writing the code , then when you come up with issue , we will surely help you and point you in the right direction. As Bear said take a look at how to convert the String parameter then try to attempt it out.
Joined: Apr 12, 2013
String datestr="dd-MM-YY"; SimpleDateFormat formater = new SimpleDateFormat("dd-MM-yy hh:mm:ss");
I tried many times and i end up with this code which showing
Which Date have you imported ? java.sql.Date or java.util.Date ? Remember that java.sql.Date is just a wrapper around the java.util.Date to allow JDBC to identify the date . see Javadocs -- here . You may need the java.util.Date .