I am using Oracle 11g and when I try to pull the data thru a JSP, the date format is different between two environments. Both are having the same code. Both are pointing to two different oracle 11g instances.
For ex, server A returns as 2012-08-31, but server B returns 8/31/2012.
Here is the jsp portion where I am printing the date:
String query = "select dob from profiles";
Stement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE);
ResultSet rs =stmt.executeQuery(query);
while(rs.next()){
out.println(rs.getString[0]);
}
system A :
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 – 64bit
Oracle JDBC DriverVersion: 11.2.0.3.0
system B :
Oracle Database 11g Release 11.1.0.0.0
Oracle JDBC DriverVersion: 10.2.0.2.0
Any idea why its like that? Thank you in advance.
John
As the source code is same on server_A and server_B.
Try to check the JDBC_Driver.jar on those server.
you can format the date with class:
SimpleDateFormathope this will help you.