Java – Calculate the compound interest No.88

How to calculate the compound interest using Java in VS code on Ubuntu is shown in this blog. ▼1. Calculate the compound interest Rob advisor “WealthNavi” and accumulation NISA and private government bounds etc are executed by myself. the compound interest is implemented in these investments. Compound interest is increased by adding interest for the principal and adding interest for the principal + interest next year. the asset will be steadily increased using this process for a long term. Compound interest Wiki In this blog, how to calculate the compound interest by Java is shown. ▼2. Prerequisites 2-1. Installing Visual Studio Code https://code.visualstudio.com/docs/setup/linux 2-2. Installing Maven Apache Kafka Word Count … Continue reading “Java – Calculate the compound interest No.88”

Java – Generating the sample data on SQL Server No.87

In this blog, How to generate the sample data on SQL Server is shown. the key point is to use sqlcmd to run queries in Java. ▼1. Generating the sample data using Java In the pas, how to generate the sample data using python was shown in this blog. Python – Creating sample data in SQL Server on Ubuntu No.62 In the past case, the file which extension is .sql was created and then run this file by sqlcmd. this blog show the way to run query without such .sql file. ▼2. Prerequisites 2-1. Installing SQL Server on Ubuntu Quickstart: Install SQL Server and create a database on Ubuntu 2-2. … Continue reading “Java – Generating the sample data on SQL Server No.87”

Java –Save records for MySQL into Azure Blob Storage No.86 

In this blog, how to save the results of select query for MySQL into Azure Blob Storage by Java. ▼1. Prerequisites 1-1. Install MySQL and create a table with some records Java – Connect to MySQL on Ubuntu and run select query No.80 # Create a table with some records mysql> CREATE DATABASE testdb; mysql> USE testdb; mysql> create table testtbl (c1 int, c2 int); mysql> insert testtbl values(1,1),(2,2),(3,3); mysql> select * from testtbl; +——+——+ | c1 | c2 | +——+——+ | 1 | 1 | | 2 | 2 | | 3 | 3 | +——+——+ 3 rows in set (0.00 sec) ▼2. Save the results of select for … Continue reading “Java –Save records for MySQL into Azure Blob Storage No.86 “

Java -Save the results of select for MySQL into a file No.85

In this blog, how to save the results of select for MySQL on Ubuntu into a file is shown. ▼1. Prerequisites 1-1. Install MySQL and create a table with some records Java – Connect to MySQL on Ubuntu and run select query No.80 # Create a table with some records mysql> CREATE DATABASE testdb; mysql> USE testdb; mysql> create table testtbl (c1 int, c2 int); mysql> insert testtbl values(1,1),(2,2),(3,3); mysql> select * from testtbl; +——+——+ | c1 | c2 | +——+——+ | 1 | 1 | | 2 | 2 | | 3 | 3 | +——+——+ 3 rows in set (0.00 sec) ▼2. Save the results of select for … Continue reading “Java -Save the results of select for MySQL into a file No.85”

PowerShell – Visual Studio Code on Ubuntu No.84

In this blog, How to run PowerShell in visual Studio code on Ubuntu is shown. ▼1. Run PowerShell in Visual Studio Code on Ubuntu We can run PowerShell on not only Windows OS but also Ubuntu 20.4 and MacOS 11 as below. PowerShell editing with Visual Studio Code ▼2. Prerequisites 2-1. Set up Ubuntu 20.04.2 LTS https://releases.ubuntu.com/20.04/ 2-2. Install Visual Studio Code https://code.visualstudio.com/docs/setup/linux 2-3. Install PowerShell Extension by the command PowerShell editing with Visual Studio Code 2-4. Install PowerShell by the command on Ubuntu 20.4 Installing PowerShell on Ubuntu ▼3. Run PowerShell in VS Code on Ubuntu 3-1. Make a directory 3-2. Create test.txt file Create text.txt by Vi command … Continue reading “PowerShell – Visual Studio Code on Ubuntu No.84”

Scala – Visual Studio Code on Ubuntu No.83

How to execute Scala application in Visual Studio Code on Ubuntu is shown in this blog. ▼1. Run Scala code in Visual Studio Code on Ubuntu Scala or PySpark application on Apache Spark cluster is generally used. how to deploy Scala application in Visual Studio Code on Ubuntu is helpful for the deployment of application on Spark cluster. ▼2. Prerequisites 2-1. Install Ubuntu 20.04.2 LTS https://releases.ubuntu.com/20.04/ 2-2. Install Visual Studio Code https://code.visualstudio.com/docs/setup/linux 2-3. Install JDK Install Java 8 openjdk x64 of zulu Set environment variables for the installed JDK Adding below at the end of ~/.bashrc (vi ~/.bashrc) export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-x64/ Checking if $JAVA_HOME is correctly updated. 2-4. Install Maven Apache … Continue reading “Scala – Visual Studio Code on Ubuntu No.83”

Java – Search YouTube using YouTube Data API on Ubuntu No.82

In this blog, how to search YouTube videos using YouTube Data API on Ubuntu is shown. Java application is executed in Visual Studio Code on Ubuntu. ▼1. How to get API Key for YouTube Data API After creating a project and enabling YouTube Data API v3 API, API key can be generated. please refer to the following documents or another blogs. ▼2. Prerequisites 2-1. Install JDK Install Java 8 openjdk x64 of zulu Set environment variables Use vi editor like “vi ~/.bashrc” and add below in ~/.bashrc export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-x64/ Check the value of $JAVA_HOME 2-2. Install Visual Studio Code https://code.visualstudio.com/docs/setup/linux 2-3. Install Maven Apache Kafka Word Count – Java No.44 “2-3. … Continue reading “Java – Search YouTube using YouTube Data API on Ubuntu No.82”

Java – Put CPU % into a local file by Cron job No.81

How to save the current CPU % on Ubuntu into a local file by Cron job with an execution of Jar is shown in this blog. ▼1. How to export the current CPU % on Ubuntu The command “top -b -n 1” is executed by Java and save only CPU % into a file. ▼2. Prerequisites This blog is based on Java – Capture CPU,Memory,Network info on Ubuntu No.79. ▼3. Java code to export the current CPU % on Ubuntu 3-1. Develop perfch2.java “perfch2.java” run the command “top -b -n 1” and save only CPU % into a file by Java. the file name of output is CPU{epochmilliseconds}.txt when file … Continue reading “Java – Put CPU % into a local file by Cron job No.81”

Java – Capture CPU,Memory,Network info on Ubuntu No.79

In this blog, how to capture CPU, Memory, Disk, Network information by Java is shown.it would be helpful if you need narrow down the issue about connection failure to Database to find a root cause. ▼1. How to know CPU, Memory, Network status on Ubuntu We can know CPU, Memory, Network, Disk usage on Ubuntu to run the following commands. ▼2. Prerequisite 2-1. Install JDK Install Java 8 openjdk x64 of zulu Set environment variables Run vi command (vi ~/.bashrc) and update ~/.bashrc file as below. export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-x64/bin/ Check $JAVA_HOME 2-2. Install Visual Studio Code https://code.visualstudio.com/docs/setup/linux 2-3. Install Maven Apache Kafka Word Count – Java No.44 “2-3. Installing Apache Maven” … Continue reading “Java – Capture CPU,Memory,Network info on Ubuntu No.79”

Java – Connect to Azure Cosmos DB (SQL API) No.11

In this blog, how to connect to Cosmos DB SQL API by Java is shown. ▼1. Connect to Azure Cosmos DB Azure Cosmos DB is NoSQL Database. it is not Relational Database. we don’t need to set schema and table beforehand. we need to set partition key for a collection of a container to distribute data into the partitions. ▼2. Prerequisites 2-1. Prepare for a trial free Azure Cosmos DB Account, not necessary for a subscription https://cosmos.azure.com/try/ 2-2. Enable Maven auto-import in IntelliJ IDEA Enable auto-import on IntelliJ IDEA No.13 2-3. Update Pom.xml Please change the latest version each libraries. (a part of pom.xml) <dependencies> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.7.30</version> </dependency> … Continue reading “Java – Connect to Azure Cosmos DB (SQL API) No.11”