This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener). # HTTP URLs that Could Not Be Fixed These URLs were unable to be fixed. Please review them to see if they can be manually resolved. * http://rss.cnn.com/rss/cnn_topstories.rss (200) with 1 occurrences could not be migrated: ([https](https://rss.cnn.com/rss/cnn_topstories.rss) result ClosedChannelException). * http://wsf.cdyne.com/WeatherWS/Weather.asmx (200) with 1 occurrences could not be migrated: ([https](https://wsf.cdyne.com/WeatherWS/Weather.asmx) result ConnectTimeoutException). # Fixed URLs ## Fixed But Review Recommended These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended. * http://local.yahooapis.com/MapsService/V1/trafficData?appid=YdnDemo&zip= (UnknownHostException) with 1 occurrences migrated to: https://local.yahooapis.com/MapsService/V1/trafficData?appid=YdnDemo&zip= ([https](https://local.yahooapis.com/MapsService/V1/trafficData?appid=YdnDemo&zip=) result UnknownHostException). * http://static.springsource.org/spring-integration/reference/htmlsingle/ (301) with 2 occurrences migrated to: https://docs.spring.io/spring-integration/reference/htmlsingle/ ([https](https://static.springsource.org/spring-integration/reference/htmlsingle/) result 404). * http://schema.cloudfoundry.org (404) with 1 occurrences migrated to: https://schema.cloudfoundry.org ([https](https://schema.cloudfoundry.org) result 404). * http://schema.cloudfoundry.org/spring/cloudfoundry-spring.xsd (404) with 5 occurrences migrated to: https://schema.cloudfoundry.org/spring/cloudfoundry-spring.xsd ([https](https://schema.cloudfoundry.org/spring/cloudfoundry-spring.xsd) result 404). * http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP (404) with 2 occurrences migrated to: https://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP ([https](https://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP) result 404). * http://ws.cdyne.com/WeatherWS/Weather.asmx (404) with 1 occurrences migrated to: https://ws.cdyne.com/WeatherWS/Weather.asmx ([https](https://ws.cdyne.com/WeatherWS/Weather.asmx) result 404). * http://www.example.org/prodcuts (404) with 1 occurrences migrated to: https://www.example.org/prodcuts ([https](https://www.example.org/prodcuts) result 404). * http://www.springframework.org/schema/integration/script.xsd (404) with 4 occurrences migrated to: https://www.springframework.org/schema/integration/script.xsd ([https](https://www.springframework.org/schema/integration/script.xsd) result 404). * http://www.springframework.org/schema/integration/splunk/spring-integration-splunk.xsd (404) with 1 occurrences migrated to: https://www.springframework.org/schema/integration/splunk/spring-integration-splunk.xsd ([https](https://www.springframework.org/schema/integration/splunk/spring-integration-splunk.xsd) result 404). * http://www.w3schools.com/xml/FahrenheitToCelsius (301) with 1 occurrences migrated to: https://www.w3schools.com/xml/FahrenheitToCelsius ([https](https://www.w3schools.com/xml/FahrenheitToCelsius) result 404). ## Fixed Success These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended. * http://activemq.apache.org/peer-transport-reference.html with 1 occurrences migrated to: https://activemq.apache.org/peer-transport-reference.html ([https](https://activemq.apache.org/peer-transport-reference.html) result 200). * http://activemq.apache.org/schema/core/activemq-core-5.4.2.xsd with 1 occurrences migrated to: https://activemq.apache.org/schema/core/activemq-core-5.4.2.xsd ([https](https://activemq.apache.org/schema/core/activemq-core-5.4.2.xsd) result 200). * http://maven.apache.org/xsd/maven-4.0.0.xsd with 68 occurrences migrated to: https://maven.apache.org/xsd/maven-4.0.0.xsd ([https](https://maven.apache.org/xsd/maven-4.0.0.xsd) result 200). * http://tiles.apache.org/dtds/tiles-config_2_1.dtd with 3 occurrences migrated to: https://tiles.apache.org/dtds/tiles-config_2_1.dtd ([https](https://tiles.apache.org/dtds/tiles-config_2_1.dtd) result 200). * http://www.springframework.org/schema/aop/spring-aop.xsd with 1 occurrences migrated to: https://www.springframework.org/schema/aop/spring-aop.xsd ([https](https://www.springframework.org/schema/aop/spring-aop.xsd) result 200). * http://www.springframework.org/schema/beans/spring-beans.xsd with 136 occurrences migrated to: https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200). * http://www.springframework.org/schema/context/spring-context-4.1.xsd with 1 occurrences migrated to: https://www.springframework.org/schema/context/spring-context-4.1.xsd ([https](https://www.springframework.org/schema/context/spring-context-4.1.xsd) result 200). * http://www.springframework.org/schema/context/spring-context.xsd with 34 occurrences migrated to: https://www.springframework.org/schema/context/spring-context.xsd ([https](https://www.springframework.org/schema/context/spring-context.xsd) result 200). * http://www.springframework.org/schema/data/mongo/spring-mongo.xsd with 2 occurrences migrated to: https://www.springframework.org/schema/data/mongo/spring-mongo.xsd ([https](https://www.springframework.org/schema/data/mongo/spring-mongo.xsd) result 200). * http://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd with 9 occurrences migrated to: https://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd ([https](https://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd) result 200). * http://www.springframework.org/schema/integration/event/spring-integration-event.xsd with 1 occurrences migrated to: https://www.springframework.org/schema/integration/event/spring-integration-event.xsd ([https](https://www.springframework.org/schema/integration/event/spring-integration-event.xsd) result 200). * http://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd with 1 occurrences migrated to: https://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd ([https](https://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd) result 200). * http://www.springframework.org/schema/integration/file/spring-integration-file.xsd with 11 occurrences migrated to: https://www.springframework.org/schema/integration/file/spring-integration-file.xsd ([https](https://www.springframework.org/schema/integration/file/spring-integration-file.xsd) result 200). * http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd with 5 occurrences migrated to: https://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd ([https](https://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd) result 200). * http://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd with 5 occurrences migrated to: https://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd ([https](https://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd) result 200). * http://www.springframework.org/schema/integration/http/spring-integration-http.xsd with 10 occurrences migrated to: https://www.springframework.org/schema/integration/http/spring-integration-http.xsd ([https](https://www.springframework.org/schema/integration/http/spring-integration-http.xsd) result 200). * http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd with 8 occurrences migrated to: https://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd ([https](https://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd) result 200). * http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd with 8 occurrences migrated to: https://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd ([https](https://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd) result 200). * http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd with 11 occurrences migrated to: https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd ([https](https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd) result 200). * http://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd with 3 occurrences migrated to: https://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd ([https](https://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd) result 200). * http://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd with 1 occurrences migrated to: https://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd ([https](https://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd) result 200). * http://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd with 4 occurrences migrated to: https://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd ([https](https://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd) result 200). * http://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd with 2 occurrences migrated to: https://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd ([https](https://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd) result 200). * http://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd with 2 occurrences migrated to: https://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd ([https](https://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd) result 200). * http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd with 4 occurrences migrated to: https://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd ([https](https://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd) result 200). * http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd with 3 occurrences migrated to: https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd ([https](https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd) result 200). * http://www.springframework.org/schema/integration/spring-integration.xsd with 125 occurrences migrated to: https://www.springframework.org/schema/integration/spring-integration.xsd ([https](https://www.springframework.org/schema/integration/spring-integration.xsd) result 200). * http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd with 27 occurrences migrated to: https://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd ([https](https://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd) result 200). * http://www.springframework.org/schema/integration/twitter/spring-integration-twitter.xsd with 4 occurrences migrated to: https://www.springframework.org/schema/integration/twitter/spring-integration-twitter.xsd ([https](https://www.springframework.org/schema/integration/twitter/spring-integration-twitter.xsd) result 200). * http://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd with 2 occurrences migrated to: https://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd ([https](https://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd) result 200). * http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd with 4 occurrences migrated to: https://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd ([https](https://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd) result 200). * http://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd with 1 occurrences migrated to: https://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd ([https](https://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd) result 200). * http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd with 2 occurrences migrated to: https://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd ([https](https://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd) result 200). * http://www.springframework.org/schema/jdbc/spring-jdbc.xsd with 5 occurrences migrated to: https://www.springframework.org/schema/jdbc/spring-jdbc.xsd ([https](https://www.springframework.org/schema/jdbc/spring-jdbc.xsd) result 200). * http://www.springframework.org/schema/jee/spring-jee.xsd with 1 occurrences migrated to: https://www.springframework.org/schema/jee/spring-jee.xsd ([https](https://www.springframework.org/schema/jee/spring-jee.xsd) result 200). * http://www.springframework.org/schema/mvc/spring-mvc.xsd with 2 occurrences migrated to: https://www.springframework.org/schema/mvc/spring-mvc.xsd ([https](https://www.springframework.org/schema/mvc/spring-mvc.xsd) result 200). * http://www.springframework.org/schema/oxm/spring-oxm.xsd with 2 occurrences migrated to: https://www.springframework.org/schema/oxm/spring-oxm.xsd ([https](https://www.springframework.org/schema/oxm/spring-oxm.xsd) result 200). * http://www.springframework.org/schema/rabbit/spring-rabbit.xsd with 11 occurrences migrated to: https://www.springframework.org/schema/rabbit/spring-rabbit.xsd ([https](https://www.springframework.org/schema/rabbit/spring-rabbit.xsd) result 200). * http://www.springframework.org/schema/security/spring-security.xsd with 1 occurrences migrated to: https://www.springframework.org/schema/security/spring-security.xsd ([https](https://www.springframework.org/schema/security/spring-security.xsd) result 200). * http://www.springframework.org/schema/task/spring-task-4.2.xsd with 1 occurrences migrated to: https://www.springframework.org/schema/task/spring-task-4.2.xsd ([https](https://www.springframework.org/schema/task/spring-task-4.2.xsd) result 200). * http://www.springframework.org/schema/task/spring-task.xsd with 8 occurrences migrated to: https://www.springframework.org/schema/task/spring-task.xsd ([https](https://www.springframework.org/schema/task/spring-task.xsd) result 200). * http://www.springframework.org/schema/tx/spring-tx.xsd with 3 occurrences migrated to: https://www.springframework.org/schema/tx/spring-tx.xsd ([https](https://www.springframework.org/schema/tx/spring-tx.xsd) result 200). * http://www.springframework.org/schema/util/spring-util.xsd with 7 occurrences migrated to: https://www.springframework.org/schema/util/spring-util.xsd ([https](https://www.springframework.org/schema/util/spring-util.xsd) result 200). * http://www.w3schools.com/xml/tempconvert.asmx with 1 occurrences migrated to: https://www.w3schools.com/xml/tempconvert.asmx ([https](https://www.w3schools.com/xml/tempconvert.asmx) result 200). * http://www.eaipatterns.com/MessagingGateway.html (302) with 2 occurrences migrated to: https://www.enterpriseintegrationpatterns.com/MessagingGateway.html ([https](https://www.eaipatterns.com/MessagingGateway.html) result 301). * http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd with 2 occurrences migrated to: https://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd ([https](https://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd) result 302). * http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd with 5 occurrences migrated to: https://java.sun.com/xml/ns/javaee/web-app_2_5.xsd ([https](https://java.sun.com/xml/ns/javaee/web-app_2_5.xsd) result 302). * http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd with 1 occurrences migrated to: https://java.sun.com/xml/ns/javaee/web-app_3_0.xsd ([https](https://java.sun.com/xml/ns/javaee/web-app_3_0.xsd) result 302). * http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd with 1 occurrences migrated to: https://java.sun.com/xml/ns/persistence/persistence_2_0.xsd ([https](https://java.sun.com/xml/ns/persistence/persistence_2_0.xsd) result 302). # Ignored These URLs were intentionally ignored. * http://activemq.apache.org/schema/core with 2 occurrences * http://jakarta.apache.org/log4j/ with 1 occurrences * http://java.sun.com/xml/ns/j2ee with 4 occurrences * http://java.sun.com/xml/ns/javaee with 8 occurrences * http://java.sun.com/xml/ns/persistence with 2 occurrences * http://localhost:8080/http/receiveGateway with 1 occurrences * http://localhost:8080/multipart-http/inboundAdapter.htm with 1 occurrences * http://localhost:8080/postGateway with 1 occurrences * http://localhost:8084/traffic/v1/incidents?key= with 1 occurrences * http://maven.apache.org/POM/4.0.0 with 136 occurrences * http://schema.cloudfoundry.org/spring with 9 occurrences * http://www.example.org/orders with 2 occurrences * http://www.springframework.org/schema/aop with 2 occurrences * http://www.springframework.org/schema/beans with 273 occurrences * http://www.springframework.org/schema/context with 69 occurrences * http://www.springframework.org/schema/data/mongo with 4 occurrences * http://www.springframework.org/schema/integration with 250 occurrences * http://www.springframework.org/schema/integration/amqp with 18 occurrences * http://www.springframework.org/schema/integration/event with 2 occurrences * http://www.springframework.org/schema/integration/feed with 2 occurrences * http://www.springframework.org/schema/integration/file with 21 occurrences * http://www.springframework.org/schema/integration/ftp with 10 occurrences * http://www.springframework.org/schema/integration/groovy with 10 occurrences * http://www.springframework.org/schema/integration/http with 20 occurrences * http://www.springframework.org/schema/integration/ip with 16 occurrences * http://www.springframework.org/schema/integration/jdbc with 16 occurrences * http://www.springframework.org/schema/integration/jms with 22 occurrences * http://www.springframework.org/schema/integration/jmx with 6 occurrences * http://www.springframework.org/schema/integration/jpa with 2 occurrences * http://www.springframework.org/schema/integration/mail with 9 occurrences * http://www.springframework.org/schema/integration/mongodb with 4 occurrences * http://www.springframework.org/schema/integration/rmi with 4 occurrences * http://www.springframework.org/schema/integration/script with 4 occurrences * http://www.springframework.org/schema/integration/scripting with 8 occurrences * http://www.springframework.org/schema/integration/sftp with 6 occurrences * http://www.springframework.org/schema/integration/splunk with 2 occurrences * http://www.springframework.org/schema/integration/stream with 57 occurrences * http://www.springframework.org/schema/integration/twitter with 8 occurrences * http://www.springframework.org/schema/integration/websocket with 4 occurrences * http://www.springframework.org/schema/integration/ws with 8 occurrences * http://www.springframework.org/schema/integration/xml with 2 occurrences * http://www.springframework.org/schema/integration/xmpp with 4 occurrences * http://www.springframework.org/schema/jdbc with 10 occurrences * http://www.springframework.org/schema/jee with 2 occurrences * http://www.springframework.org/schema/mvc with 4 occurrences * http://www.springframework.org/schema/oxm with 4 occurrences * http://www.springframework.org/schema/p with 2 occurrences * http://www.springframework.org/schema/rabbit with 22 occurrences * http://www.springframework.org/schema/security with 2 occurrences * http://www.springframework.org/schema/task with 18 occurrences * http://www.springframework.org/schema/tx with 6 occurrences * http://www.springframework.org/schema/util with 14 occurrences * http://www.w3.org/2001/XMLSchema-instance with 211 occurrences
Spring Integration - Stored Procedure Example - Oracle
Overview
This sample application illustrates the usage of the Spring Integration Stored Procedure components using an Oracle™ database as a backend. Actually 2 samples are provided:
- Sample 1 Capitalizes Strings
- Sample 2 Retrieves Coffee Data
- This is sample is similar to the Stored Procedure Sample for PostgreSql
Running the Sample
Pre-requisites
This sample was tested against: Oracle Database Express Edition 11g Release 2 (which can be downloaded and used for free). Nevertheless, the example should work with other versions as well.
- Access to a Oracle or Oracle XE database instance
- Install Oracle JDBC Driver to your local Maven repository (~/.m2)
JDBC Driver Installation for Oracle
-
Go to http://www.oracle.com/technetwork/indexes/downloads/index.html
-
Under "JDBC Drivers", download the appropriate driver relevant to your Oracle and JDK version (This sample was tested using "Oracle Database 11g Release 2 JDBC Drivers")
-
Once downloaded, install the driver to your local Maven repository:
$ mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar -Dfile=~/dev/ojdbc6.jar -DgeneratePom=true -
Now you can uncomment the
ojdbc6dependency in the build.gradle file forstored-procedures-oracleproject.
After that you can run the sample application using Gradle Application Plugin:
$ gradlew :stored-procedures-oracle:run
Common Oracle Setup
Create Tablespace
CREATE TABLESPACE procedure_test
DATAFILE 'c:/data/procedure_test.dbf'
SIZE 10M
AUTOEXTEND ON NEXT 10M
MAXSIZE 100M;
Create User
CREATE USER storedproc
IDENTIFIED BY storedproc
DEFAULT TABLESPACE procedure_test
TEMPORARY TABLESPACE temp;
Grant Rights
GRANT CREATE SESSION, CREATE TABLE, CREATE VIEW, CREATE SEQUENCE, CREATE PROCEDURE TO storedproc;
ALTER USER storedproc QUOTA unlimited ON procedure_test;
Setting up the Spring Application Context
You may have to update the Oracle DB properties in:
/src/main/resources/META-INF/spring/integration/spring-integration-context.xml
<bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource" destroy-method="close">
<property name="connectionCachingEnabled" value="true" />
<property name="URL" value="jdbc:oracle:thin:@//localhost:1521/XE" />
<property name="password" value="storedproc" />
<property name="user" value="storedproc" />
<property name="connectionCacheProperties">
<props merge="default">
<prop key="MinLimit">3</prop>
<prop key="MaxLimit">20</prop>
</props>
</property>
</bean>
Running Sample 1 - Capitalizes Strings
This example provides a simple example using the stored procedure outbound gateway adapter. This example will call an Oracle Stored Procedure as well as an Oracle Function using the StoredProc Outbound Gateway.
Creating the Stored Procedure
create or replace
PROCEDURE CAPITALIZE_STRING(inoutString IN OUT VARCHAR) IS
BEGIN
SELECT upper(inoutString) INTO inoutString from dual ;
END;
Creating the Stored Function
create or replace
FUNCTION GET_COOL_NUMBER
RETURN NUMBER
IS cool_number NUMBER(11,2);
BEGIN
cool_number := 12345;
RETURN cool_number;
END;
Execute the Sample
-
running the "Main" class from within STS (Right-click on Main class --> Run As --> Java Application)
-
or from the command line:
$ gradlew :stored-procedures-oracle:run
You should see the following output:
16:05:19.556 INFO [main][org.springframework.integration.samples.storedprocedure.Main]
=========================================================
Welcome to Spring Integration's
Stored Procedure/Function Sample for Oracle
For more information please visit:
http://www.springsource.org/spring-integration
=========================================================
Please enter a choice and press <enter>:
1. Execute Sample 1 (Capitalize String)
2. Execute Sample 2 (Coffee Service)
q. Quit the application
Select Opion 1.
=========================================================
Please press 'q + Enter' to quit the application.
=========================================================
Please enter a string and press <enter>: hello world
Converting String to Uppcase using Stored Procedure...
Retrieving Numeric value via Sql Function...
Converted 'hello world' - End Result: 'HELLO WORLD_12345'.
When you enter a text, the text will be converted into upper-case using the Oracle Stored Procedure named CAPITALIZE_STRING. Afterwards, the String is concatenated with the result from calling the Oracle Stored Function GET_COOL_NUMBER.
Running Sample 2 - Coffee Service
Create Table COFFEE_BEVERAGES
CREATE TABLE "COFFEE_BEVERAGES"(
"ID" NUMBER(10,0) NOT NULL,
"COFFEE_NAME" VARCHAR2(50 CHAR) NOT NULL,
"COFFEE_DESCRIPTION" VARCHAR2(500 CHAR) NOT NULL,
CONSTRAINT "COFFEE_BEVERAGES_PK" PRIMARY KEY ("ID"));
Add Sample Data to Table COFFEE_BEVERAGES
REM INSERTING into COFFEE_BEVERAGES
SET DEFINE OFF;
Insert into COFFEE_BEVERAGES (ID,COFFEE_NAME,COFFEE_DESCRIPTION) values (1,'Espresso','Espressos keep developers going in the morning. There are never enough of them.');
Insert into COFFEE_BEVERAGES (ID,COFFEE_NAME,COFFEE_DESCRIPTION) values (2,'Cappuccino','For the finer moments. Wrap your espresso in a tasty layer of foam.');
Insert into COFFEE_BEVERAGES (ID,COFFEE_NAME,COFFEE_DESCRIPTION) values (3,'Mocha','Mmmmh, chocolate.');
Insert into COFFEE_BEVERAGES (ID,COFFEE_NAME,COFFEE_DESCRIPTION) values (4,'Latte','If you are more into milk than into foam.');
Creating the Stored Functions
Please create the following Stored Functions:
Find All Coffee Beverages
create or replace
package types
as
type cursorType is ref cursor;
end;
create or replace
FUNCTION find_all_coffee_beverages return types.cursortype
AS
l_cursor types.cursorType;
BEGIN
OPEN l_cursor FOR SELECT "ID", "COFFEE_NAME", "COFFEE_DESCRIPTION" FROM "COFFEE_BEVERAGES";
RETURN l_cursor;
END;
Find Specific Coffee Beverage
create or replace
FUNCTION find_coffee(coffee_id IN integer)
RETURN VARCHAR2 is description VARCHAR2(1000);
begin
SELECT COFFEE_DESCRIPTION into description from COFFEE_BEVERAGES where ID=coffee_id;
return description;
end;
Execute the Sample
-
running the "Main" class from within STS (Right-click on Main class --> Run As --> Java Application)
-
or from the command line:
$ gradlew :stored-procedures-oracle:run
You should see the following output:
16:05:19.556 INFO [main][org.springframework.integration.samples.storedprocedure.Main]
=========================================================
Welcome to Spring Integration's
Stored Procedure/Function Sample for Oracle
For more information please visit:
http://www.springsource.org/spring-integration
=========================================================
Please enter a choice and press <enter>:
1. Execute Sample 1 (Capitalize String)
2. Execute Sample 2 (Coffee Service)
q. Quit the application
Select Opion 2.
This should result in the following output:
* Please enter 'list' and press <enter> to get a list of coffees.
* Enter a coffee id, e.g. '1' and press <enter> to get a description.
* Please press 'q + Enter' to quit the application.
This sample also periodically polls the Oracle database using a Stored Procedure Inbound Channel Adapter:
16:06:46.669 INFO [task-scheduler-1][org.springframework.integration.handler.LoggingHandler] [Payload=[CoffeeBeverage [id=1,...
For help please take a look at the Spring Integration documentation: