Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBC SQL server date format problem  RSS feed

 
sanjay vishwas
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my application i am using JDBC ODBC bridge to connect to the SQL server database.its a JSP appication.
when i insert date to database it gets inserted in the format of mm/dd/yy but when i display it in the next page through resultset using getString method it displayes in the format of yy/mm/dd.
is there any method by which i can convert date in the format of mm/dd/yy.
 
Sri Ram
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sanjay vishwas:
in my application i am using JDBC ODBC bridge to connect to the SQL server database.its a JSP appication.
when i insert date to database it gets inserted in the format of mm/dd/yy but when i display it in the next page through resultset using getString method it displayes in the format of yy/mm/dd.
is there any method by which i can convert date in the format of mm/dd/yy.


Use DateFormat Class to change the format. Then display it in Screen.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!