0

How to clear the dateformat got set from my machine oracle database connection from my machine

As in this post i have changed my sql deveoper calling a SP and it is working fine but the same is not working from tomcat server

but it is working from other machine, same code i moved to other machine and it is working like a charm

Is there a way to configure/Clear any settings for this ?

Community
  • 1
  • 1
Anbu
  • 15
  • 6
  • The tomcat process has a different envrionment variable setup form your process. This may be a bad idea - but you can shutdown/restart tomcat in a process with environment variables that match what you require. You can also break something else that uses tomcat when you do that. – jim mcnamara Mar 27 '15 at 16:00
  • I had replaced new tomcat server, even it didn't help – Anbu Mar 27 '15 at 16:19
  • Please show the specific errors and relevant code. You should not depend on environment settings, but use to_char and to_date to explicitly format your dates in a consistent manner. – OldProgrammer Mar 27 '15 at 16:39
  • thanks for the reply, this is the error code ORA-01843 from SP, but the same SP is working from other machines with same setup – Anbu Mar 27 '15 at 16:47

1 Answers1

0

Lets' try this - it won't fit in a comment

From this URL: http://www.dba-oracle.com/t_ora_01843_not_a_valid_month.htm

Resolving ORA-01843 includes bad data issues.  The reason a ORA-01843 occurs includes these reasons

•Using an incorrect NLS_DATE_FORMAT 
 This happens a lot when you see data coming from US 
 (where the Month is normally written before the day)
 but the format in the application is still the "European" style.
 (where the day is written before the month). 

•Using a incorrect NLS_DATE_FORMAT:
 Such as trying to insert a "written" month name but are using a "numeric" month in the mask.

NLS settings are part of locale ( as tomcat would see it ). Locale is part of the environment. This means the command

locale  

if run in the tomcat process on the problem server the command will not give the exact same result as when it is run from the tomcat process on the server that works. I'm not all sure tomcat is the problem. However it is a locale setting. Installing new software will not help.

Login to server A (as the user that runs tomcat) then type: locale

Login to server B (as the user that runs tomcat) then type: locale

Is the output completely identical? Oracle is extremely sensitive to locale settings. Make them identical, use the working server's locale.

jim mcnamara
  • 16,005
  • 2
  • 34
  • 51
  • Hey thanks, this was the problem and am able to solve it, actually am using windows here and i reset the date format and locale in administrative settings – Anbu Mar 30 '15 at 06:29