Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert from String to java.sql.Date

 
satheesh krishnaswamy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everbody,
I have a doubt.I am having a field called mydate of type DATETIME in database in SQL SERVER 2000.From my jsp i call
date mydate=request.getParamater("mydate")
and try to insert into database by calling EJB Method addheader(---,mydate,--) .It is giving error.
Kindly give me solution as how to convert this string value received from request.getParameter() to java.sql.Date
The matter is most urgent.Kindly give me solution as soon as possible.
[ May 26, 2004: Message edited by: Bear Bibeault ]
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the format of your date? I assume it is MM/dd/yyyy, You can do it as following:

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a JSP or an EJB issue, so I've changed the title to something appropriate and moved to the Java in General(intermediate) forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic