Required External Jar: mysql-connector-java-5.1.40-bin.jar to connect to Data Base. Add this jar by right clicking the project -->Build Path--> Add external Archieve. Create the Flow as Flowing
2) Database Connector Configuration: Select MySQL as your database by double clicking the Database connector and fill all the details as mentioned. After that Click Test Connection which will give Connection Successfull...
In Query: Select * from test.contact where test is my schema and Contact is my table name.
3)Object to JSON: Drag Object to JSON connector and leave it as it is without any modifications.
4)Set Payload: Drag the Set Payload connector and set the value attribute to #[payload]
Final Step: Deploye the code and run as http://localhost:8089/test
8089 is my port number.. whatever yours u need to give that.
When you run you can see the following output in Json Format