Jump to: navigation, search

Difference between revisions of "EclipseLink/UserGuide/DBWS/Creating from a Stored Function"

m (Creating from a Stored Function)
m
 
Line 1: Line 1:
{{EclipseLink_UserGuide
+
'''[[Image:Elug_draft_icon.png|Warning]] This page is obsolete. Please see ''[http://www.eclipse.org/eclipselink/documentation/ Developing Persistence Architectures Using EclipseLink Database Web Services]'' for current information.'''
|info=y
+
|toc=n
+
|eclipselink=y
+
|eclipselinktype=DBWS
+
}}
+
 
+
==Creating from a Stored Function ==
+
The EclipseLink DBWS can create a Web service that exposes a simple Stored Function.
+
 
+
 
+
===Example===
+
In this example, the following stored function will be used:
+
 
+
<source lang="sql">
+
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;
+
</source>
+
 
+
The <tt>DBWSBuilder</tt> utility requires a DBWS configuration XML file as input, as shown here:
+
 
+
<source lang="xml">
+
<?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>
+
</source>
+
 
+
Execute the DBWSBuilder, as shown here:
+
 
+
<source lang="text">
+
prompt > dbwsbuilder.cmd -builderFile dbws-builder.xml -stageDir output_directory -packageAs wls testEcho.war
+
</source>
+
 
+
where
+
* <tt>dbws-builder.xml</tt> is the DBWS builder configuration XML file above
+
* <tt>output_directory</tt> is the output directory for the generated files
+
* <tt>-packageAs</tt> the platform on which the web service will be deployed
+

Latest revision as of 12:18, 30 January 2013

Warning This page is obsolete. Please see Developing Persistence Architectures Using EclipseLink Database Web Services for current information.