Refer to Neuron-ESB Overview about what Neuron ESB is. In this article; I will show you how to integrate Neuron with DB2.
1. Install DB2 Client
a. Install IBM i Access for Windows on Neuron server. IBM i Access for Windows delivers TCP/IP connectivity to users running a variety of Microsoft® Windows® operating systems.
*If you are using 64 bit Neuron, install 64 bit client.
2. Configure ODBC
a. Open control panel -> administrative tools.
b. Open Data Sources (ODBC). Select 64bit ODBC if you are using 64bit Neuron.
c. Select System DSN tab.
d. Click Add..
e. Select iSeries Access ODBC Driver
f. Click Finish. iAccess setup window shows up.
h. Enter Data source name as Neudesic.
i. Enter System as your DB2 server name or IP address.
j. Leave all other tabs with default values except Conversions tab.
k. Click OK to close iSeries setup.
l. Click OK to close the ODBC administrator.
3. Test Connection using Neuron
a. Open Neuron ESB Explorer
b. Create a sample process called “DB2Sample”
c. Drag and drop C# code step and add below code.
//Prepare the SQL statement
string sql = String.Empty;
sql += “<Statement type=”Text” sql=”SELECT * FROMYourLibrary.YourTable“>”;
sql += “</Statement>”;
//Add the SQL xml to context
d. Save the code step.
e. Drag and drop ODBC step.
f. Select connection string from ODBC step properties.
g. Click Load to load all the existing data source names and select your DSN from list.
h. Test the connection by clicking Test Connection button and make sure connection is successful.
i. Click OK to close the properties and leave all other ODBC properties to default.
j. Drag and drop Trace step under ODBC.
k. Now your process should look like below:
l. Click on Test Process; Edit Test Message window appears.
m. Keep the default message and click on OK.
n. You should see the Trace output like below
4. DB2 polling using Neuron
a. Make sure step 1 and 2 are completed successfully.
b. Open Neuron ESB explorer with administrative rights.
c. Register the DB2 Adapter
i. Navigate to Connections -> Connection Methods – >Adapter Registration
ii. Create a new adapter with below configuration
iii. Save the configuration.
d. Create a DB2 endpoint
i. Navigate to Connections -> Endpoints -> Adapter EndPoints
ii. Create a new end point with below configuration.
iii. Select adapter endpoint properties.
iv. Set the connection string (Follow above 3g – 3h steps)
v. Select publishing mode and set below properties
1. Publish Topic, topic to publish the response
2. Polling Interval, polling frequence in seconds
3. Command type, either stored procedure or text
4. Polling Statement, stored procedure call or sql statement
5. Root Node Name, (optional), response will be under this root node name
6. Row Node Name, (optional), individual response records will be under this row node name
7. Number of rows; if you need to restrict the result
e. Verify that polling is working
i. Create a simple process like below, which has just an audit step.
ii. Use above process in DB2Endpoint party id (in this example it is OrderPublisher)
iii. Make sure DB2Endpoint is enabled.
iv. Go to Activity -> Database Reports -> Message History and verify messages are published for every polling interval specified in end point.
[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Make sure that the DSN used in connection string exists under System DSN.
ERROR [HY000] [IBM][iSeries Access ODBC Driver]Enlist with DTC phase failed. 2
· Set the transaction to NONE in ODBC connection, if the transaction is not required.
OR, if the transaction is required
· Open Control Panel -> Administrative Tools -> Component Services
· Select LocalDTC and enable XA transactions
Refer iSeries Access for Windows ODBC and MTS: Enlist with DTC phase failed for more information