How to setup Python based Django framework and MySQL Databse to execute SQL statements

Introduction Here in this tutorial I am going to show you how to setup Python based Django framework and MySQL database server to execute SQL statement in Windows environment. The MySQL server is used as a persistent system for storing data for the application. I have already discussed in my another tutorial how to setup Django, so I won’t repeat the same thing here. As a prerequisite you need to go through the django setup tutorial before going down further.

Continue

How to setup Python based Django framework in Windows

Introduction In this example I am going to show you how to configure Python based Django in Windows Operating System. The current version of Django, at the time of writing, I am using here is 3.0.8. Here I am going to show you how to install latest version of Django in Windows 64 bit Operating System. I am also going to create a sample project to test the configuration whether it works successfully or not. The development server comes as a built-in server with Django framework and it should not…

Continue

Allow only numeric values or digits in input field using React

Introduction In this example I am going to show you how to allow only numeric values or digits in input field using React JS. You may have a requirement where you only need to allow user digits or numeric values for the input field. If user inputs non-numeric values then either you show an error or you do not allow non-numeric values at all. Here I am going to show you how to show error when user type non-numeric values in the input field. In another example I am also…

Continue

Allow only numeric values or digits in input field using Angular 10

In this tutorial I am going to show you how to allow users only input numeric values or digits. If users enter non-numeric value then we will show an error message. We can also completely prevent from entering non-numeric values. In this case, we need to accept only numbers for a textbox or input field instead of validating the value in the textbox or input field. In this type of validation user will not be able to type a non-numeric values.

Continue

How to select single or multiple records using JDBC executeQuery() and executeQueryForList()

Here we will discuss how to select single or multiple records using JDBC API. To select single record from database we use executeQuery() and to select multiple records we use executeQueryForList(). You may need to use executeQuery() to fetch single record from the database for various reasons, such as: You want to see details for a particular record You want to update a particular record You want to check whether the record exists or not

Continue

Batch insert and batch update into DataBase using JDBC PreparedStatement

Introduction Here I am going to tell you how to insert and update a list of objects in batch using JDBC PreparedStatement in Java programming language. Generally when you have a list of objects or lots of data then probably it is not a good idea to insert or update individual record or object into database, because it makes lots of database calls. So to avoid such too many database calls we insert or update the records into batch and commit the transaction at the end of the batch execution.

Continue

How to add comments in excel sheet cell using Apache POI Java API

Introduction In excel file we have seen there are comments on text cells or columns. So in this tutorial we will see how to add or insert comments in excel sheet cell using Apache POI Java API. Comments can help you to remember what all are formulae or instructions you want to provide to other excel users. In this example we will create an excel file using Apache POI and Java programming language. In the excel file we will create a sheet and on particular columns on particular rows we…

Continue

Should we synchronize run() method?

Here in this tutorial we will discuss whether we should synchronize the run() method or not. Another question may arise can we synchronize run() method? In simple word, yes, we can synchronize the run() method. Do we need to synchronize the run method? When it comes to whether we need to synchronize or not, then it is not necessary to synchronize the run() method as this method gets executed by a single thread only.

Continue

Callback method example in Java

Here I am showing a simple example on what is callback method in Java. A callback is a piece of code that you can pass as an argument to be executed on some other code. Since Java doesn’t yet support function pointer, the callback methods are implemented as command objects. A callback will usually hold reference to some state to which it actually becomes useful. By making the callback implementation in your code, you gain indirection between your code and the code that is executing the callback.

Continue