wood burning stoves 2.0*
The moose likes JDBC and the fly likes JDBC SQL server date format problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC SQL server date format problem" Watch "JDBC SQL server date format problem" New topic
Author

JDBC SQL server date format problem

sanjay vishwas
Greenhorn

Joined: Nov 16, 2005
Posts: 2
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

Joined: Oct 03, 2005
Posts: 118
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.
 
subject: JDBC SQL server date format problem
 
Similar Threads
Reading date from Excel Spreadsheet
JDBC SQL server date format problem
SQL server date format
Converting String to Date Object(mm/dd/yy) format
Formatting Date Object