Skip to content

Instantly share code, notes, and snippets.

@abeykoon
Created July 8, 2019 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abeykoon/99b3b8be469415debd85f245278ac19b to your computer and use it in GitHub Desktop.
Save abeykoon/99b3b8be469415debd85f245278ac19b to your computer and use it in GitHub Desktop.
Dat service definition - DoctorRegistry
<data name="findDoctor" serviceGroup="" serviceNamespace="">
<description/>
<config id="doctorInformationStore">
<property name="org.wso2.ws.dataservice.user">wso2</property>
<property name="org.wso2.ws.dataservice.password">wso2</property>
<property name="org.wso2.ws.dataservice.protocol">jdbc:mysql://mysqlDataStore:3306/doctors</property>
<property name="org.wso2.ws.dataservice.driver">com.mysql.jdbc.Driver</property>
</config>
<query id="queryDoctor" useConfig="doctorInformationStore">
<sql>Select name, hospital from doctor where field=?</sql>
<param name="field" paramType="SCALAR" sqlType="STRING" type="IN"/>
<result element="doctors" rowName="doctor">
<element column="name" name="name" xsdType="xs:string"/>
<element column="hospital" name="hospital" xsdType="xs:string"/>
</result>
</query>
<resource method="GET" path="doctor/{field}">
<call-query href="queryDoctor">
<with-param name="field" query-param="field"/>
</call-query>
</resource>
</data>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment