![]() | ![]() |
Home |
|
|
XML Services in Adaptive Server Enterprise |
|
| Appendix A Setting up XML Services |
Appendix A
This appendix provides instructions for setting up both the integrated XML processor and the Java-based processor.
To use XML Services, you must enable it using this sp_configure command:
sp_configure "enable xml", 1
Since the functions in Chapter 4, "XML Mapping Functions" are Java-based, you must install them in the server before you can use them. This section provides instructions for installing the Java-based functions.
These functions must be installed in the server before you can use them:
forxmlj
forxmldtdj
forxmlschemaj
forxmlallj
forsqlcreatej
forsqlinsertj
forsqlscriptj
You can find guidelines and setup scripts for installing these facilities, together with source code and JavaDoc for them, in the following directory:
$SYBASE/$SYBASE_ASE/sample
To install the Java-based SQLX mapping functions, follow the procedures outlined in this section.
Environment variablesThe environmental variables in Table A-1 already exist in the server utilities.
Variable | Value |
$ISERVER | "-S" parameter for isql and installjava utilities |
$INTERFACES | "-I" parameter for isql and installjava utilities |
$DB | "-D" parameter for isql and installjava utilities |
Install the Java-based XML parser, using either the make install-xerces command in the setup directory referenced in the directory $SYBASE/$SYBASE_ASE/sample, or a client utility command such as the following:
installjava -f $SYBASE/$SYBASE_ASE/lib/xerces.jar
-j "xerces_jar"\
-D $DB -S $ISERVER -I $INTERFACES
-update -Usa -P"" The Java-based XML parser is needed for forsqlcreatej, forsqlinsertj, and forsqlscriptj; it is not needed for forxmlj, forxmldtdj, forxmlschemaj, or forxmlallj.
Installing the mapping functionsInstall the Java-based SQLX mapping classes, using either the make install-sqlx command in the setup directory referenced in $SYBASE/$SYBASE_ASE/sample, or a client utility command such as the following.
installjava
-f.. /SQLX-examples/sqlx.jar -j"sqlx_jar"\
-D $DB -S $ISERVER -I $INTERFACES
-update -Usa -P"Creating alias namesYou can create SQL alias names for the Java methods of the SQLX mapping classes, using either the make sqlx-aliases command in the setup directory referenced in $SYBASE/$SYBASE_ASE/sample, or server SQL commands such as the following:
create procedure forxmlallj
(queryparmparm java.lang.String, optionparm
java.lang.String,
out rsout java.lang.String,
out schemaout java.lang.String,
out dtdout java.lang.String )
language java parameter style java
external name "jcs.sqlx.ForXml.forXmlAll"
create function forxmlj
(queryparm java.lang.String, optionparm
java.lang.String)
returns java.lang.String
language java parameter style java
external name "jcs.sqlx.ForXml.forXml"
create function forxmlschemaj
(queryparm java.lang.String,optionparm
java.lang.String)
returns java.lang.String
language java parameter style java
external name "jcs.sqlx.ForXml.forXmlSchema"
create function forxmldtdj
(queryparm java.lang.String, optionparm
java.lang.String)
returns java.lang.String
language java parameter style java
external name "jcs.sqlx.ForXml.forXmlDTD"
create function forsqlcreatej
(schemax java.lang.String, optionparm
java.lang.String)
returns java.lang.String
language java parameter style java
external name "jcs.sqlx.SqlxCommand.forSqlCreate"
create function forsqlinsertj
(inDoc java.lang.String, optionparm java.lang.String)
returns java.lang.String
language java parameter style java
external name "jcs.sqlx.SqlxCommand.forSqlInsert"
create function forsqlscriptj
(schemax java.lang.String, inDoc java.lang.String,
optionparm java.lang.String)
returns java.lang.String
language java parameter style java
external name "jcs.sqlx.SqlxCommand.forSqlScript"
|
|