Wednesday, May 29, 2019

Working with mysql BIT data type using Ballerina

This example is written using Ballerina MYSQL Client which is used to access and manipulate data in MYSQL databases.
  1. First, you need to install MySQL. 
  2. Download and install Ballerina 0.992.0.
  3. Copy the MySQL JDBC driver(mysql-connector-java-5.1.39.jar) to the BALLERINA_HOME/bre/lib folder and change the DB connection properties as required.
Sample


How to run:

ballerina run workingWithBitData.bal

Output:
Create database testdb status: 1
Create bittypes table status: 0
Update bittypes table status: 1
Update bittypes table status: 1
===================================
1
true
[0, 0, 0, 0, 0, 0, 0, 14]
2
true
[0, 0, 0, 0, 0, 1, 2, 3]
===================================
Drop Database testdb status: 1

No comments:

Post a Comment