All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class multilizer.DatabaseDictionary

java.lang.Object
   |
   +----multilizer.Dictionary
           |
           +----multilizer.LoginDictionary
                   |
                   +----multilizer.DatabaseDictionary

public class DatabaseDictionary
extends LoginDictionary
A dictionary component that gets language and translation data from database tables. The dictionary uses JDBC to access the database.

Set the Driver property contain the class name of the JDBC driver. Set the URL property to contain the JDBC data source name. Set the User and the Password properties specify the user account of the database. Set the LanguageTable and the TranslationTable properties to contains the name of the dictionary tables. Call the open method to open the dictionary.

Language Table format
Translation Table format

An example:

 DatabaseDictionary dictionary = new DatabaseDictionary();
 dictionary.setDriver("interbase.interclient.Driver");
 dictionary.setURL("jdbc:interbase://multilizer.com/d:/database/javadcalc.gdb");
 dictionary.setUser("dcalc");
 dictionary.setPassword("dcalc");
 dictionary.setLanguageTable("LanguageTable");
 dictionary.setTranslationTable("TranslationTable");
 dictionary.open();
 

See Also:
ServerDictionary

Variable Index

 o ENGLISH_NAME_C
The index of the English language name in the language table.
 o ISO_COUNTRIES_C
The index of the ISO country codes in the language table.
 o ISO_DEFAULT_COUNTRY_C
The index of the default ISO country code in the language table.
 o ISO_LANGUAGE_C
The index of the ISO language code in the language table.
 o NATIVE_NAME_C
The index of the native language name in the language table.
 o TEST_C
The index of the test flag in the language table.

Constructor Index

 o DatabaseDictionary()

Method Index

 o close()
Closes the dictionary.
 o getDriver()
Gets the JDBC driver class.
 o getLanguage(ResultSet)
 o getLanguageCount()
Gets the amount of the languages in the dictionary.
 o getLanguageData(int)
Gets the specified language.
 o getLanguageDatas()
Gets the all languages.
 o getLanguageTable()
Gets the language table name.
 o getTranslationTable()
Gets the translation table name.
 o languageChanged(boolean, boolean)
Dictionary calls this method after the current language has been changed.
 o open()
Opens the dictionary.
 o setDriver(String)
Sets the JDBC driver class.
 o setLanguageTable(String)
Sets the language table name.
 o setTranslationTable(String)
Sets the translation table name.
 o translateString(String)
Returns the translation of the native string in the current language.
 o translateString(String, String, String)
Returns the translation of the context sensitive native string in the current language.

Variables

 o ENGLISH_NAME_C
 public final int ENGLISH_NAME_C
The index of the English language name in the language table.

 o NATIVE_NAME_C
 public final int NATIVE_NAME_C
The index of the native language name in the language table.

 o TEST_C
 public final int TEST_C
The index of the test flag in the language table.

 o ISO_LANGUAGE_C
 public final int ISO_LANGUAGE_C
The index of the ISO language code in the language table.

 o ISO_COUNTRIES_C
 public final int ISO_COUNTRIES_C
The index of the ISO country codes in the language table.

 o ISO_DEFAULT_COUNTRY_C
 public final int ISO_DEFAULT_COUNTRY_C
The index of the default ISO country code in the language table.

Constructors

 o DatabaseDictionary
 public DatabaseDictionary()

Methods

 o open
 public void open()
Opens the dictionary.

Overrides:
open in class Dictionary
 o close
 public void close()
Closes the dictionary.

Overrides:
close in class Dictionary
 o languageChanged
 protected void languageChanged(boolean languageChanged,
                                boolean localeChanged)
Dictionary calls this method after the current language has been changed.

Overrides:
languageChanged in class Dictionary
 o getLanguageCount
 public int getLanguageCount()
Gets the amount of the languages in the dictionary.

Overrides:
getLanguageCount in class Dictionary
 o getLanguage
 protected Language getLanguage(ResultSet rs) throws Exception
 o getLanguageData
 public Language getLanguageData(int index)
Gets the specified language.

Overrides:
getLanguageData in class Dictionary
 o getLanguageDatas
 public Language[] getLanguageDatas()
Gets the all languages.

Overrides:
getLanguageDatas in class Dictionary
 o translateString
 protected String translateString(String str)
Returns the translation of the native string in the current language.

Overrides:
translateString in class Dictionary
 o translateString
 protected String translateString(String str,
                                  String form,
                                  String component)
Returns the translation of the context sensitive native string in the current language.

Overrides:
translateString in class Dictionary
 o setDriver
 public void setDriver(String value)
Sets the JDBC driver class. e.g. "interbase.interclient.Driver" for InterBase.

 o getDriver
 public String getDriver()
Gets the JDBC driver class.

 o setLanguageTable
 public void setLanguageTable(String value)
Sets the language table name.

See Also:
setTranslationTable
 o getLanguageTable
 public String getLanguageTable()
Gets the language table name.

See Also:
getTranslationTable
 o setTranslationTable
 public void setTranslationTable(String value)
Sets the translation table name.

See Also:
setLanguageTable
 o getTranslationTable
 public String getTranslationTable()
Gets the translation table name.

See Also:
getLanguageTable

All Packages  Class Hierarchy  This Package  Previous  Next  Index