database access


© 2008 IBM Corporation ® WebSphere Message Broker V6.1.0.2 Data Access IBM Software Group | WebSphere software 2 Database Access In Message Broker  Message Broker provides convenient and easy access to databases from a message flow  You can read, update, delete database content if you have the authority to do so  Databases can be accessed from flows as follows: – Codelessly • Mapping node, DatabaseRoute Node, Database Retrieve node, DatabaseInsert node, DatabaseDelete node – Via coded statements • Compute node, JavaCompute node, Database node, Filter node  The following databases are supported – DB2, Oracle, Sybase, SQL Server, Informix IBM Software Group | WebSphere software 3 DatabaseRoute Node  Similar to Route, but matches on contents of a database rather than the input message 31000RogerColins00003 26000HarryJones00002 20000JohnSmith00001 SalaryFirstNameLastNameEmpNo Look up employee 00002 If last name is Jones If salary between 20000 and 26000 IBM Software Group | WebSphere software 4 Configuring the DatabaseRoute Node [1] For example, if the incoming message has $Body/EmpRecord/EmpNumber = “00001” do the SQL query SELECT EMPLOYEE.SALARY, EMPLOYEE.LASTNAME FROM EMPLOYEE WHERE EMPLOYEE.EMPNO = “00001” IBM Software Group | WebSphere software 5 Configuring the DatabaseRoute Node [2]  If the retrieved value of the LASTNAME column has a last name of Jones, route to out_exp1  If the retrieved value of the SALARY column has a value of between 20000 and 26000, route to out_exp2  If both are true and Distribution Mode is set to ‘all’, route to out_exp1 then out_exp2.  If both are true and Distribution Mode is set to ‘first’, route to the first match only (out_exp1)  If neither are true, route to the default terminal IBM Software Group | WebSphere software 6 DatabaseRetrieve Node  Allows data to be retrieved from one or more database tables  The retrieved data is stored as elements within this node’s out going message.  Queries can span multiple tables and select multiple predicates  Configuration is similar to that of the DatabaseRoute node Look up employee 00002 Output message Set $Body/EmpRecord/Surname to value of EMPLOYEE.LASTNAME Set $Body/EmpRecord/Wage to value of EMPLOYEE.SALARY (Key not found) IBM Software Group | WebSphere software 7 Configuring the DatabaseRetrieve Node IBM Software Group | WebSphere software 8 The Task At Hand  In the next lab we will import a supplied message that contains DatabaseRoute and DatabaseRetrieve nodes  An MQ message is processed that contains an employee number  Details about the employee are retrieved from a database and inserted into the message  A database join is done to provide the basis for routing decisions  We deploy the flow and exercise it with various messages and observe the results IBM Software Group | WebSphere software 9 Here Is The Flow We Will Import
还剩8页未读

继续阅读

下载pdf到电脑,查找使用更方便

pdf的实际排版效果,会与网站的显示效果略有不同!!

需要 10 金币 [ 分享pdf获得金币 ] 0 人已下载

下载pdf

pdf贡献者

com_zyq

贡献于2016-12-10

下载需要 10 金币 [金币充值 ]
亲,您也可以通过 分享原创pdf 来获得金币奖励!
下载pdf