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