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. Contents ▼1. Generating the sample data using Java▼2. Prerequisites2-1. Installing SQL Server on Ubuntu2-2. Installing Microsoft JDBC Driver 8.2 for SQL Server2-3. Install Visual Studio Code2-4. Install Maven2-5. Create a query to create a database and a table▼3. Generate a sample data using java3-1. Create an Apache Maven project3-2. Remove the existed both App.java and AppTest.java3-3. Start Visual Studio Code3-4. Update pom.xml as below and save it (Ctrl+S)3-5. Connect to MySQL and execute select query3-6. Results of this code3-7, Check the generated data▼4. Reference▼1. … 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. Contents ▼1. Prerequisites1-1. Install MySQL and create a table with some records▼2. Save the results of select for MySQL on Ubuntu into Azure Blob Storage by Java2-1. Create an Apache Maven project2-2. Remove the existed both App.java and AppTest.java2-3. Start Visual Studio Code2-4. Update pom.xml as below and save it (Ctrl+S)2-5. Save the results of select for MySQL into Azure Blob Storage2-6. Run the code▼3. Reference▼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 … 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. Contents ▼1. Prerequisites1-1. Install MySQL and create a table with some records▼2. Save the results of select for MySQL on Ubuntu into a file by Java2-1. Create an Apache Maven project2-2. Remove the existed both App.java and AppTest.java2-3. Start Visual Studio Code2-4. Update pom.xml as below and save it (Ctrl+S)2-5. Save the results of select for MySQL on Ubuntu into a file2-6. Run the code▼3. Reference▼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 … Continue reading “Java -Save the results of select for MySQL into a file No.85”

Java – Connect to MySQL on Ubuntu and run select query No.80

How to connect to MySQL and run select query is shown in this blog. Contents ▼1. What is MySQL?▼2. Prerequisites2-1. Install JDK2-2. Install Visual Studio Code2-3. Install Maven2-4. Install the latest version of MySQL2-5. Download mysql java connector2-6. Install mysql java connector2-7. Create Database “testdb” and user “hiveuser”▼3. Connect to MySQL on Ubuntu and execute select query in Java3-1. Create an Apache Maven project3-2. Remove the existed both App.java and AppTest.java3-3. Start Visual Studio Code3-4. Update pom.xml as below and save it (Ctrl+S) 3-5. Connect to MySQL and execute select query3-6. Results of this code▼4. Reference▼1. What is MySQL? MySQL, the most popular Open Source SQL database management system, is … Continue reading “Java – Connect to MySQL on Ubuntu and run select query No.80”

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. Contents ▼1. Connect to Azure Cosmos DB▼2. Prerequisites2-1. Prepare for a trial free Azure Cosmos DB Account, not necessary for a subscription2-2. Enable Maven auto-import in IntelliJ IDEA2-3. Update Pom.xml▼3. Connect to Cosmos DB by Java3-1. Develop a Java code for the connection to Azure Cosmos DB3-2. Results of running this code.▼4. Preference▼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 … Continue reading “Java – Connect to Azure Cosmos DB (SQL API) No.11”

Java – Connect to SQL Server on Ubuntu No.5

In this blog, how to connect to SQL Server on Ubuntu using Java is shown. Contents ▼1. What is SQL Server on Ubuntu▼2. How to connect to SQL Server on Ubuntu2-1. Installing SQL Server on Ubuntu2-2. Installing Microsoft JDBC Driver 8.2 for SQL Server2-3. Connection String of JDBC Driver for SQL Server2-4. Output of this code▼3. Reference▼1. What is SQL Server on Ubuntu SQL Server is Relational Database (RDB) provided by Microsoft. SQL Server works on both Windows and Linux. we can use free trial version which is called as “Express Edition” within 180 days. ▼2. How to connect to SQL Server on Ubuntu 2-1. Installing SQL Server on Ubuntu … Continue reading “Java – Connect to SQL Server on Ubuntu No.5”

Java -Retrieve data on Azure Cosmos DB (SQL API) No.15

In this blog, how to retrieve data on Azure Cosmos DB is shown. Contents ▼1. Retrieve Data on Azure Cosmos DB (SQL API) ▼2. Prerequisites2-1. Free trial Cosmos DB account is available without subscription.2-2. Enabling Maven auto-import in IntelliJ IDEA on Ubuntu2-3. Creating sample data▼3. Java code to retrieve data on Cosmos DB (SQL API)3-1. Creating Java code to find item3-2. The result of executing the query▼4. Reference▼1. Retrieve Data on Azure Cosmos DB (SQL API)  Using steam() and iterableByPage() in CosmosPagedIterable<T> class of com.azure.cosmos.util library, We can retrieve data on Cosmos DB. ▼2. Prerequisites 2-1. Free trial Cosmos DB account is available without subscription. https://azure.microsoft.com/ja-jp/try/cosmosdb/ 2-2. Enabling Maven auto-import in IntelliJ IDEA on … Continue reading “Java -Retrieve data on Azure Cosmos DB (SQL API) No.15”

Java – Create Database on Azure Cosmos DB (SQL API) No.14

In this blog, how to create database on Azure Cosmos DB (SQL API) using Java is shown. Contents ▼1. Some kinds of Azure Cosmos DB▼2. Prerequisites2-1. Free trial Cosmos DB account is available without subscription.2-2. Enable Maven auto-import in IntelliJ IDEA on Ubuntu▼3. Creating Database , Container and Data on Cosmos DB (SQL API) の Database, Container by Java3-1. Java Coding3-2. A part of Results3-3. Azure Portal of Cosmos DB shows data▼4. Preference▼1. Some kinds of Azure Cosmos DB Azure Cosmos DB is NoSQL Database. there are some kinds of API below. Choose an API in Azure Cosmos DB ▼2. Prerequisites 2-1. Free trial Cosmos DB account is available without … Continue reading “Java – Create Database on Azure Cosmos DB (SQL API) No.14”

Java – Delete Data on Azure Cosmos DB (SQL API) No.18

How to delete data on Azure Cosmos DB SQL API is written in this blog. Contents ▼1. Delete data on Azure Cosmos DB (SQL API)▼2. Prerequisites2-1. Free trial Cosmos DB account is available without subscription.2-2. Enable Maven auto-import in IntelliJ IDEA on Ubuntu2-3.  Using Azure Cosmos DB Java SDK v4 4.8.02-4. Creating Database and container2-5. Creating data▼3. Delete items on Cosmos DB (SQL API)3-1. Deleting data using Java3-2. A part of output of executing the code▼4. Reference▼1. Delete data on Azure Cosmos DB (SQL API) Multiple Items in container on Azure Cosmos DB (SQL API) will be deleted using CosmosContainer.<T>deleteItem of Java. ▼2. Prerequisites 2-1. Free trial Cosmos DB account … Continue reading “Java – Delete Data on Azure Cosmos DB (SQL API) No.18”

Java – Connection String of Microsoft JDBC Driver for SQL Server No.7

I would like to share the detail of connection string of JDBC Driver for SQL Server in this blog. Contents ▼1. Connection String of Microsoft JDBC Driver for SQL Server ▼2. Example for the connection string of JDBC Driver for SQL Server▼3. Reference▼1. Connection String of Microsoft JDBC Driver for SQL Server Connection String contains login timeout, socket timeout,query timeout, query timeout, authentication way and application name etc. ▼2. Example for the connection string of JDBC Driver for SQL Server We can avoid intermittent connection issue by implementing timeout, retry and interval of retry etc. This is an example for the connection string of Microsoft JDBC Driver for SQL Server. … Continue reading “Java – Connection String of Microsoft JDBC Driver for SQL Server No.7”