Uncategorized

Connect to IBM Db2 with Go

In a previous post, I demonstrated how to connect to an IBM Db2 database using PHP. However, PHP isn’t the only language with a native driver for IBM Db2. Another popular language with an IBM Db2 driver is Go…and coincidentally, that’s also the topic of this post. Install the IBM Db2 driver in your Go module as below: go get github.com/ibmdb/go_ibm_db As with other databases, you use the IBM Db2… Read More »Connect to IBM Db2 with Go

Connect to IBM Db2 with PHP

IBM Db2 is available as a fully-managed cloud RDBMS via IBM Cloud, or as a self-managed deployment via the IBM Db2 Community Edition. Regardless of how it’s deployed, you can access it either with a native-language driver or via its REST API. If you’re using PHP, a native driver is available as a PECL extension. Detailed installation instructions are available in the PHP IBM Db2 extension repository on GitHub. Once… Read More »Connect to IBM Db2 with PHP

Access IBM Cloud Service Credentials from a PHP Application

Both IBM Cloud Foundry and IBM Cloud Code Engine use a JSON-encoded environment variable to expose service bindings: VCAP_SERVICES for IBM Cloud Foundry and CE_SERVICES for IBM Cloud Code Engine. These variables provide important information, such as access credentials, API endpoints, key names and identifiers, which your application will need to connect to the corresponding services. If you’re using PHP, you can access this variable using the getenv() function. You… Read More »Access IBM Cloud Service Credentials from a PHP Application

Install and Use Plugins with the IBM Cloud CLI

I recently discovered an interesting feature of the IBM Cloud CLI: plugins. These plugins, which are usually linked to specific IBM Cloud services, add new commands and functions to the IBM Cloud CLI. The IBM Cloud CLI provides a simple interface to install, uninstall, update and search for plugins via the ibmcloud plugin command. To use a plugin, you must first install it with the ibmcloud plugin install command. Here’s… Read More »Install and Use Plugins with the IBM Cloud CLI

Check and Refresh IBM Cloud Access Tokens with PHP

To access an IBM Cloud service instance, you must have an IAM access token. To obtain an IAM access token, you must have an API key for the service. Access tokens can be obtained directly from the IBM Cloud IAM service, by making an HTTP query to the API endpoint at https://iam.cloud.ibm.com/identity/token and including an API key in the request. Here’s an example: curl -X POST 'https://iam.cloud.ibm.com/identity/token' -H 'Content-Type: application/x-www-form-urlencoded'… Read More »Check and Refresh IBM Cloud Access Tokens with PHP

Integrate a Node.js Application Quickly with IBM Cloudant

IBM Cloudant is a fully-managed, distributed database that runs as a service on IBM Cloud. It is based on Apache CouchDB and the easiest way to access it is with an IBM Cloudant client library. As of this writing, IBM CLoudant client libraries are available for Node.js, Python, Go and Java. To illustrate how this works, I’ll provide a few examples of how to connect to, and use, an IBM… Read More »Integrate a Node.js Application Quickly with IBM Cloudant

Read and Write Data on IBM Cloudant with PHP

IBM Cloudant is a fully-managed, distributed database that runs as a service on IBM Cloud. It is based on Apache CouchDB (although it is not open source itself) and can be accessed using a standard HTTP REST API. If you’re building an application that uses IBM Cloudant as a data store, this REST API makes it easy to interact with the database service from any language that has an HTTP… Read More »Read and Write Data on IBM Cloudant with PHP

Deploy a Cloud-Native Database Service on IBM Cloud

A database in the cloud is a wonderful thing. It can serve as a secure, reliable and (most important) off-site data store for your application. It can also come in handy under different testing scenarios: for example, when you need to test an application refactor but can’t be bothered to spin up a database container locally, or when you’re trying to benchmark application performance under heavy load. A good example… Read More »Deploy a Cloud-Native Database Service on IBM Cloud

Create IBM Cloud Service Credentials with the IBM Cloud CLI

To access an IBM Cloud service instance, you need service credentials. These credentials can be generated via the IBM Cloud Dashboard or the IBM Cloud CLI. My preferred approach is always to use the CLI, but it can be confusing the first few times you attempt it. Here’s a quick cheat sheet: 1. Create the service instance (read more about service instance creation via the CLI). Here is an example… Read More »Create IBM Cloud Service Credentials with the IBM Cloud CLI

Create IBM Cloud Services with the IBM Cloud CLI

Most of the time, I use the IBM Cloud Dashboard with my browser to manage applications, instantiate services and check status. But sometimes, the point-and-click approach is just too slow. So, when I feel the need for speed, I switch over to the IBM Cloud CLI instead. This CLI, which is available for Windows, MacOS and Linux, provides a full-featured alternative to the browser-based IBM Cloud Dashboard. The IBM Cloud… Read More »Create IBM Cloud Services with the IBM Cloud CLI