| (go back to full page) Enterprise Data Services The Enterprise Data Services (EDS) allow developers to easily connect to databases through client-side dojo.data stores. Within the EDS, there are three components that make it easy to pull data from a database and present it within a Dojo Component.
You will need to create an IMB Session for the Enterprise Data Services to work properly. Service Request Creation<script type="text/xml" dojoType="dojoe.XmlScript"> <declarations> <nexaweb.eds.ServiceRequest dataRequestId="selectWishes" id="selectWishesSR" jsId="selectWishesSR"/> <nexaweb.eds.ServiceRequest dataRequestId="insertWish" id="insertWishSR" jsId="insertWishSR"> <parameters> <parameter><![CDATA[{0}]]></parameter> </parameters> </nexaweb.eds.ServiceRequest> </declarations> </script> nexaweb-data.xml Snippet<dataRequestDefinition id="insertWish"> <serviceResourceReference dataServiceId="Sql" serviceResourceId="insertWish_Statement"/> </dataRequestDefinition> <dataRequestDefinition id="selectWishes"> <serviceResourceReference dataServiceId="Sql" serviceResourceId="selectWishes_Statement"/> </dataRequestDefinition> nexaweb-sql.xml Snippet<connectionDefinitions> <connectionDefinition id="engineering" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://server_name/engineering?user=username&password=pwd"/> </connectionDefinitions> <statementDefinitions> <sqlStatement connectionId="engineering" id="insertWish_Statement"> <statement> INSERT INTO WISH_LIST (WISH_ITEM) values (''{0}'') </statement> </sqlStatement> <sqlSelect connectionId="engineering" id="selectWishes_Statement"> <table>WISH_LIST</table> </sqlSelect> </statementDefinitions> statementDefinitions use Java's MessageFormatting to do the parameter substitution, so you will need to escape ' and {} or else it won't work properly. There is much more information on EDS located in the Nexaweb Dev Center, click here to read more. |