Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ojdbc14.jar to ojdbc6.jar Date Format Problem

 
Edwin Ubongen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Using the ojdbc14.jar, when I execute the SQL query SELECT * FROM nls_session_parameters where parameter = 'NLS_DATE_FORMAT' on a java standalone application. It returns DD.MM.YYYY. However, when I tried to upgrade to ojdbc6.jar and execute the same SQL query, it returns DD-MON-RR. I just want to have an idea why is DD.MM.YYYY format was returned when using ojdbc14 while DD-MON-RR when using ojdbc16. Is there a way for the ojdbc6 to return the same format as ojdbc14 (because returning a different format causes a lot of problem in our application...)?

Please refer to the details below:

Oracle Database Version:
- Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
- PL/SQL Release 11.2.0.2.0 - Production
- "CORE 11.2.0.2.0 Production"
- TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production
- NLSRTL Version 11.2.0.2.0 - Production

Java Version: 1.6

Using Oracle SQL Developer, these are the following values of parameters:
SELECT * FROM nls_session_parameters;
- NLS_DATE_FORMAT - DD-MON-RR
- NLS_TIMESTAMP_FORMAT - DD-MON-RR HH.MI.SSXFF AM
- NLS_TIMESTAMP_TZ_FORMAT - DD-MON-RR HH.MI.SSXFF AM TZR

SELECT * FROM nls_instance_parameters;
- NLS_DATE_FORMAT - DD.MM.YYYY
- NLS_TIMESTAMP_FORMAT - (null)
- NLS_TIMESTAMP_TZ_FORMAT - (null)

SELECT * FROM nls_database_parameters;
- NLS_DATE_FORMAT - DD.MM.YYYY
- NLS_TIMESTAMP_FORMAT - DD-MON-RR HH.MI.SSXFF AM
- NLS_TIMESTAMP_TZ_FORMAT - DD-MON-RR HH.MI.SSXFF AM TZR

Thanks in advance for your help!
 
Scott Selikoff
author
Saloon Keeper
Posts: 4028
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you care about date formats? You should be passing values as date/time objects, such as java.sql.Timestamp, and reading them as such. Date format shouldn't matter in JDBC. You can use Java SimpleDateFormat to format the data to your own liking after you have read it from the database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic