Showing posts with label Postgresql. Show all posts
Showing posts with label Postgresql. Show all posts

Wednesday, May 29, 2019

Working with Postgresql database using Ballerina

  1. First, install Postgresql database.
  2. Download the postgresql driver jar and copy the Postgresql JDBC driver jar into $BALLERINA_HOME/bre/lib.
  3. Connect to your postgresql server and create a database:

Sample

This is the sample to create a table using the Ballerina jdbc client, then insert a BIT data type record to the table.

Ballerina version used: 0.992.0


Running the sample:

ballerina run workingWithBitDataPostgresql.bal

Output:

Create BitTypes table status: 0
Update BitTypes table status: 1