Обсуждение: [JDBC] Chage driver locale.

Поиск
Список
Период
Сортировка

[JDBC] Chage driver locale.

От
Jean Dannemann
Дата:
Hi.

I just realized that the PostgreSQL JDBC JAR contains a package called org.postgresql.translation with the messages translations for many countries.

How do I change the JDBC driver's locale? I would like to have portuguese messages (pt_BR).

I've tried with "-Duser.language=xx -Duser.region=YY" on catalina.bat but it did not worked.

PS: I have postgresql-42.1.4.jar in the lib directory of my Tomcat server and my application obtains the database connection via JNDI.

Thanks in advance.

Re: [JDBC] Chage driver locale.

От
Dave Cramer
Дата:
My understanding is that this is set by the locale of the JVM ? But candidly I have no direct experience with this.


On 8 August 2017 at 04:24, Jean Dannemann <jean.carone@gmail.com> wrote:
Hi.

I just realized that the PostgreSQL JDBC JAR contains a package called org.postgresql.translation with the messages translations for many countries.

How do I change the JDBC driver's locale? I would like to have portuguese messages (pt_BR).

I've tried with "-Duser.language=xx -Duser.region=YY" on catalina.bat but it did not worked.

PS: I have postgresql-42.1.4.jar in the lib directory of my Tomcat server and my application obtains the database connection via JNDI.

Thanks in advance.

Re: Chage driver locale.

От
Dave Cramer
Дата:
My understanding is that this is set by the locale of the JVM ? But candidly I have no direct experience with this.


On 8 August 2017 at 04:24, Jean Dannemann <jean.carone@gmail.com> wrote:
Hi.

I just realized that the PostgreSQL JDBC JAR contains a package called org.postgresql.translation with the messages translations for many countries.

How do I change the JDBC driver's locale? I would like to have portuguese messages (pt_BR).

I've tried with "-Duser.language=xx -Duser.region=YY" on catalina.bat but it did not worked.

PS: I have postgresql-42.1.4.jar in the lib directory of my Tomcat server and my application obtains the database connection via JNDI.

Thanks in advance.

Re: [JDBC] Chage driver locale.

От
Vladimir Sitnikov
Дата:
Jean>I've tried with "-Duser.language=xx -Duser.region=YY" on catalina.bat but it did not worked.

Please try  -Duser.language=pt -Duser.region=BR
It does result into message like
rg.postgresql.util.PSQLException: ResultSet não está posicionado corretamente, talvez você precise chamar next.
at org.postgresql.jdbc.PgResultSet.checkResultSet(PgResultSet.java:2789)

Note: there are non-translated to pt_BR messages, so you will still see English variations.


Vladimir

Re: Chage driver locale.

От
Vladimir Sitnikov
Дата:
Jean>I've tried with "-Duser.language=xx -Duser.region=YY" on catalina.bat but it did not worked.

Please try  -Duser.language=pt -Duser.region=BR
It does result into message like
rg.postgresql.util.PSQLException: ResultSet não está posicionado corretamente, talvez você precise chamar next.
at org.postgresql.jdbc.PgResultSet.checkResultSet(PgResultSet.java:2789)

Note: there are non-translated to pt_BR messages, so you will still see English variations.


Vladimir