Posts

Java - static keyword in Java with example

Java static keyword is used to create a Class level variable in java. static variables and methods are part of the class, not the instances of the class. The static keyword in Java is used for memory management mainly. We can apply java static keyword with variables, methods, blocks, and nested classes. static is a non-access modifier in Java that is applicable for the following: blocks variables methods nested classes Interface static method(Java 8 onwards) Java static variable We can use static keyword with a class-level variable. A static variable is a class variable and doesn’t belong to the Object/instance of the class. Since static variables are shared across all the instances of Object, they do not thread-safe. Usually, static variables are used with the final keyword for common resources or constants that can be used by all the objects. public class KnowledgeFactoryStaticDemo { // static variable example private static int count; public stat

Java -Stream API Introduction with Example

Java 8 introduced the concept of stream, Stream represents a sequence of objects from a source, which supports aggregate operations.   Following are the characteristics of a Stream − It takes input from the Collections, Arrays, or I/O channels. It never stores the elements. Stream supports intermediate operations like filter, map, limit, reduce, find, match, and so on. Streams only provide the result as per the pipelined methods. Stream operations do the iterations internally over the source elements provided. Different Operations On Streams-   forEach The stream has provided a new method ‘forEach’ to iterate each element of the stream   List < Integer > obj = new ArrayList <>(); obj.add( 7 ); obj.add( 12 ); obj.add( 3 ); obj.add( 5 ); obj.forEach((o) -> System.out.println( "Item : " + o)); map The map method is used to map the items in the collection to other objects according to the Function passed as the argument. List < Str

Configuring Tomcat Connection pool and Hikari Connection pool in Spring Boot Application

Image
One key component of spring boot starter dependencies is spring-boot-starter-data-JPA. This allows us to use JPA and work with production databases by using some popular JDBC connection pooling implementations, such as HikariCP or Tomcat JDBC Connection Pool. Tomcat Connection Pooling Spring Boot will look for HikariCP on the classpath and use it by default when present. To configure a Tomcat JDBC connection pool instead of the default HikariCP, we'll exclude HikariCP from the spring-boot-starter-data-JPA dependency and add the tomcat-JDBC Maven dependency. Maven (pom.xml) <dependency> <groupId> org.springframework.boot </groupId> <artifactId> spring-boot-starter-data-jpa </artifactId> <exclusions> <exclusion> <groupId> com.zaxxer </groupId> <artifactId> HikariCP </artifactId> </exclusion> </exclusions> </dependency> <dependency> &

How to use Google Drive

Image
Google Drive is an online file storage service that gives you 15GB of cloud storage for free. You can use it to create documents and store, share folders and files with other people. Get started with Google Drive Step 1: Go to Google drive Step 2: Log in to MyDrive with your email ID Step 3:You’ll see "My Drive,"  Step 4:Create New Folder Goto MyDrive>New folder>Add name to your new folder  Step 5:Drag and Drop your files in your new folder Click on  "MyKnowledge" Folder and drop your files. Step 6:Ensure your files successfully uploaded like below Most Popular Google Products And Services are Google Search Engine ,  Google Chrom ,  Gmail ,  Android ,  YouTube ,  Google Adsense ,  Google Drive For more products and details please visit the official website of google https://about.google/products/

Python - Simple CRUD Web App with Python ,Flask and Mysql

Image
In this article, we will learn how to build Web Application using PYTHON FLASK and MYSQL that have the capabilities to create, read, update, and delete data from the MYSQL database. More Related Topics, React.js + Python + MongoDB CRUD application Python + MongoDB + Vue.js CRUD Application  Angular10 + Python + MongoDB CRUD application Python-Create a CRUD Restful Service API using FLASK and MYSQL Python-Simple CRUD Web App with Python, Flask, and Mysql Python with MongoDB Atlas - CRUD Technologies used: Python 3 Flask library pymysql library flask-sqlalchemy library Bootstrap Javascript Please go through the following steps in order to implement Python web application CRUD example using Flask and MySQL: Step 1. Create MySQL database table – 'employee' with the following structure. CREATE TABLE IF NOT EXISTS `employee` (   `id` bigint(20) NOT NULL AUTO_INCREMENT,   `uname` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,   `email` varchar(45) COLLATE ut