Install JDK 11.0.1 (LTS) on Ubuntu 18.04

Update: End of Public Updates for Oracle JDK 8

Java SE 8 is going through the End of Public Updates process for legacy releases. Oracle will continue to provide free public updates and auto updates of Java SE 8, until at least the end of December 2020 for Personal Users, and January 2019 for Commercial Users. Source: oracle.com

Here is a step by step procedure how to install JDK 11.0.1 (LTS) on Ubuntu 18.04 x64

Download: jdk-11.0.1_linux-x64_bin.tar.gz

update-alternatives: –install needs <link> <name> <path> <priority>

The priority is an important option when you have more than one Java version installed.

Use your favorite text editor.

You might need to reboot your system.

Use the following command to configure Java on your system:

There are 2 choices for the alternative java (providing /usr/bin/java).

BTCPayServer the self-hosted payment processor for Bitcoin and other cryptocurrencies.

How it works

BTCPay Server is a self-hosted and automated invoicing system. When checking out, the customer is presented with an invoice. Each time, a different address is tied to a particular invoice, so there is no address re-use. BTCPay follows the status of the invoice through the blockchain and informs a merchant when he can fulfill the order safely.

BTCPay is a code, not a company. There is no third-party between a merchant and a customer. Merchant is always in full control of the funds. There are no processing or subscription fees. BTCPay Server is free to use and completely open-source, so developers or security auditors can always inspect the quality of the code.

Source code: https://github.com/btcpayserver/btcpayserver

SQLite – How to use fundamental functions in C++

SQLite operations in C++

This tutorial aimed to demonstrate how to use SQLite database operations such as CREATE, INSERT, UPDATE, SELECT and DELETE in C++. Since the appearance first smartphone and other mobile devices SQLite become most widely deployed and used database engine in the world. Precise numbers are difficult to obtain but SQLite is likely used more than all other database engines combined. We can find SQLite in every Android device, iPhone and iOS device, Mac, Windows10, Firefox, Chrome, Safari, Skype, Dropbox, TurboTax, QuickBooks, PHP, Python, television sets, set-top cable boxes and many automotive multimedia systems.

It’s an open-source SQL database engine. You can download the source code or precompiled binaries depending your requirements. You might also need to add [-lsqlite3] and [-std=c++17] to successfully compile, create an executable file. Each of the following source code available on my git repository.

github.com/lnrsoft/sqlite3_cpp_basics_updated or lnrrepo.ddns.net/git/lnrsoft/sqlite3_cpp_basics_updated

Use this link local_db.sqlite if you would like to download the local_db.sqlite file that I used in this tutorial.

Step 1 – The first thing we need to do is to create the actual database file that we will use in this article. I called sqltdemo.db in our case.

Compile and run our source code to create the local_db.sqlite with the following command. Here we link our code with the sqlite3 library that will create our db file.

Verify our result:

Step 2 – CREATE TABLE

Compile and run.

Step 3 – INSERT INTO our CANDIDATE TABLE

Compile and run.

Step 4 – Fetch and display records from the company CANDIDATE TABLE. In this scenario we use a callback function that obtains results from SELECT statement.

Compile and run.

Step 5 – Using UPDATE statement to update any records in our CANDIDATE table.

Compile and run.

Step 6 – DELETE statement can delete any records from the CANDIDATE table.

Compile and run.

I recommend you to check the official SQLite documentation at sqlite.org for more advance SQLite features and options and support. For further info about using sql with c++ you might found it useful to read me previous post of  a simple Qt tool to test QSqlDatabase access connection to a MySQL database. I created this simple Qt command line tool to test connection between Qt client applications and a remote Mysql Server. The code includes Secure Sockets Layer (SSL) support to test secure connection. The QSqlDatabase class provides an interface for accessing a database through a connection where an instance of QSqlDatabase represents the connection. The connection provides access to the database via one of the supported database drivers, which are derived from QSqlDriver.

Alternatively, we can subclass your own database driver from QSqlDriver. My next post will be an article how to write your own database driver in Qt for Unix, OSX and Windows platforms.