Oracle9i XML API Reference - XDK and Oracle XML DB Release 2 (9.2) Part Number A96616-01 |
|
The TransX Utility simplifies the loading of translated seed data and messages into a database. It also reduces internationalization costs by preparing strings for translation, translating the strings, and leading. The TransX Utility minimizes translation data format errors and it accurately loads the translation contents into pre-determined locations in the database.
Development groups that load translated messages and seed data can use the TransX Utility to simplify meeting internationalization requirements. Once the data is in a predefined format, the TransX Utility validates its format. Loading translated data is automated because the encoding of the files takes advantage of XML which describes the encoding. This means that possible loading errors due to incorrect encoding are eliminated as long as the data file conforms to the XML standard.
The following pages describe the following:
java oracle.xml.transx.loader [options] connect_string username password
datasource [datasource(s)]
java oracle.xml.transx.loader -v datasource [datasource(s)]
java oracle.xml.transx.loader -x connect_string username password table
[column(s)]
java oracle.xml.transx.loader -s connect_string
username password filename table
[column(s)]
Parameter | Description |
---|---|
connect_string |
JDBC connect string. The connect string information can be omitted through the |
username |
Database user name. |
password |
Password for the database user. |
datasource |
An XML data source. |
option |
One of the options in Table 12-2, "TransX Utility Command Line Options". |
This section describes the TransX Utility application programming interface, and consists of the following classes:
Provides the methods to instantiate the TransX Interface, through which loading operations are performed.
oracle.xml.transx.loader
Method | Description |
---|---|
Get an instance of TransX. |
|
The command-line interface. |
Get an instance of TransX. See also TransX Interface.
public static TransX getLoader();
The command-line interface main function.
public static void main( String[] args);
Parameter | Description |
---|---|
args |
Command line parameters. |
Data Loading Tool API.
public interface TransX
Helps reclaim used resources. This method should be called after loading is complete. See also open().
Reports a java.sql.SQLException
.
public void close();
Loads a dataset on a file. A database connection must have been established by a preceding call to open()
. Returns the total number of inserted or updated row elements. Reports a java.lang.Exception
. See also open()
. The options are listed in the following table.
Syntax | Description |
---|---|
public int load( String file); |
Loads the XML file speficied by the |
public int load( URL url); |
Loads the XML document to which the |
Parameter | Description |
---|---|
file |
file name |
url |
URL string |
Starts a data loading session. This method establishes a database connection to the given JDBC URL to be used for subsequent load() call(s).
Reports a java.sql.SQLException
. See also load()
.
public void open( String constr, String user, String pwd);
Parameter | Description |
---|---|
constr |
|
user |
The database user on whose behalf the connection is being made. |
pwd |
The user's password. |
Sets the operation mode on duplicates. In the case when there are one or more existing rows in the database whose values in the key columns are the same as those in the dataset to be loaded, the loader, depending on the current loading mode specified by this method,
public void setLoadingMode(int mode);
Parameter | Description |
---|---|
mode |
A loading mode. The following constants are defined in Loading Mode class:
|
Instructs the loader to treat white spaces as significant. By default, the flag is FALSE.
If this call is not made, or if FALSE
is passed to the flag
argument, the loader ignores the type of white space characters in the dataset and loads them as space characters. Consecutive white space characters in the dataset are treated as one space character.
public void setPreserveWhitespace( boolean flag);
Parameter | Description |
---|---|
flag |
|
Sets the validation mode. The flag is set to TRUE
by default: If this call is not made or if true
is passed to the flag argument, the loader performs validation of the dataset format against the canonical schema definition on each load()
call. The validation mode should be disabled only if the dataset has already been validated. See also validate().
public void setValidationMode(boolean flag);
Parameter | Description |
---|---|
flag |
Determines whether the loader should be validating. |
Unloads a dataset. The options are listed in the following table. Returns the dataset in XML. Reports a java.lang.Exception
. The options are listed in the following table.
Syntax | Description |
---|---|
String[] columns )*; |
Returns the Reader which can be read. |
Writer out )*; |
Writes the unloaded dataset into the given writer. |
Parameter | Description |
---|---|
table |
A table name. |
columns |
Column names, means * when null. |
out |
A Writer to write to. |
Validate a dataset on a file or URL. Once the dataset has been validated, the validation mode can safely be disabled. The instance document does not have to be opened for validation. See also setValidationMode(). Returns TRUE
if successfully validated, FALSE
otherwise. Reports an oracle.xml.parser.schema.XSDException.
public boolean validate( String datasrc);
Parameter | Description |
---|---|
datasrc |
A file name or URL string |
|
Copyright © 2001, 2002 Oracle Corporation. All Rights Reserved. |
|