Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/UserGuide/DBWS/Creating from a Stored Function"
< EclipseLink | UserGuide | DBWS
m (→=Example) |
m (→Example) |
||
Line 13: | Line 13: | ||
In this example, the following stored function will be used: | In this example, the following stored function will be used: | ||
− | <source lang="sql | + | <source lang="sql"> |
DROP FUNCTION TESTECHO; | DROP FUNCTION TESTECHO; | ||
CREATE OR REPLACE FUNCTION TESTECHO(T IN VARCHAR2) RETURN VARCHAR2 IS retVal VARCHAR2 | CREATE OR REPLACE FUNCTION TESTECHO(T IN VARCHAR2) RETURN VARCHAR2 IS retVal VARCHAR2 | ||
Line 24: | Line 24: | ||
The <tt>DBWSBuilder</tt> utility requires a DBWS configuration XML file as input, as shown here: | The <tt>DBWSBuilder</tt> utility requires a DBWS configuration XML file as input, as shown here: | ||
− | <source lang="xml | + | <source lang="xml"> |
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | <dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
Revision as of 08:04, 3 November 2011
EclipseLink DBWS
EclipseLink | |
Website | |
Download | |
Community | |
Mailing List • Forums • IRC • mattermost | |
Issues | |
Open • Help Wanted • Bug Day | |
Contribute | |
Browse Source |
Creating from a Stored Function
The EclipseLink DBWS can create of a Web service that exposes a simple Stored Function.
Example
In this example, the following stored function will be used:
DROP FUNCTION TESTECHO; CREATE OR REPLACE FUNCTION TESTECHO(T IN VARCHAR2) RETURN VARCHAR2 IS retVal VARCHAR2 BEGIN retVal := CONCAT('test-' , T); RETURN retVal; END TESTECHO;
The DBWSBuilder utility requires a DBWS configuration XML file as input, as shown here:
<?xml version="1.0" encoding="UTF-8"?> <dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <properties> <property name="projectName">testEcho</property> ... database properties </properties> <procedure name="testEcho" procedurePattern="TESTECHO" returnType="xsd:string" /> </dbws-builder>
Execute the DBWSBuilder, as shown here:
prompt > dbwsbuilder.cmd -builderFile dbws-builder.xml -stageDir output_directory -packageAs wls testEcho.war
where
- dbws-builder.xml is the DBWS builder configuration XML file above
- output_directory is the output directory for the generated files
- -packageAs the platform on which the web service will be deployed