How to fetch data in Postman from MySQL Database?

 

How to fetch data in Postman from MySQL Database?

References: https://drill.apache.org/docs/use-postman-to-run-sql-queries-on-drill-data-sources/

https://documenter.getpostman.com/view/5922408/RznJmGfn

Option-1: Using Apache Drill

Prerequisite: (JAVA)

To set up Apache Drill you need to have JAVA_HOME environment variable set and include JAVA_HOME in PATH.

Steps: 

#1: Download JDK:

I choose this option and extracted and placed it in "C:\jdk-17.0.1"



#2: set the JAVA _HOME directory and Path



Download and configure Apache Drill: (JAVA)

Step 1: Download Apache Drill. This should download the file "apache-drill-1.19.0.tar.gz>> , your version may be different.

Extract the .gz file 

https://drill.apache.org/download/


Start Apache Drill:

Reference: https://drill.apache.org/docs/starting-drill-on-windows/

  • sqlline.bat -u "jdbc:drill:zk=local"
  • drill-embedded.bat (Supported in Drill 1.16 and later.)




Open Web UI of Apache Drill: http://<IP address or host name>:8047
http://localhost:8047


Download JDBC jar for MySQL and configure  

Download JDBC Jar for MySQL









Postman Section:

Here we want to execute the query to fetch the data from Employee table that is in mydb schema.

 "Select * from mydb.employee"

Create a post request  with and Headers 1) User-Name with Value mapr 2) Content-Type with Value application/json



Post request body message : 

{
"queryType""SQL",
"query""select *  from mysqlplugin.mydb.employee "
}









Comments