开发者

H2 Database error message localization

I have a problems with H2 Database exception messages. The language of the messages corresponds to开发者_开发问答 the OS language(I'm using Windows). Is it possible to turn off localization feature to get messages only on English?


No, it's currently not possible, but:

H2 error messages are in the current language, plus always also in English (concatenated to the translated message).

Why do you want to get them only in English? Each message also has an error code (SQLException.getErrorCode()) by the way.

(I added this as an answer because the person who asked the question doesn't seem to read the comments).


...
catch (SQLException e) {
  ErrorMessage = (e.getMessage().split("\n").length > 1) ? e.getMessage().split("\n")[1] : e.getMessage().split("\n")[0];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜