All Packages Class Hierarchy This Package Previous Next Index
Class multilizer.DatabaseDictionary
java.lang.Object
|
+----multilizer.Dictionary
|
+----multilizer.RemoteDictionary
|
+----multilizer.DatabaseDictionary
- public class DatabaseDictionary
- extends RemoteDictionary
A dictionary component that gets language and translation data from database tables.
The class 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.
An example:
DatabaseDictionary dictionary = new DatabaseDictionary();
dictionary.setDriver("interbase.interclient.Driver");
dictionary.setURL("jdbc:interbase://innoview.fi/d:/database/javadcalc.gdb");
dictionary.setUser("dcalc");
dictionary.setPassword("dcalc");
dictionary.setLanguageTable("LanguageTable");
dictionary.setTranslationTable("TranslationTable");
try
{
dictionary.open();
}
catch (Exception e)
{
}
- See Also:
- ServerDictionary
-
ENGLISH_NAME_C
- The index of the English language name in the language table.
-
ISO_COUNTRIES_C
- The index of the ISO country codes in the language table.
-
ISO_DEFAULT_COUNTRY_C
- The index of the default ISO country code in the language table.
-
ISO_LANGUAGE_C
- The index of the ISO language code in the language table.
-
NATIVE_NAME_C
- The index of the native language name in the language table.
-
TEST_C
- The index of the test flag in the language table.
-
DatabaseDictionary()
-
-
close()
- Closes the dictionary.
-
getDriver()
- Gets the JDBC driver name.
-
getLanguage(ResultSet)
-
-
getLanguageCount()
- Gets the amount of the languages in the dictionary.
-
getLanguageData(int)
- Gets the specified language.
-
getLanguageDatas()
- Gets the all languages.
-
getLanguageTable()
- Gets the language table name.
-
getTranslationTable()
- Gets the translation table name.
-
open()
- Opens the dictionary.
-
setDriver(String)
- Sets the JDBC driver name.
e.g.
-
setLanguageTable(String)
- Sets the language table name.
-
setTranslationTable(String)
- Sets the translation table name.
-
translateString(String)
- Returns the translation of the native string in the current language.
ENGLISH_NAME_C
public final int ENGLISH_NAME_C
- The index of the English language name in the language table.
NATIVE_NAME_C
public final int NATIVE_NAME_C
- The index of the native language name in the language table.
TEST_C
public final int TEST_C
- The index of the test flag in the language table.
ISO_LANGUAGE_C
public final int ISO_LANGUAGE_C
- The index of the ISO language code in the language table.
ISO_COUNTRIES_C
public final int ISO_COUNTRIES_C
- The index of the ISO country codes in the language table.
ISO_DEFAULT_COUNTRY_C
public final int ISO_DEFAULT_COUNTRY_C
- The index of the default ISO country code in the language table.
DatabaseDictionary
public DatabaseDictionary()
open
public void open() throws Exception
- Opens the dictionary.
- Overrides:
- open in class Dictionary
close
public void close()
- Closes the dictionary.
- Overrides:
- close in class Dictionary
getLanguageCount
public int getLanguageCount()
- Gets the amount of the languages in the dictionary.
- Overrides:
- getLanguageCount in class Dictionary
getLanguage
protected Language getLanguage(ResultSet rs) throws Exception
getLanguageData
public Language getLanguageData(int index) throws Exception
- Gets the specified language.
- Overrides:
- getLanguageData in class Dictionary
getLanguageDatas
public Language[] getLanguageDatas() throws Exception
- Gets the all languages.
- Overrides:
- getLanguageDatas in class Dictionary
translateString
protected String translateString(String str)
- Returns the translation of the native string in the current language.
- Overrides:
- translateString in class Dictionary
setDriver
public void setDriver(String value)
- Sets the JDBC driver name.
e.g. "sun.jdbc.odbc.JdbcOdbcDriver" for the ODBC-JDBC bridge.
getDriver
public String getDriver()
- Gets the JDBC driver name.
setLanguageTable
public void setLanguageTable(String value)
- Sets the language table name.
- See Also:
- setTranslationTable
getLanguageTable
public String getLanguageTable()
- Gets the language table name.
- See Also:
- getTranslationTable
setTranslationTable
public void setTranslationTable(String value)
- Sets the translation table name.
- See Also:
- setLanguageTable
getTranslationTable
public String getTranslationTable()
- Gets the translation table name.
- See Also:
- getLanguageTable
All Packages Class Hierarchy This Package Previous Next Index