6

I am getting exception messages from Oracle through JDBC in German. How can I change that to english?

java.sql.SQLException: Die Zeitzone f³r die Datenbank-Session ist nicht festgelegt
        at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
        at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:445)
        at oracle.jdbc.driver.TimestampltzAccessor.getString(TimestampltzAccessor.java:94)
        at oracle.jdbc.driver.T4CTimestampltzAccessor.getString(T4CTimestampltzAccessor.java:256)
        at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:971)
John Fitzpatrick
  • 4,207
  • 7
  • 48
  • 71
  • would probably help if you could supply the NLS language set of the database and any clients you are using to access the database – kevinskio Nov 12 '12 at 13:19
  • @Kevinsky: I'm going to have to research that. I am not really sure where that is specified in my JDBC client. As for the server, it is on the other side of the planet managed by people who don't answer my emails. Getting the NLS language set of the server will take significantly longer. (I was hoping this was something I could solve on the client side alone.) – John Fitzpatrick Nov 12 '12 at 13:24
  • on the database try select DECODE(parameter, 'NLS_CHARACTERSET', 'CHARACTER SET', 'NLS_LANGUAGE', 'LANGUAGE', 'NLS_TERRITORY', 'TERRITORY') name, value from v$nls_parameters WHERE parameter IN ( 'NLS_CHARACTERSET', 'NLS_LANGUAGE', 'NLS_TERRITORY'); and on client from SQL PLUS SELECT * FROM NLS_SESSION_PARAMETERS; – kevinskio Nov 12 '12 at 13:28
  • @Kevinsky: Thanks for your help. Actually the host where the application in question runs does not have an Oracle client installation. It is using the pure JDBC drivers for Oracle. It turns out I have to set the default locale for the JVM with a call similar to this `Locale.setDefault(Locale.US);` in order to get english exception messages. – John Fitzpatrick Nov 12 '12 at 13:38

1 Answers1

5

for NLS settings it will be client side. see this like NLS_LANG setting for JDBC thin driver? for how to set on the JDBC side.

Community
  • 1
  • 1
DazzaL
  • 21,638
  • 3
  • 49
  • 57