Interact with a Postgresql database with Ballerina!
Published in
1 min readAug 12, 2018
We are going to try out a simple example of interacting with a postgresql database with Ballerina programming language.
- First you need to have postgresql installed.
- Also download and install Ballerina 0.981.0
- Download the postgresql driver (I used the version 42.2.1)
Now connect to your postgresql server and create a database called “customerdb”. That is the one we are going to connect through our Ballerina program.
Here goes the Ballerina program. We are simply creating a table using the Ballerina jdbc client, then insert a record to the table and retrieve the data from that table and iterate!