Powered by Blogger.

Saturday 27 April 2024

How to Develop code logic using Stream API Workflow

2 comments :
Let's begin by defining the term stream as it applies to the stream API:
A stream operates on a data source, such as an array or a collection. A stream, itself, never provides storage on a data. It simply moves data, possibly filtering, sorting, or otherwise operating on that data is the process. as a genral rule, however a stream operation by itself does not modyfy the data source. For Example: sorting a stream does not change the order of the source. Rather, sorting a stream results in the creation of a new stream that produces the sroted result.
A Simple Stream Example : Let's work through an example that uses streams. The following program creates an ArrayList called myList that holds a collection of integers. Next, it obtains a stream that uses myList as a source.


OUTPUT:


Wednesday 27 December 2023

Multiples DATABASE Connection and Data shifting Using Spring Boots API

No comments :
Multiple DataBase Connection and Data shifting using Spring boot API configuration Example.
Step-by-step Write Java files.
1. application.properties File for Add multiple DataBase Connection. 
2. DBConfigDBNAME.JAVA Files for multiple DataBase Connection. 
3. Job Scheduler.java file for Auto shift programm. 
4. Entity Beans, Repository, Services Implementations for Binding and shifting Data.
  1. Create Spring Boot Java (Microservices)
      Create Spring Boot Java (Microservices).
  1. Project Name: DataShiftingConfigSpringBoots
  2. Group: DataShifting-a143mk
  3. Artifactid: DataShifting-a143mk
  4. Description: DataBase Connection and Data shifting using Spring boot API.
  5. Package: DataShiftinga143mk
Select the technologies and library(Maven Dependency ) to be.
  1. spring-boot-configuration-processor
  2. ojdbc8

while creating the project pom.xml file and some maven dependency, main class is automatically created when web add any dependency like.

pom.xml


1. Configure application.properties


Create DataBase Configuration java Files :
DBConfigDATABASE1.java


DBConfigDATABASE2.java


DBConfigDATABASE3.java

Create Scheduler ClassCreate Scheduler for Auto run Program and import some Packages Scheduler.java as below:

Have you seen the previous post? You all know how to learn and create Entity Bean, Repository, Service Implementation in the project. If you don't know about it then go to the previous post and learn it.

Tuesday 19 September 2023

How to PACKAGE Spring Boot application to JAR and WAR

No comments :
Maven is a popular build tool, that takes your project’s Java source code, compiles it, tests it and converts it into an executable Java program: either a .jar or a .war file.  
Package Spring Boot application to JAR OR WAR file:
The default packaging type of a Spring Boot project is jar if the attribute is not present in the pom.xml file. It’s better to check your project’s pom.xml file to make sure that the packaging type is jar or War:

If you use an IDE such as Eclipse or Spring Tool Suite, right-click on the project, then select Run As > Maven Configuration Like:
  • CLEAN
  • BUILD
  • INSTALL
  • PACKAGE.................etc.







Wednesday 5 July 2023

Simple LDAP sign-on Authentication Using Ldap-a143mkJar

1 comment :
LDAP sign-on is an authentication scheme that allows a user to log in with a single ID to any of several related, independent, software systems or web applications. In this post user will login through Outlook Mail. Ldap-a143mkJar.jar
Process of Ldap sign-On (LSO) Authentication:



Download the jar file and implement some methods / functions have been used, the names of the methods are as follows:

Call Class object LdapClient ldapClientClass=new LdapClient();
  1. A143mkLdapConnection(ldapUrl, ldapDnConn, userEmailId, password);
There are some parameters in methods, which we initialize by creating configuration object like this.

String ldapUrl= "ldap://172.0.0.0:389/"; 
String lDapDnConn="dc=domainName,dc=com"; 
String userEmailId="EmailMail@mailDomen.com"; 
String password="mailPassword"; 

How to create a project/main class/other class to follow us.




while creating the controller/main class Ldapconn.java.


Output :


Wednesday 17 May 2023

Learn I- Report configuration with Spring boot/Microservices using Java

1 comment :
iReport
iReport is a powerful graphical design tool for report designers and power users to define reports for execution using the JasperReports engine. Whether you are using the JasperReports library by itself as a critical component of your application or you are using it as a component of the JasperReports Server application, iReport can help you design reports to meet the most complex reporting demands. iReport is built on the NetBeans platform and is available as a standalone application or as a Netbeans plug-in.
Requirements For current Download JasperReports iReport Tools , Ckeck It is recommended that you run iReport with JDK v1.5,v1.6 or v1.7. Note that for Windows Vista users, it is recommended that you run JDK v1.7.
JasperReports Create very sophisticated layouts containing charts, images, subreports, crosstabs and much more. Access your data through JDBC, TableModels, JavaBeans, XML, Hibernate, CSV, and custom sources. Then publish your reports as PDF, RTF, XML, XLS, CSV, HTML, XHTML, text, DOCX, or OpenOffice. Through this post, we will tell you how to configure iReport in Mavan base java application(Microservices) project. follows step by step:

  1. Create Spring Boot Java (Microservices)
  2. Create/Design report.jrxml
Create Spring Boot Java (Microservices).
  1. Project Name: I-ReportConfigurationApp
  2. Group:I-Report-a143mk
  3. Artifactid:I-Report-a143mk
  4. Description:Learn I- Report configuration with Microservices Application
  5. Package:I-Report-a143mk




Select the technologies and library(Maven Dependency ) to be.
  1. Spring Web
  2. Spring JPA
  3. Jasperreports
  4. javax.persistence
  5. Tomcat
  6. javax.servlet
  7. mysql
  8. jstl

while creating the project pom.xml file and some maven dependency, main class is automatically created when web add any dependency like.

pom.xml


For step by step development working watch the video and learn yourself. Download wampServer2.0i and install then run it.



1. Create Database: Database Name is hostel.
2. Create Table: Table Name is product.




Configure application.properties


Report:
In src/main/resources/reports/report.jrxml folder, create new folder named reports. In this folder, create new Jasper Report named report.jrxml as below:
 


Code:



Entities Class
Create new package, named IReporta143mk.entities. In this package, create entities class name is Product.java as below:



Create ProductRepository Interface
Create new package named IReporta143mk.repositories. In this package create the ProductRepository interface implements from CrudRepository interface of Spring Data JPA that provides CRUD Operations for an entity.


Create ProductService Interface
Create new package named IReporta143mk.services. In this package create the ProductService interface and ProductServiceImpl as below:
First one is ProductService.java


Second one is ProductServiceImpl.java



Create Controllers
Create new package named IReporta143mk.controllers. In this package, create new java class named ProductController.java


Create jsp page
Create new folder name is jsp. In thes folder /src/main/webapp/WEB-INF/jsp/index.jsp

Structure of Spring Boot Project:


Out Put:




Wednesday 15 February 2023

Digital Steganography With Single Sign-On (SSO) Authentication Project For Students

2 comments :
The project here can be a minor and major project for final year students, and given in school and college by learning the project itself through videos.
INTRODUCTION:
Maintaining secrecy is very important in a large corporation and because of the intelligent of the hackers it becomes tedious. Already we have encryption for transmitting secret information. Even though encryption successfully transmitting secret information, it will give a suspicion to the hackers and it affects unintended users. Our project, DIGITAL STEGANOGRAPHY WITH Single Sign-On (SSO) Authentication overcomes this factor and it gives a solution for transmitting secret formation with out affecting 
 Unintended users. Steganography uses multimedia data as a covering medium (Covering secret information). By using steganography data (secret information) can hided with in 
Data (multimedia data, here multimedia data is an image) and it can be sent anywhere to transfer the message easily without giving any suspicion to others.



Follow Steps by Steps 


Tuesday 3 January 2023

Single Sign-On (SSO) Using SMTP Authentication With Spring Boot Microservices

2 comments :
Single sign-on is an authentication scheme that allows a user to log in with a single ID to any of several related, independent, software systems or web applications. In this Video user will login through Outlook and Google Mail for which we will develop Spring Boot Microservices Project here and will also use some Spring Boot Jar files javax.mail.jar and SendMailA143mkSSO.jar
Process of Single sign-On (SSO) Authentication:




Download both the jar file and implement some methods / functions have been used, the names of the methods are as follows:

Create Class object SendMailA143mk getsess=new SendMailA143mk();
  1. LoginMailAuthHost_PortA143mk();
  2. OutLookMailAuthA143mk();
  3. GmailMailAuthA143mk();
There are some parameters in five methods, which we initialize by creating and object like this.

String toAuthmail="EmailMail@mailDomen.com";
String toAuthmailPassword="mailPassword"; 
String host="smtp.office365.com"; 
String port="587"; 

How to create a project to follow us. Project Name is: EmailAuthenticationA143mk




while creating the project pom.xml file and some maven dependency, main class is automatically created when web add any dependency like.

pom.xml


For step by step development working watch the video and learn yourself.


Some Helping Note: Some code and video are shown in this post, how we can use it in our application, the developer and jar file used in this is verified by mail id and password and after mail id is successful is returned, you can then write custom user roles and method entities in the block. and you can write error body in second part of it.

Saturday 10 December 2022

How to Implement SMTP (Simple Mail Transfer Protocol: To, Cc and Bcc Mails) Using Java

1 comment :
In this post we will learn how To, Cc and Bcc mails are sent and also how the file is attached to the mail. Some jar files are available in java for the development of mails, which is javax.mail jar file, as well as a jar named SendMailA143mk, download both the jar file and the names of the jar SendMailA143mk in which two methods / functions have been used, the names of the methods are as follows:    
1. SendMaleWPathFile();
2. SendMaleWBody();
There are some parameters in both the methods, which we initialize by creating and object like this.

String noReplayEmailID="noreplyMail@mailDomen.com";
String noReplayEmailPass="mailPassword"; 
String host="smtp.office365.com"; 
String port="587";
String sentTomail="toMail@mailDomen.com"; 
String sentToCCmail="ccMail@mailDomen.com"; 
String sentToBCCmail="bccMail@mailDomen.com"; 
String Subject="SMTP Implementation Using Java"; 
String bodyText=" Hi A143mk blogs Test Mail. Thanks. "; 
String PathFile="D:\\logo.png"; 
Create this Main Method, you can use this code in functions/methods as per you wish.
 

Output is:

















Important Information: We develop/implement this type of web application or other user application in online platform like How to send To, Cc and Bcc mails to online user providing security and also we are able to send email to user through OTP in this development Whether or not your personal information such as password/email OTP is neither in the database of the online platform nor in the possession of anyone else. By this we identify the authenticity of the user.

Thursday 15 September 2022

Calculate Number of Days between Two Dates using java 8

No comments :
Introduction
Java 8 have a java.time package to work with the date and time API. The package includes many date and time classes.  For example: Calculate Number of Days between Two Dates.
  •   Create  Function getDays(startDate, presentDate).
String startDate="2022-06-10"; 
String presentDate="2022-09-16";
int calculateDays=getDays(startDate, presentDate);
  •  implement the getDays() Function.

Output is 98 days.