In my company product, we extract results one page from the database. Because of this, all filtering and sorting must be done in the database. One problem is encoded values. For filtering and sorting to work correctly, code values must be translated to locally defined labels in the request.
My plan is to use a table similar to the following: t_code_to_label (type varchar2 (10), locale varchar2 (10), code varchar2 (10), label varchar2 (50)) The first three columns are the main (unique) key.
When using this table you will see something like this
select ent.name, ent.ent_type, entlabel.label as ent_type_label
from t_entitlements ent
join t_code_to_label entlabel on entlabel.type='entlabel' and entlabel.locale=currentLocale() and entlabel.code=ent.ent_type
The problem is that currentLocale () is what I came up with. How can I do something on the Java side of the JDBC connection to set the locale for the Connection object that I have, which I can read on the Oracle side in a simple function. Ideally, this is true support for the Oracle language, but I cannot find such a thing.
I am using Oracle 10g and 11g.
source
share