Monthly Archives: July 2023

JAVA AND DATABASES

JAVA AND DATABASES In this article we will see how to use the popular DBMS (Database Management System) MySQL Server in Java. We will start with the installation of MySQL, I am working with a MacOS Ventura and the procedure I will show you applies to this Operating System. For Windows and Linux refer to the MySQL documentation. Go with your browser to https://dev.mysql.com/downloads/mysql/ and select your operating system and the right architecture (in my case macOS version of MySQL 8.0.34 ARM 64 architecture) and download the file. Now with a video I will walk you [...]

By |2023-07-25T03:34:06+00:00July 25, 2023|0 Comments

FILE MANAGEMENT IN JAVA

FILE MANAGEMENT IN JAVA To work with files Java provides several classes that allow you to: create files and directories search files and directories rename files and directories delete files and directories write within a file read the text contained in a file The main classes are found in the java.io package (io stands for InputOutput ...) and are: For management: java.io.File for writing: java.io.FileWriter java.io.BufferedWriter java.io.PrintWriter for reading: java.io.FileReader java.io.BufferedReader File: is a representation of a file or directory. This class allows you to create, delete, rename, and search a file, directory (or subdirectory) FileWriter: allows you to [...]

By |2023-07-10T20:01:30+00:00July 10, 2023|0 Comments

COLLECTIONS IN JAVA

COLLECTIONS IN JAVA Before talking about collection let's talk about lists. LISTS IN JAVA A list is a list of objects. Some examples of lists: Television programs of the day Items in an electronic shopping cart Cars passing through the toll plaza. The alumni of a university class The cities of a nation The articles of a constitution The shopping list There are two types of lists: Static lists They have a predefined length that does not change over time. Dynamic lists They have an unknown length that may change over time. To handle lists, Java provides two types [...]

By |2023-07-07T02:52:36+00:00July 7, 2023|0 Comments

THREADS IN JAVA THIRD PART

THREADS IN JAVA EXAMPLE OF COMPETITION: PRODUCER CONSUMER APPLICATION OF MULTITHREADING AND CONCURRENCY IN JAVA The producer-consumer problem (also known as the limited buffer problem) is an example of synchronization between processes. There are two processes, one producer and the other consumer, that share a fixed size buffer. The producer generates data and deposits it in the buffer. The consumer simultaneously uses the data produced by the producer, removing it from the buffer. The problem is to make sure that: the producer does not process new data when the buffer is full the consumer does not [...]

By |2023-07-01T09:58:41+00:00July 1, 2023|0 Comments

THREADS IN JAVA FOURTH PART

THREADS IN JAVA I THREAD POOL A thread pool is a software component that is responsible for managing threads, with the goal of optimizing and simplifying their use. When we write a multithreaded program each thread has the task of executing a specific task. The thread pool, allows you to manage the execution of a list of threads. A thread pool has an internal queue, which allows multiple threads to be added, queuing them together. Thread execution management is the responsibility of the thread pool. To decide which thread to execute first and how many to execute, there are [...]

By |2023-07-02T19:33:40+00:00July 2, 2023|0 Comments
Go to Top