CobolScript can access MySQL server using a Node.js module.
Then, execute at command line:
This command installs the
mysql module, according to the dependecies described in
With the command line:
node run showdb.cob
The program connects to the MySQL server at localhost and list its database. The server must be running.
perform require using "mysql" giving mysql.
local options. move object to options. move "root" to user in options. move "" to password in options. local connection. perform createConnection in mysql using options giving connection.
opens the connection.
perform query in connection using "show databases" showdbs. showdbs section using err, rows, fields. * ....
showdbs as a callback to asynchronous method
connection. The callbacks accept three parameters.