Python -Error handling & Retry in SQL Server on Ubuntu No.93

How to implement the error handling and retry with some interval in SQL Server on Ubuntu by Python is shown in this blog. ▼1. Why do we need an error handling and an retry logic? We often use a cloud service and a remote service through the network. if the network intermittently cause something problems, the client application cannot access these services and will stop. to avoid this case, we need to add an error handling and an retry logic in an client application. ▼2. Prerequisites An error handling and a retry logic will be added into the code that was shown in the following blog. Python – How to … Continue reading “Python -Error handling & Retry in SQL Server on Ubuntu No.93”

Java -AutoRetry connection by JDBC Driver for SQLServer No53

How to implement auto retry with some internal by Java is shown in this blog. the connection string using Microsoft JDBC Driver for SQL Server “Connection String” has a feature of auto retry with some internal. ▼1. Auto retry with some interval feature of Connection String of Microsoft JDBC Driver for SQL Server (Version 9.4 以上) As the mandatory setting for a cloud service, the following retry with some interval in a connection string can be used after “Microsoft JDBC Driver 9.4 for SQL Server”. ▼2. Writing Java code to implement auto-retry when failing to connect to SQL Server 2.1. Creating a Java code for auto-retry connection This code uses … Continue reading “Java -AutoRetry connection by JDBC Driver for SQLServer No53”

Python -Create, write and read file -VS Code on Ubuntu No.35

How to create, write and read a file using Python in Visual Studio Code on Ubuntu is shown in this blog. ▼1. Creating, write and read a file using Python open() function is used to create a file or edit a file. there are 2 elementary parameters of open() Python function for specifying a file name and the mode of a file operation. There are some modes as below. Mode Description ‘r’ open for reading (default) ‘w’ open for writing, truncating the file first ‘x’ open for exclusive creation, failing if the file already exists ‘a’ open for writing, appending to the end of file if it exists ‘b’ binary mode ‘t’ text … Continue reading “Python -Create, write and read file -VS Code on Ubuntu No.35”

Python – Using Visual Studio Code on Ubuntu No.34

How to run python code in Visual Studio Code on Ubuntu is shown in this blog. ▼1. Let’s write python code in Visual Studio Code In Visual Studio Code, there are many available programming languages. e.g) Java, C, C++, Python etc on Windows OS, Mac OS and Linux. in this case, I will try to use python. Python doesn’t require compile and it’s an interpreted language. Ref: Get Started Tutorial for Python in Visual Studio Code ▼2. Prerequisites 2-1. Using Ubuntu 20.04.2 LTS Ref: https://releases.ubuntu.com/20.04/ 2-2. Installing Visual Studio Code Ref: https://code.visualstudio.com/docs/setup/linux 2-3. Installing Python extension Ref: Get Started Tutorial for Python in Visual Studio Code Confirming the installed python … Continue reading “Python – Using Visual Studio Code on Ubuntu No.34”

Python – Creating sample data in SQL Server on Ubuntu No.62

How to create sample data in SQL Server on Ubuntu is shown in this blog. These steps are available for Windows OS, too. ▼1. What is Microsoft SQL Server ? There are many kinds of SQL Server. for example, Azure SQL Database in cloud, Azure Synapse Analytics – SQL pool (SQL Data Warehouse) and on-premise SQL Server on Azure Virtual Machine (VM) etc We can find the version of SQL Server and hot fixes in this site Microsoft SQL Server Versions List . as Free trial version, SQL Server Express edition on Windows and Linux are available. On windows OS, we can download Express edition by clicking “Download Now”. SQL2022-SSEI-Expr.exe … Continue reading “Python – Creating sample data in SQL Server on Ubuntu No.62”

Java – Put SQL Server select results into a csv file No.70

How to put results of select in SQL Server on Ubuntu into a csv file by Java is shown in this blog. ▼1. Prerequisites There are needed for executing a select query in SQL Server on Ubuntu. 1-1. Installing SQL Server Quickstart: Install SQL Server and create a database on Ubuntu 1-2. Installing Visual Studio Code https://code.visualstudio.com/docs/setup/linux 1-3. Installing Maven Apache Kafka Word Count – Java No.44 “2-3. Installing Apache Maven”Maven – Download Apache Maven 1-4. Generating sample data in SQL Server Python – Creating sample data in SQL Server on Ubuntu No.62 1-5. Executing a select query in SQL Server using Java Java SQL Server on Linux で select … Continue reading “Java – Put SQL Server select results into a csv file No.70”

Python – How to connect to SQL Server on Ubuntu  No.92

How to connect and run select query for a table in SQL Server on Ubuntu using Microsoft ODBC Driver for SQL Server by Python are shown in this blog. ▼1. Connecting to SQL Server on Ubuntu In the past, how to connect and run queries using Java are shown in this blog as below. (As of 2022/12) ▼2. Connecting to SQL Server and Select using Python 2-1. Installing SQL Server on Linux SQL Server 2022 is GA (General Avaiable) on Dec 2022.Quickstart: Install SQL Server and create a database on Ubuntu 2-2. Installing Microsoft ODBC Driver for SQL Server 2-3. Creating a python code to connect to SQL Server on … Continue reading “Python – How to connect to SQL Server on Ubuntu  No.92”

Java – Update Statistics in SQL Server on Ubuntu No.91

How to update statistics for the table in SQL Server on Ubuntu by Java is shown in this blog. ▼1. The latency of a query execution in SQL Server We often see the latency of a query execution in SQL Server. in this case, Statistics for the table might be old. If the statistics of a table is old, the appropriate query execution plan cannot be generated when running a query. such inefficient query execution plan causes long duration time for the query. The resolution of it is to update statistics for a table. the query “update statistics” and “sp_recompile” to generate a ne query execution plan are implemented by … Continue reading “Java – Update Statistics in SQL Server on Ubuntu No.91”

Python – WordCloud in Japanese – VS Code on Ubuntu No.90

How to implement Word Cloud in Japanese using python in Visual Studio Code on Ubuntu is shown in this blog. ▼1. What is WordCloud? WordCloud is a visualization tool to show the valuable word using the size of a word based on the frequency. The wiki of 2022 FIFA Qatar world cup is used for the wordcloud in Japanese. 2022 FIFAワールドカップ ▼2. Prerequisites 2-1. Preparing for Python environment Python – Visual Studio Code の利用 No.34 2-2. Installing WordCloud https://pypi.org/project/wordcloud/ 2-3. Downloading Japanese Font IPAex フォント Ver.004.01 | 一般社団法人 文字情報技術促進協議会 (moji.or.jp) 2-4. Copying Japanese text from Wiki Textjpnv2.txt file is created by copying text from this Wiki. 2022 FIFAワールドカップ Wikipedia 2-5. … Continue reading “Python – WordCloud in Japanese – VS Code on Ubuntu No.90”

Java – Creating sample data for SQL Server on Ubuntu No.89

In this blog, how to create sample records for SQL Server on Ubuntu using Java is shown. ▼1. Creating sample data using Java In the past blog, these blogs are shared. they use .sql file to create data by sqlcmd. In this blog, there is the simple way to use Java without sqlcmd to create sample data. ▼2. Prerequisites 2-1. Checking Java – Generating the sample data on SQL Server No.87 to execute below. ▼3. Creating sample data for SQL Server by Java 3-1. Create an Apache Maven project 3-2. Remove the existed both App.java and AppTest.java 3-3. Start Visual Studio Code 3-4. Update pom.xml as below to run query … Continue reading “Java – Creating sample data for SQL Server on Ubuntu No.89”