Posts

Quotation

Life:- If you don't love your wife, your neighbour will.

Micro Service

Image
Amazon  C ircuit Breaker :  When the number of consecutive failures crosses a threshold, the circuit breaker trips, and for the duration of a timeout period all attempts to invoke the remote service will fail immediately. After the timeout expires the circuit breaker allows a limited number of test requests to pass through. If those requests succeed the circuit breaker resumes normal operation. Otherwise, if there is a failure the timeout period begins again. @EnableCircuitBreaker class UserRegistrationConfiguration { Amazon <a target="_blank" href="https://www.amazon.in/b?_encoding=UTF8&tag=bayareddy-21&linkCode=ur2&linkId=15ff6c4a39b041249058632ec17c92c8&camp=3638&creative=24630&node=1389375031">TV</a>

Java 8

 package com.java8.functional; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; public class Test { // Functional interfaces // -Predicate // -BinaryOpeator // -Function public static void main(String[] args) { // -Predicate Predicate<String> strPrd=(s)->s.equals("baya"); Predicate<String> strPrd1=(s)->s.equals("baya1"); System.out.println(strPrd.or(strPrd1).test("baya1")); List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);   Predicate<Integer> even=(i)->i%2==0;    System.out.println(list.stream().filter(even).collect(Collectors.toList())); System.out.println(list.stream().filter(even.negate()).collect(Collectors.toList()));   // -BinaryOpeator B...

temp

Image

SqLite Setup

  Step1 : Download SQLite SW with bellow URL. SQLITE Step2 

View & Materialized View

Comparison Chart BASIS FOR COMPARISON VIEW MATERIALIZED VIEW Basic A View is never stored it is only displayed. A Materialized View is stored on the disk. Define View is the virtual table formed from one or more base tables or views. Materialized view is a physical copy of the base table. Update View is updated each time the virtual table (View) is used. Materialized View has to be updated manually or using triggers. Speed Slow processing. Fast processing. Memory usage View do not require memory space. Materialized View utilizes memory space. Syntax Create View V As Create Materialized View V Build [clause] Refresh [clause] On [Trigger] As

Control statements

Image
                                      Control statements Control statements :- A control statement works as a determiner for deciding the next task of the other statements whether to execute or not. if Statement : Simple if statement is the basic of decision-making statements in Java. It decides if certain amount of code should be executed based on the condition. Syntax: if (condition) {          Statemen 1; //if condition becomes true then this will be executed } Statement 2; //this will be executed irrespective of condition becomes true or false example : class IfStatement {     public static void main(String[] args) {     int number = 10;     if (number > 0) {     System.out.println("Number is positive.");     }     System.out.println("This statement is always executed."...

Spring

Image
Spring Framework : Spring is a lightweight framework.  Spring Framework is a Java platform that provides comprehensive infrastructure support for developing Java applications.  Spring handles the infrastructure so you can focus on your application. it provides support to various frameworks such as Struts, Hibernate, Tapestry, EJB, JSF, etc.  The framework, can be defined as a structure where we find solution of the various technical problems. Spring enables you to build applications from “plain old Java objects” (POJOs) and to apply enterprise services non-invasively to POJOs.  This capability applies to the Java SE programming model and to full and partial Java EE. Modules : The Spring Framework consists of features organized into about 20 modules.  These modules are grouped into Core Container, Data Access/Integration, Web,  AOP (Aspect Oriented Programming), Instrumentation, and Test, as shown in the following diagram. ...

Java Basics

Java Basics :- --------------- Java variables Data types Variables:- Variables are containers for storing data values. In Java, there are different types of variables, for example: String - stores text, such as "Hello". String values are surrounded by double quotes int - stores integers (whole numbers), without decimals, such as 123 or -123 float - stores floating point numbers, with decimals, such as 19.99 or -19.99 char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes boolean - stores values with two states: true or false Declaring Variables :- Syntax : type variable = value; Data Types : - it specify Type of data Primitive Data Types : A primitive data type specifies the size and type of variable values, and it has no additional methods. There are eight primitive data types in Java: Data Type Size         Description byte               1 byte Stores ...

Java Daily Notes

Super :- --------- public class Car extends Vehical{ String carType; SeatBealt sb; String colour="Red"; { System.out.println("car"); } Car(){ super(100); System.out.println("zero org constructor-Car"); } Car get() { super.get(); System.out.println("sub class method"); return this; } @Override public String toString() { return "Car [carType=" + carType +" "+ super.colour+"]"; } } public class Vehical { int vehNo; int cost; String colour = "White"; String model; { System.out.println("vehical"); } Vehical() { System.out.println("zero org constructor-vehical"); } Vehical(int vehNo) { System.out.println("org constructor-vehical" + vehNo); } Vehical get() { System.out.println("super class method"); return this; } @Override public String toString() { return ...

Free conference call setup

Steps :  Step 1 : download desktop app https://www.freeconferencecall.com/downloads Step2 : Click 'Download for windows' button & install desktop app. Step 3 : open fcc app(refer in desktop), click join button Step 4 : enter your name,  mail id, meeting id as ' bayareddy20 '.

Work Space configuration

                                                           Work Space configuration Steps:- Step 1 :- download STS -  STS                 in 'Spring Tools 4 for Eclipse',  select ' Windows 64-bit ' option                double click on 'spring-tool-suite-4.jar', we'll get 'sts-4.5.1', go to this folder                double click in on SpringToolSuite4.exe Step 2 :- download and install Java8 -  Jdk8                    or download fromgoogle-drive   JDK-8   Note :- uninstall other than JDK8 versions. Step 3 :- set JAVA_HOME path ref  link Step 4 :- download maven software  link Step 5 :- MAVEN_HOME path ref...

Spring Boot + Maven + RestFul + JPA + Sqlite

1. pom.xml  :- <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.wfd</groupId> <artifactId>springDemo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>springDemo</name> <description>Demo project for Spring Boot</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.4.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncod...

JDBC with Sqlite

Image
                                              JDBC with Sqlite Step1:-  download sqlite JDBC jar with bellow URL. JDBC jar Step2:- create java application and import Jar. select application -> Right click -> Build Path -> Configure Build Path -> Libraries -> click "add external jars"-> select "slite-jdbc-3.23.1.jar" 1. 2. Step3 : write Java-Database connectivity logic import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class SqliteJdbc { public static void main(String[] args) throws ClassNotFoundException, SQLException { // load the sqlite-JDBC driver using the current class loader     Class.forName("org.sqlite.JDBC");     Connection connection = null;   ...

Simple Restful CURD operations(Student) Without DataBase

pom.xml :- <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.wfd</groupId> <artifactId>springDemo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>springDemo</name> <description>Demo project for Spring Boot</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.4.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncodin...