views:

35

answers:

2

Hi there,

normally I place my translations etc in properties - e.g. message_de.properties etc. I'm facing now a situation where I have to provide this data in a database. (Translations will be imported/edited in an other system)

Is there a common way/best practises to use a database table for messages in my webapp? One way I would thinking of was to build properties from the database but this seems not the right way to go.

+1  A: 

To me it sounds like exporting the database to properties files would be the correct way to go. It's simple and I would assume the database does not change that often? The export can then be automated different ways.

fish
+1  A: 

A ResourceBundle doesn't need to be based on a properties file, you can write your own implementation and back them with JDBC or whatever tickles your fancy. The ResourceBundle javadoc page has an example on how to make a custom implementation.

gustafc