db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John English <john.fore...@gmail.com>
Subject Re: Localisation problem
Date Thu, 18 Oct 2012 11:28:36 GMT
On 17/10/2012 21:40, david myers wrote:
> John,
>
> If you have a look at the java Gregorian calendar class
> (http://docs.oracle.com/javase/7/docs/api/java/util/GregorianCalendar.html#GregorianCalendar(java.util.TimeZone,%20java.util.Locale)
>
> It has a constructor for setting the timezone and locale. I imagine you
> could insert this quite easily into the code on your interface, grabbing
> the time from the DB and using your interface to convert it to the
> desired locale, I imagine you can probably inject the same as a user
> defined function into derby itself.

Yes, this is true. However, the problem then arises that the column at 
the DB end doesn't contain strings like "feb" (or "fev" if using French) 
so I can't filter the results by adding "where usr_time like '%feb%'" to 
the query. What I'm stuck with is localising the results that come out 
of the DB, not localising them afterwards.

Best idea I've had so far is to add a locale column to my table of users 
and select that so I can pass it as a parameter to my TimeFormat 
function. The problem with that is that I will end up multiplying the 
number of rows returned by the view by the number of users, which at the 
moment amounts to a few hundred.

What I really need is a "create temporary view", or better still a way 
to smuggle a value inside the Connection that I use for the query that 
could be picked up inside TimeFormat. Sigh.

Thanks for trying anyway!
-- 
John English

Mime
View raw message