Modified the main to include the newly added gateway samples and changed the .md file

This commit is contained in:
Amol Nayak
2011-12-16 08:44:51 +05:30
parent db9579d478
commit fa14acf3ab
2 changed files with 111 additions and 20 deletions

View File

@@ -4,6 +4,18 @@ Spring Integration - JDBC Sample
# Overview
This sample provides example of how the Jdbc Adapters can be used.
The example presented covers the following two use cases
* Find a User detail from the database based on the name provided
* Create a new Person record in the table
The first example demonstrates the use of outbound gateway to search for a user record using the
spring integration's jdbc outbound gateway
The second example on other hand demonstrates how the jdbc outbound gateway be used to create a new
Person record and then return the newly created Person record.
This example demonstrates how to make use of the sql parameter source factory to extract
the required values to be inserted/updated/selected in the query provided.
# Getting Started
@@ -14,18 +26,23 @@ You can run the application by either
- mvn package
- mvn exec:java
Currently one example exists. On the command prompt you can enter the following valid values and get a response back:
Make an appropriate choice for searching a User or creating a Person
For selecting the User, on the command prompt you can enter the following valid values and get a response back:
* 'a'
* 'b'
* 'foo'
#Sample "Person Outbound Gateway"
For creating the person record, select the appropriate steps as prompted by the application
#Some details about the sample "Person Outbound Gateway"
We use the outbound gateway to insert records in a Person table based on the values contained
in the message payload that is received over the channel to the adapter.
The following are used to configure the gateway
* The request and reply channels
* The data source for the database
* The the update/insert statement to be executed.
@@ -35,6 +52,7 @@ The following are used to configure the gateway
* RowMapper if you intend to map the ResultSet to your custom object
The following sequence of events happen when we invoke the createPerson method on the gateway
* The parameter of type Person is sent as a payload of a message over the reply-channel
* The outbound gateway reads this message and extracts the payload
* It then executes the given insert statement, the values to be inserted are derived from the payload