0% found this document useful (0 votes)
11 views45 pages

Int413 Final

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views45 pages

Int413 Final

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 45

FULL STACK JAVA

INTERNSHIP report submitted in partial fulfillment of the requirement for


the award of the Degree of Bachelor of Technology in

ELECTRONICS AND COMMUNICATION ENGINEERING

By
Dadi Sampath Kumar
(21NT1A0413)

Under the Esteemed Guidance of


Dr. Kausar Jahan
Associate Professor

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

VISAKHA INSTITUTE OF ENGINEERING AND


TECHNOLOGY

57th DIVISION, NARAVA, VISAKHAPATNAM - 530 027

Academic Year 2023-24


INTERNSHIP 6 WEEKS REPORT
2024

INTERNSHIP PERIOD DURING


2024
CERTIFICATE OF INTERNSHIP

This is to certify that the INTERNSHIP report entitled “Full Stack Java”
is being submitted by DADI SAMPATH KUMAR (21NT1A0413) in partial
fulfillment for the award of the Degree of Bachelor of Technology in
Electronics and Communication Engineering to the Jawaharlal Nehru
Technological University, Gurajada Vizianagaram is a record of
bonafied work carried out under my guidance and supervision.

The results embodied in this INTERNSHIP report have not been


submitted to any other University or Institute for the award of any
Degree or Diploma.

Dr. KAUSAR JAHAN Dr. B. JEEVAN


RAO

Internship Guide Head of the


Department

EXTERNAL SIGNATURE
CERTIFICATE FROM SKILLDZIRE ORGANIZATION
DECLARATION

We hereby declare that work entitled “Full Stack Java” is submitted


towards completion of summer internship program after 3 rd year of
B.Tech (ECE) at SkillDzire comprises of our original work pursue
under the guidance of Department of ECE. This work has not been
submitted to any other university or institute for the award of any
degree or diploma.

Place: Narava Dadi Sampath Kumar


Date: 12-11-2024 (21NT1A0413)

i
ACKNOWLEDGMENT

This work could not have been fruitful without the continuous
guidance and support from numerous people.

A project is a golden opportunity for learning and self- development. I


consider myself very lucky and Honor to have so many wonderful people,
lead me through, in completing of this project.
I wish to thank my Guide Dr. Kausar Jahan, Associate Professor,
ECE who constantly encouraged me throughout the completion of my
internship work.

I would like to exhibit my thanks to Dr. B. Jeevana Rao, Head of


the Department, VIET for his consistent support throughout my work. I
would like to extend my thanks to Dr. D. Santha Rao, Dean Academics,
VIET and Dr. G. V. Pradeep Varma, Principal, VIET for their mind provoking
analysis on my work.

My deep gratitude goes to Sri G. Satyanarayana Garu, Chairman,


VIET for providing facilities on the campus and encouraging us for
internship.

I thank the Almighty for giving me the strength and patience to work
through all these years.

ii
ABSTRACT

Java Full Stack Development internships provide comprehensive training


both front-end and back-end development technologies, offering aspiring
developers hands-on experience in building complete web applications.
Through this program, interns gain practical knowledge of the entire web
development stack, from user interfaces to server-side logic and database
management.

The internship focuses on core Java programming fundamentals, advanced


Java concepts, web technologies, and modern frameworks. Interns learn to
develop robust, scalable applications using Spring Boot for backend
services, React for frontend interfaces, and various databases for data
persistence. The program emphasizes industry best practices, including
version control with Git, agile development methodologies, and
continuous integration/continuous deployment (CI/CD) practices.

Beyond technical skills, the internship nurtures essential soft skills through
collaborative projects and real-world problem-solving scenarios. Interns
develop communication abilities, project management capabilities, and
learn to work effectively in team environments. The program provides
valuable mentorship from experienced developers who share insights into
professional development practices and career growth opportunities in full
stack development.

iii
TABLE OF CONTENTS:

CHAPTER-1: Introduction to java ………………….. (1-


5)
1.01-Java basics
1.02-Data types
1.03-Java operators
1.04-Loops and control statements
1.05-Oops principle
1.06-String concept
1.07-Multithreading
CHAPTER-2:HTML…………………………………….. (6-9)
2.01-Html document structure
2.02-Basic Html tags
2.03-Forms in Html
2.04-Html attributes
2.05-Html semantic elements
CHAPTER-3:CSS……………………………………….. (10-13)
3.01-Basic syntax and structure
3.02-CSS Selectors
3.03-CSS Properties
3.04-CSS Box model
3.05-Responsive Design
3.06-CSS inheritance and specificity
3.07-CSS Pseudo class and pseudo elements
3.08-CSS Best practices
CHAPTER-4:SQL……………………………………… (14-18)
4.01-Key concepts of SQL
4.02-SQL Statements
4.03-SQL Clauses
4.04-Types of SQL Joins

iv
4.05-SQL Functions
4.06-SQL Constraints
4.07-SQL Indexes

CHAPTER-5: JDBC …………………………………. (19-22)


5.01-Key concepts of JDBC
5.02-JDBC Advantages
5.03-JDBC Use cases

CHAPTER-6: API…………………………………………… (23-26)


6.01-Key concepts of API
6.02-Types of API
6.03-Components of an API
6.04-Use cases of API
CHAPTER-7: PROJECT……………………………. (27-30)
(Simple bank management system)
CHAPTER-8: OUTCOMES DESCRIPTION…….… (31-32)
CHAPTER-9: CONCLUSION……………………………… (33)

v
CHAPTER – 1

Introduction to Java
 Definition: Java is a high-level, class-based, object-oriented
programming language designed to have as few implementation
dependencies as possible.
 Platform Independence: Java compiles to bytecode that runs on
the Java Virtual Machine (JVM), making it platform-independent.
 Popular Uses: Java is used for web applications, mobile
applications (especially Android), and enterprise-level applications
due to its stability, scalability, and security features

1.01 Java Basics


 Structure of a Java Program: All Java code is written within
classes, and the main method is the entry point.
 Basic Syntax: Java syntax includes defining classes and methods,
using data types, and following a strict structure.
 Compilation Process: Source code (.java) is compiled to bytecode
(.class) which the JVM interprets

1.02 Data Types

1. Primitive Data Types


Primitive data types are the most basic types in Java, directly
representing simple values in memory. There are eight primitive
data types:
 int: Represents integer values, e.g., int x = 10;. It occupies 4 bytes
and can store values from -2^31 to 2^31-1.
 float: Represents single-precision 32-bit floating-point numbers,
e.g., float y = 5.5f. It is often used for fractional values and requires
an f suffix.
 double: Represents double-precision 64-bit floating-point numbers,
e.g., double z = 15.99;. It is more precise than float and is the
default type for decimal values.

1
 char: Represents a single 16-bit Unicode character, e.g., char a =
'A';.
 Boolean: Represents true or false values, e.g., Boolean is True =
true;. This data type is used in conditional statements.
 byte: Represents an 8-bit integer, e.g., byte small Num = 100;. It is
useful for saving memory in large arrays and can store values from -
128 to 127.
 short: Represents a 16-bit integer, e.g., short small Int = 1000; It
takes 2 bytes and has a range from -32,768 to 32,767.
 long: Represents a 64-bit integer, e.g., long largeNum = 100000L;.
It can store much larger values and typically requires an L suffix.
2. Non-Primitive (Reference) Data Types
Non-primitive data types, also known as reference types, refer to
objects and are created by the programmer. These include:
 Strings: A sequence of characters, defined by the String class, e.g.,
String name = "Java";.
 Arrays: A collection of variables of the same type, e.g., int[]
numbers = {1, 2, 3};.
 Classes and Objects: Represent custom types defined by the user,
e.g., class MyClass {} and MyClass obj = new MyClass();.

1.03 Java Operators


 Arithmetic Operators: +, -, *, /, %
 Relational Operators: ==,!=, >, <, >=, <=
 Logical Operators: &&, ||, !
 Assignment Operators: =, +=, -=, etc.
 Unary Operators: ++, --
 Bitwise Operators: &, |, ^, ~, <<, >>P a g e | ii

1.04 Loops and Control Statements


Control Statements
Control statements direct the execution flow based on specific
conditions. They include:

2
 if, else if, and else: Used for conditional execution. An if statement
evaluates a condition and, if true, executes a specific block of code.
If false, the program may execute code in an else or else if block.
 switch: A switch statement selects one of multiple possible code
blocks to execute, based on the value of a variable. This is
particularly useful when a variable needs to be compared against
multiple constant values.
 break and continue: These are loop control statements. break is
used to exit a loop or switch block immediately, while continue skips
the current iteration and proceeds to the next iteration of the loop.
Loops
Loops are used to repeat a block of code as long as a condition is
met. There are several types of loops in Java:
 for loop: Executes a code block a specific number of times. It is
generally used when the number of iterations is known beforehand.
 while loop: Repeats a block of code while a specified condition is
true. This loop is useful when the number of iterations isn’t known in
advance.
 do-while loop: Similar to a while loop, but it guarantees the code
block executes at least once because the condition is checked after
the loop executes.

1.05 Object-Oriented Principles

The four core principles of OOP in Java are Encapsulation,


Inheritance, Polymorphism, and Abstraction.
1. Encapsulation
Encapsulation is the practice of wrapping data (variables) and methods
(functions) into a single unit called a class. By making fields private
and providing public getter and setter methods, encapsulation
protects data from unauthorized access and modification. This leads
to greater security, modularity, and code maintainability.

3
2. Inheritance
Inheritance allows a new class (subclass) to inherit attributes and
methods from an existing class (superclass). This establishes an "is-
a" relationship and promotes code reusability and hierarchy. The
subclass can extend or override the methods of the superclass,
allowing specialized functionality while minimizing redundant code.
3. Polymorphism
Polymorphism enables one entity (such as a method or an object) to
take on multiple forms. It has two types in Java:
 Compile-time Polymorphism (Method Overloading): Allows a
class to have multiple methods with the same name but different
parameters.
 Run-time Polymorphism (Method Overriding): Allows a
subclass to provide a specific implementation for a method defined
in its superclass.
Polymorphism enhances flexibility and simplifies code maintenance by
allowing a single interface to represent different data types or
classes.
4. Abstraction
Abstraction is the concept of hiding implementation details and
exposing only essential features. It is achieved in Java using
abstract classes and interfaces. Abstract classes define
incomplete or abstract methods that must be implemented by
subclasses. Interfaces, on the other hand, provide a contract that
implementing classes must fulfill, encouraging loose coupling and
modular code.

1.06 Strings, String Buffer, and StringBuilder


 String: Immutable sequence of characters, manipulated using
various methods (e.g.,. char At(), .substring(), .to Lowercase()).
 String Buffer: A mutable sequence of characters, thread-safe, used
when you need to modify strings frequently.

4
 StringBuilder: Similar to String Buffer, but not thread-safe, offering
better performance in single-threaded scenarios.

1.07 Multithreading
Thread: A thread is the smallest unit of a process. In Java, threads can be
created by extending the Thread class or implementing the Runnable
interface. Each thread runs a specific block of code independently.
Main Thread: When a Java application starts, a single thread (the main
thread) begins execution. This main thread can then spawn additional
threads to perform concurrent tasks.
Creating Threads: In Java, a thread can be created by either:
 Extending the Thread class and overriding its run() method.
 Implementing the Runnable interface and passing it to a Thread
object.
Thread Lifecycle: A thread goes through several states:
 New: Created but not started.
 Runnable: Ready to run but waiting for CPU availability.
 Blocked/Waiting: Waiting for resources or conditions.
 Running: Actively executing.
 Terminated: Completed execution.
Synchronization: In multithreaded programs, multiple threads may try to
access shared resources simultaneously, leading to data inconsistency.
Java provides synchronization techniques to manage resource access,
including the synchronized keyword, which ensures only one thread
accesses a critical section at a time.
Inter-thread Communication: Threads often need to communicate,
especially when they work on shared data. Java provides methods like
wait(), notify(), and notifyAll() to allow threads to communicate and
coordinate their operations.Thread Priorities: Each thread in Java has a
priority that helps determine the order in which threads are scheduled for
execution. Higher priority threads are given preference over lower-priority
ones, but this scheduling is also affected by the operating system.

5
6
CHAPTER-2

HTML (Hypertext Markup Language)


HTML, Hypertext Markup Language, is the standard language for
creating and structuring web pages. It provides the basic framework to
format text, insert images, create links, and add forms, among other
web content. HTML documents are saved with the .html or .html file
extensions and are typically structured in a hierarchical, tag-based
format.

2.01 HTML Document Structure


Every HTML document begins with the <!DOCTYPE html> declaration,
signaling to browsers that it’s an HTML5 document. The structure
generally follows this pattern:
 <!DOCTYPE html>: Declares the document as HTML5.
 <html>: The root element that encapsulates all HTML content.
 <head>: Contains metadata, including the page title, character set,
and links to external CSS or JavaScript files.
 <title>: Defines the title shown on the browser tab.
 <body>: Contains all the visible content of the webpage.

2.02 Basic HTML Tags


1. Headings
o HTML has six levels of headings, from <h1> to <h6>, with
<h1> being the largest.
2. Paragraphs and Text Formatting
o <p>: Defines a paragraph.
o Bold (<b>) and italic (<i>): For styling text.
3. Links
o <a href="URL">: Creates a hyperlink.
4. Images
o <img src="URL" alt="Description">: Embeds an image with
src for the source URL and alt for the image description.

7
5. Lists
o Unordered List (<ul>): Creates a bulleted list.
o Ordered List (<ol>): Creates a numbered list.
o List Items (<li>): Used within <ul> or <ol> for each list
entry.
6. Tables
o Used for tabular data, with <table>, <tr>, <th>, and <td>
tags.

2.03 Forms in HTML


HTML forms allow users to input data and send it to a server for
processing. Form elements include text fields, radio buttons,
checkboxes, submit buttons, and more.
 <form action="" method="">: The action attribute defines where
the form data is sent, and method specifies the HTTP method (GET
or POST).
 Input Types:
o <input type="text"> for single-line text input.
o <input type="email"> for email validation.
o <input type="submit"> for submitting the form.

2.04 HTML Attributes


id: Specifies a unique identifier for an HTML element, used to style or
manipulate elements individually via CSS and JavaScript.
 Example: <div id="header"></div>
class: Assigns a class name to an element, which can be shared by
multiple elements for styling or manipulation in CSS and JavaScript.
 Example: <p class="text"></p>
style: Allows inline styling by specifying CSS properties directly within
the element.
 Example: <h1 style="color: blue;"></h1>
title: Provides additional information about an element, often
displayed as a tooltip when hovered over.

8
 Example: <a href="https://example.com" title="Visit

href: Used in anchor (<a>) tags to specify the URL of the linked page.
 Example: <a href="https://example.com">Click Here</a>
src: Used in <img>, <iframe>, and <script> tags to specify the source
URL of an external file, such as an image or script.
 Example: <img src="image.jpg" alt="Image">
alt: Provides alternative text for images in <img> tags, useful for
accessibility and displayed if the image fails to load.
 Example: <img src="logo.png" alt="Company Logo">
width and height: Specify the dimensions of an image or video.
 Example: <img src="image.jpg" width="200" height="100">
type: Defines the type of an input or button element and specifies the
type of a linked resource in tags like <script> and <link>.
 Example: <input type="text">
value: Sets the initial value of input fields and other elements like
<input> and <option>.
 Example: <input type="text" value="Enter text">
placeholder: Provides placeholder text within an <input> element,
giving hints to the user.
 Example: <input type="text" placeholder="Your Name">
disabled: Disables an input, button, or other form control, preventing
user interaction.
 Example: <button disabled>Submit</button>
readonly: Makes an input field non-editable while still allowing users
to view the content.
 Example: <input type="text" value="Read Only" readonly>
required: Indicates that a form field is required before submission.
 Example: <input type="text" required>

9
2.05 HTML5 Semantic Elements
header: Represents the introductory content or a set of navigation
links for a page or section. Typically contains the site logo, title,
navigation, or other introductory elements.
nav: Defines a section intended for navigation links. This element is
specifically for grouping links to other pages or sections within a
site.
section: Represents a thematic grouping of content, usually with a
heading. It divides content into sections that can be conceptually
grouped together.
article: Indicates independent, self-contained content that could be
distributed or repurposed independently, such as a blog post, news
article, or forum post.
aside: Contains content related to the main content but is tangential
or supportive, such as sidebars, quotes, or advertisements. It’s often
used for supplementary information.
footer: Represents the footer of a section or page. Typically includes
information such as copyrights, contact information, site maps, or
related links.
main: Defines the main content of a document, typically the central
content specific to the page. This should be unique to the page and
only one <main> element should be used per page.
figure and figcaption: Used to group media content, like images,
illustrations, or tables, with an optional caption. figcaption provides
a caption or description for the figure content.
details and summary: Provide a way to hide or show additional
content interactively. details creates a collapsible section, and
summary is the label that appears when the content is collapsed.
mark: Highlights or marks text that is particularly relevant or
important, often used to emphasize search results or keywords

10
CHAPTER-3

CSS (Cascading Style Sheets)

CSS, or Cascading Style Sheets, is a styling language used to describe


the look and layout of a web page. It allows web developers to control
the design, appearance, and responsiveness of HTML documents. CSS
separates content (HTML) from design (CSS), making websites easier to
maintain and customize.

3.01 Basic Syntax and Structure


CSS consists of selectors and declaration blocks. Each rule set includes:
 Selectors: Specify which HTML elements the styles will apply to.
 Declarations: Consist of properties and values that define the
appearance.

3.02 CSS Selectors


CSS selectors define which elements in the HTML the styles will apply
to. Some common selectors include:
1. Type Selector: Targets elements by their tag name.
2. Class Selector: Targets elements by class attribute, denoted by a
dot (.).
3. ID Selector: Targets a specific element by its unique id attribute,
denoted by a hash (#).
4. Universal Selector: Targets all elements, denoted by an asterisk
(*).
5. Attribute Selector: Targets elements based on specific attributes.

3.03 CSS Properties


CSS properties define the actual styling to be applied. Here are some
essential properties:
1. Colour and Background
o color: Sets the text color.

11
o background-colour: Sets the background color of an element.
o background-image: Adds an image as the background.
2. Text and Font
o font-family: Specifies the font style.
o font-size: Controls the size of text.
o font-weight: Defines the thickness of text.
o text-align: Aligns text within an element.
3. Box Model
o width and height: Set the dimensions of an element.
o padding: Space inside the element, between the content and
the border.
o border: Defines the border of an element.
o margin: Space outside the element, between the element and
surrounding elements.
4. Positioning
o position: Controls the positioning of an element.
o top, bottom, left, right: Set the position relative to the
containing element.

5. Display and Visibility


o display: Controls the display behavior of an element.
o visibility: Controls the visibility of an element without affecting
layout.
6. Flexbox and Grid
o Flexbox (display: flex): A layout model for arranging items in
a row or column.
o CSS Grid (display: grid): A grid-based layout for complex, two-
dimensional designs.

3.04 CSS Box Model


The CSS box model describes how elements are structured and spaced.
Each element is a box with four main components:
 Content: The actual content of the element (e.g., text, images).

12
 Padding: Space between the content and the border.
 Border: The outline surrounding the padding and content.
 Margin: Space outside the border that separates elements from
one another.

3.05 Responsive Design


CSS enables responsive design, making websites adaptable to various
screen sizes and devices. Key techniques include:
1. Media Queries
o Media queries apply different styles based on device
characteristics (e.g., screen width).
2. Flexible Units
o Relative Units (e.g., %, em, rem): Scale based on parent or
root element.
o Viewport Units (e.g., vw, vh): Scale relative to the viewport
size.
3. Flexible Layouts
o Flexbox and CSS Grid provide dynamic, adaptable layouts for
creating responsive interfaces.

3.06 CSS Inheritance and Specificity


CSS follows an inheritance and specificity model:
 Inheritance: Certain properties (like color and font-family) are
inherited by default, while others (e.g., margin, padding) are not.
 Specificity: The specificity of a selector determines which styles
will be applied if multiple rules conflict. The hierarchy from lowest to
highest specificity is:
o Type selectors
o Class selectors
o ID selectors
o Inline styles

13
3.07 CSS Pseudo-Classes and Pseudo-Elements
CSS includes pseudo-classes and pseudo-elements to target elements
in specific states or parts.
 Pseudo-Classes: Apply styles to elements based on a state or
position, such as: hover, :first-child, and :nth-child.
 Pseudo-Elements: Target specific parts of elements, like:: before
and ::after to insert content before or after an element’s content.

3.08 CSS Best Practices


1. Organize Styles with Comments: Add comments to sections of
CSS code for better readability and organization.
2. Use Consistent Units: Choose a unit system (e.g., px for precise
control, rem for scalable design) and stick with it.
3. Minimize Specificity: Avoid overly specific selectors to keep CSS
maintainable.

14
CHAPTER-4

SQL (Structured Query Language) is a domain-specific


language used for managing and manipulating relational databases.
It is used for querying, updating, inserting, and deleting data in
databases, as well as for managing database structures.

4.01 Key Concepts of SQL


1. Database: A database is a collection of organized data stored and
accessed electronically. It is structured in tables, rows, and columns.
2. Table: A table is a collection of related data entries in the form of
rows and columns. Each table in a database is designed to store
information about a specific topic (e.g., employees, products).
3. Row: A row in a table represents a single record or data entry.
4. Column: A column in a table represents an attribute or field. Each
column holds a specific type of data (e.g., names, dates, numbers).

4.02 SQL Statements


SQL statements are used to interact with a database. These statements
fall into several categories:
1. Data Query Language (DQL):
o SELECT: Retrieves data from one or more tables in a
database.
 The SELECT statement is the most commonly used SQL
statement to query databases.
2. Data Definition Language (DDL): DDL statements are used to
define and manage the structure of database objects such as tables,
views, and schemas.
o CREATE: Creates a new database object (e.g., table, index,
view).
o ALTER: Modifies the structure of an existing database object.
o DROP: Deletes a database object.

15
o TRUNCATE: Removes all rows from a table but retains the
table structure.
3. Data Manipulation Language (DML): DML statements are used
to manipulate data within database tables.
o INSERT: Adds new records into a table.
o UPDATE: Modifies existing records in a table.
o DELETE: Removes records from a table.
4. Data Control Language (DCL): DCL statements are used for
controlling access to data in the database.
o GRANT: Provides specific privileges to users or roles.
o REVOKE: Removes specific privileges from users or roles.
5. Transaction Control Language (TCL): TCL statements are used
to manage the changes made by DML statements.
o COMMIT: Saves all changes made by the current transaction.
o ROLLBACK: Reverses changes made by the current
transaction.
o SAVEPOINT: Sets a point in a transaction to which you can
later roll back.

4.04 SQL Clauses

SQL queries are made up of different clauses that define how the query
should behave:
1. WHERE: Filters records based on a condition.
2. ORDER BY: Sorts the result set based on one or more columns.
3. GROUP BY: Groups rows that share a property into summary rows
(e.g., SUM, AVG).
4. HAVING: Filters groups created by the GROUP BY clause based on a
condition.
5. JOIN: Combines rows from two or more tables based on related
columns.
6. LIMIT: Specifies the number of records to return.

16
Types of SQL Joins
1. INNER JOIN: Returns records that have matching values in both
tables.
2. LEFT JOIN (or LEFT OUTER JOIN): Returns all records from the left
table and the matched records from the right table. Non-matching
rows from the right table will be returned as NULL.
3. RIGHT JOIN (or RIGHT OUTER JOIN): Similar to the LEFT JOIN, but
returns all records from the right table.
4. FULL JOIN (or FULL OUTER JOIN): Returns all records when there
is a match in either left or right table.

SQL Functions
SQL includes built-in functions for performing calculations and
operations on data:
1. Aggregate Functions: Operate on a collection of values to return a
single value:
o COUNT(): Returns the number of rows.
o SUM(): Returns the sum of a numeric column.
o AVG(): Returns the average value of a numeric column.
o MIN() and MAX(): Return the smallest and largest value in a
column, respectively.
2. Scalar Functions: Operate on a single value and return a single
value:
o UPPER(): Converts a string to uppercase.
o LOWER(): Converts a string to lowercase.
o CONCAT(): Combines two or more strings into one.
o LENGTH(): Returns the length of a string.

17
SQL Constraints
Constraints are used to define rules for the data in a table. They ensure
data integrity and accuracy.
1. PRIMARY KEY: Uniquely identifies each record in a table. Each
table can have only one primary key.
2. FOREIGN KEY: Ensures referential integrity by linking a column in
one table to the primary key of another table.
3. NOT NULL: Ensures that a column cannot have a NULL value.
4. UNIQUE: Ensures that all values in a column are distinct.
5. CHECK: Ensures that the values in a column satisfy a specific
condition.
6. DEFAULT: Provides a default value for a column when none is
specified.
Normalization
Normalization is the process of organizing data in a database to reduce
redundancy and improve data integrity. The goal is to separate data
into multiple related tables and eliminate unnecessary duplication.
There are several normal forms (1NF, 2NF, 3NF, etc.), each defining a
level of normalization.
SQL Indexes
Indexes improve the speed of data retrieval operations on a database
table by providing a fast lookup for search queries. However, indexes
slow down data modification operations like INSERT, UPDATE, and
DELETE.

SQL Best Practices


1. Use meaningful table and column names: Tables and columns
should have descriptive names that reflect their content.
2. Avoid using SELECT * in production: Specify the columns you
need to improve performance and reduce unnecessary data
retrieval.

18
3. Use parameterized queries: To avoid SQL injection, always use
parameterized queries rather than concatenating user input into
SQL statements.
4. Optimize queries: Avoid complex joins, and use appropriate
indexes to improve query performance.
5. Maintain database normalization: Organize data into logical
tables to minimize redundancy and ensure data integrity.

19
CHAPTER-5

JDBC (Java Database Connectivity) is an API (Application


Programming Interface) in Java that enables Java applications to
interact with databases. It provides a set of interfaces and classes to
connect to a database, execute queries, retrieve data, and update
database records. JDBC acts as a bridge between Java code and
database management systems (DBMS), allowing developers to use
SQL commands directly within Java applications.
Key Concepts of JDBC
1. JDBC Drivers: JDBC uses drivers to connect with various databases.
Drivers are specific to the database being used and translate JDBC
requests into database-specific calls. There are four types of JDBC
drivers:
o Type 1: JDBC-ODBC bridge drivers, which are generally less
commonly used today.
o Type 2: Native-API drivers that rely on native database
libraries.
o Type 3: Network Protocol drivers that communicate over a
network to database servers.
o Type 4: Thin drivers, which are pure Java drivers that
communicate directly with the database using database-
specific protocols.
2. JDBC Architecture: The architecture consists of two main parts:
o JDBC API: Provides interfaces for performing database
operations.
o JDBC Driver Manager: Manages a list of database drivers,
ensuring the correct driver is used for database connectivity.
3. JDBC Connection:
o To connect to a database, JDBC uses a Connection object. A
connection is established using the DriverManager class,

20
which selects the correct driver based on the database URL,
username, and password.
4. JDBC Statements:
o JDBC uses different types of statements to execute SQL
queries:
 Statement: Used for simple SQL queries without
parameters.
 Prepared Statement: Used for precompiled SQL
queries, ideal for queries with parameters, as it prevents
SQL injection.
 Callable Statement: Used to execute stored
procedures in the database.
5. Executing Queries:
o Once connected, JDBC allows the execution of SQL commands
such as SELECT, INSERT, UPDATE, and DELETE. Results from
SELECT queries are returned in a Result Set object.
6. Result Set:
o Result Set is used to store and navigate through the results of
a query. It allows the application to read each row and column
returned by a SELECT query.
7. Error Handling:
o JDBC provides the SQL Exception class for handling database-
related errors. This class provides information about errors
that occur during database interactions.

8. Transaction Management:
o JDBC supports transaction management to maintain database
integrity. Transactions allow multiple operations to be treated
as a single unit, with commands to commit or rollback based
on success or failure.
Example Workflow of JDBC Operations
1. Load the database driver.

21
2. Establish a connection to the database.
3. Create a statement to perform queries.
4. Execute the statement and process the results.
JDBC Advantages
 Platform Independence: Works on any platform with Java support.
 Database Independence: Connects to various database systems
using different JDBC drivers.
 Security: Offers secure database interactions through
parameterized queries (e.g., Prepared Statement).
JDBC Use Cases :
Java Database Connectivity (JDBC) is an API in Java that allows
developers to connect to and interact with databases using SQL
(Structured Query Language). JDBC provides a standard way to
access relational databases and perform operations such as
querying, updating, and managing data. Below are some common
use cases for JDBC in real-world applications:
1. Connecting to Databases
JDBC is primarily used to establish a connection between Java
applications and relational databases like MySQL, PostgreSQL,
Oracle, or SQL Server. By using JDBC, applications can interact with
the database, send SQL commands, and retrieve results.
Example Use Case: A Java web application connecting to a MySQL
database to fetch and display user data.
2. CRUD Operations (Create, Read, Update, Delete)
JDBC is widely used for performing CRUD operations, which are the
foundational operations in database-driven applications. Developers
use JDBC to insert new records, fetch data from tables, update
existing records, and delete data from the database.
 Create: Inserting new records.
 Read: Fetching records with SELECT queries.
 Update: Modifying existing records.
 Delete: Removing records from a table.

22
Example Use Case: A customer management system allowing admins
to add, view, update, and delete customer records from a database.
3. Transaction Management
JDBC provides transaction control, allowing developers to group
multiple SQL operations into a single unit of work. Transactions ensure
that the operations are completed successfully or rolled back if an error
occurs, maintaining data integrity.
Example Use Case: In an e-commerce application, when a user
makes a purchase, multiple operations (e.g., updating inventory,
inserting an order, updating customer details) should be performed
as part of a single transaction. If any operation fails, the transaction
is rolled back to maintain consistency.
4. Batch Processing
JDBC supports batch processing, which allows executing multiple SQL
commands in a single batch. This is more efficient than executing
individual SQL statements one by one, especially when dealing with
large amounts of data.
Example Use Case: A data import tool that inserts multiple records
into a database from an external file (e.g., CSV) in one go, improving
performance when handling large datasets.
5. Stored Procedure Execution
JDBC can be used to execute stored procedures, which are precompiled
SQL code stored in the database. Stored procedures can be used to
encapsulate complex queries and operations on the database side.
Example Use Case: A finance application that uses stored procedures
to calculate and return tax values, reducing the complexity of SQL
logic in the application code.

23
CHAPTER-6
API (Application Programming Interface)
An API (Application Programming Interface) is a set of protocols,
routines, and tools that allow different software applications to
communicate with each other. It defines the way different software
components should interact, providing a way for programs to
request services or data from other programs or services.
6.01 Key Concepts of an API
1. Endpoints: An endpoint is a URL where the API can be accessed
by a client application. Each endpoint is associated with a specific
function or service the API provides. For example, in a RESTful API,
an endpoint might be something like https://api.example.com/users,
which could be used to fetch user data.
2. Request Methods: API calls are typically made using HTTP
methods, which define the type of operation you want to perform on
the resource. Common methods include:
o GET: Fetch data from the server.
o POST: Send data to the server to create a new resource.
o PUT: Update an existing resource on the server.
o DELETE: Remove a resource from the server.
3. Request and Response:
o Request: A client sends an API request to the server, which
includes an endpoint, the HTTP method, headers, parameters,
and possibly a body containing data.
o Response: After processing the request, the server sends
back a response, typically including a status code (such as
200 for success), headers, and the requested data or error
messages.

24
4. Data Formats: APIs typically use JSON (JavaScript Object
Notation) or XML as the data format for sending and receiving
data between the client and the server. JSON is more commonly
used due to its lightweight and easy-to-read nature.

6.02 Types of APIs


1. REST (Representational State Transfer):
o REST is a set of architectural principles for creating web
services. It is stateless, uses HTTP methods (GET, POST, PUT,
DELETE), and relies on standard URLs for accessing resources.
o RESTful APIs are widely used due to their simplicity and
scalability.
2. SOAP (Simple Object Access Protocol):
o SOAP is a protocol for exchanging structured information using
XML. SOAP APIs are more rigid and standardized compared to
REST APIs. They support features like security and transaction
handling.
o SOAP is typically used in enterprise-level applications where
security, reliability, and ACID-compliant transactions are
required.
3. GraphQL:
o A query language for APIs, GraphQL allows clients to request
only the data they need. Unlike REST, where multiple
endpoints are needed to fetch related data, GraphQL lets you
request data from multiple sources in a single query.
4. WebSockets:
o WebSockets enable two-way communication between the
client and the server over a persistent connection. This is ideal
for real-time applications like chat apps, stock trading
platforms, or live sports feeds.
6.03 Components of an API
1. Authentication and Authorization:

25
o Authentication: Verifies the identity of a user or system
trying to access the API. Common methods include API keys,
OAuth tokens, and JWT (JSON Web Tokens).
o Authorization: Determines what actions the authenticated
user or system is allowed to perform on the API.
2. Rate Limiting:
o Many APIs limit the number of requests a client can make in a
given time period to prevent abuse and ensure fair usage. For
example, an API might allow 100 requests per minute.
3. API Documentation:
o API documentation is crucial for developers to understand how
to use the API. It typically includes details about endpoints,
request methods, data formats, query parameters,
authentication methods, error codes, and usage examples.
Tools like Swagger/OpenAPI are commonly used to generate
and visualize API documentation.
Common API Response Codes
 200 OK: The request was successful.
 201 Created: A new resource was successfully created.
 400 Bad Request: The request was malformed or invalid.
 401 Unauthorized: Authentication is required and has failed or has
not been provided.
 403 Forbidden: The server understood the request, but it refuses
to authorize it.
 404 Not Found: The requested resource could not be found.
 500 Internal Server Error: The server encountered an error while
processing the request.
6.04 Use Cases of APIs
1. Data Retrieval and Manipulation:
o APIs are widely used to retrieve and manipulate data from
a server, such as fetching user information from a
database, updating product listings, or processing
payments.

26
2. Third-Party Integrations:
o APIs allow developers to integrate external services into
their applications. For example, integrating payment
gateways (e.g., PayPal or Stripe), social media login (e.g.,
Facebook or Google), and cloud storage services (e.g.,
AWS, Google Cloud).

3. Microservices Architecture:
o In modern software design, APIs play a crucial role in
enabling communication between different microservices.
Each service can have its own API, and they communicate
with each other over HTTP or messaging protocols.
4. Mobile and Web Applications:
o APIs are essential for mobile and web applications that
need to interact with a backend or third-party services. For
instance, mobile apps might use APIs to fetch data from a
server or update user information.
5. IoT (Internet of Things):
o APIs are used in IoT to facilitate communication between
devices and platforms. Devices like sensors, smart
thermostats, and cameras send data through APIs to
servers or cloud platforms for processing and analysis

27
CHAPTER-7
APPLICATION MADE BY USING THIS PROJECT

Simple Bank Management System


This project aims to address the needs of efficient banking transactions
and secure account management. Here's a concise overview
Abstract:
The Bank Management System project is designed to keep track of
clients bank accounts. It serves as a robust banking software, covering
essential functionalities Here are the key points
1.Account Creation: Users can open new accounts by providing
necessary details such as account number, account type, name, and
initial balance
2. Account Details: The system displays account information,
including the account holder's name, account number, account type,
and current balance
3.Deposits and Withdrawals. Users can deposit or withdraw money
their accounts
4.Search Functionality. The system allows users to search for
account details based on the account number
5. Account Transfer: The system allows users to transfer amount
from one account to another account.

Implementation Details:

28
1.Languages Used: The project can be implemented using various
programming languages, including Spring Boot, MySQL, Java 8,
Maven, Tomcat Server
2.Source Codes: Complete source codes available for free, enabling
developers to explore and enhance the system.

3.Modules
 Manage Bank Transactions: Handles deposits and withdrawal
 Client Management: Manages client details.
 Log In and Log Out Provides secure access.
 Client Registration. Allows new clients to register.
 Contact Information: Stores client contact data

Conclusion:
The Bark Management System project bridges the gap between
traditional barking and modern digital solutions By offering multiple
ways to perform banking to the needs of end users. Whether you're a
developer or a curious learner, exploring this project can provide
valuable might’s into banking software development!
Remember, this abstract is just the tip of the iceberg! If you're
interested, you can dive deeper into the full project report and
documentation to understand the intricacies of building a robust bank
management system

System Configuration:

H/W System Configuration: -

Processor - Intel(R) Core (TM) 15-6300U CPU @ 2.40GHz


2.50 GHz

Speed -1.1 Ghz

RAM -16 GB

29
Hard Disk - 20 GB

Key Board - Standard Windows Keyboard

Mouse - Two or Three Button Mouse

Monitor - SVGA

CODE USED IN THIS APPLICATION:

import java.util.Scanner;

class BankAccount {
private String accountHolder;
private String accountNumber;
private double balance;

// Constructor to initialize the account


public BankAccount(String accountHolder, String accountNumber) {
this.accountHolder = accountHolder;
this.accountNumber = accountNumber;
this.balance = 0.0; // Initial balance is 0
}

// Method to deposit money


public void deposit(double amount) {
if(amount > 0) {
balance += amount;
System.out.println("Deposited: " + amount);
} else {
System.out.println("Invalid deposit amount.");
}
}

// Method to withdraw money


public void withdraw(double amount) {
if(amount > 0 && amount <= balance) {
balance -= amount;
System.out.println("Withdrawn: " + amount);
} else {
System.out.println("Insufficient balance or invalid amount.");
}

30
}

// Method to check the balance


public void checkBalance() {
System.out.println("Current balance: " + balance);
}
}

public class SimpleBankManagementSystem {


public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

// Creating an account
BankAccount account = new BankAccount("John Doe",
"1234567890");

while (true) {
// Displaying menu options
System.out.println("\n--- Simple Bank Management System ---");
System.out.println("1. Deposit");
System.out.println("2. Withdraw");
System.out.println("3. Check Balance");
System.out.println("4. Exit");
System.out.print("Enter your choice: ");

int choice = scanner.nextInt();

switch (choice) {
case 1:
System.out.print("Enter amount to deposit: ");
double depositAmount = scanner.nextDouble();
account.deposit(depositAmount);
break;

case 2:
System.out.print("Enter amount to withdraw: ");
double withdrawAmount = scanner.nextDouble();
account.withdraw(withdrawAmount);
break;

case 3:
account.checkBalance();
break;

case 4:

31
System.out.println("Exiting... Thank you for using the bank
system.");
scanner.close();
return;

default:
System.out.println("Invalid choice! Please try again.");
}
}
}

OUTCOMES DESCRIPTION

The work environment I have experienced:

During my Java Full Stack Internship, I've had the opportunity to


immerse myself in a dynamic and collaborative work environment that
has significantly contributed to my professional growth. The atmosphere
within the development team has been marked by a culture of
innovation, continuous learning, and teamwork.

The work environment fostered a culture of collaboration, with team


members readily sharing knowledge, insights, and best practices.
Regular team meetings, code reviews, and collaborative discussions
created a platform for exchanging ideas and problem-solving. This
collaborative spirit not only accelerated my learning curve but also
reinforced the
importance of collective efforts in achieving project goals.

The internship provided exposure to an agile development methodology,


emphasizing adaptability and responsiveness to changing requirements.
Daily stand-up meetings, sprint planning sessions, and retrospectives
were integral components of our agile workflow. This experience has
instilled in me the value of iterative development, allowing for frequent
feedback and continuous improvement throughout the project lifecycle.

32
Technical skills I have acquired:

Through the Java Full Stack Internship, I have honed a comprehensive


set of technical skills that span the entire spectrum of web development.
On the front-end, I've become proficient in crafting visually appealing and
responsive user interfaces using HTML, CSS, and JavaScript. This includes
a deep understanding of web design principles, ensuring an optimal user
experience. Additionally, I've worked extensively with front-end
frameworks and libraries, enhancing my ability to create dynamic and
interactive elements for websites. My proficiency in optimizing
performance and ensuring cross-browser compatibility underscores my
commitment to delivering high-quality front-end solutions.

On the back-end, I've gained expertise in JavaServer Pages (JSP),


Servlets, and JDBC for server-side development. This includes a mastery
of Java programming, JDBC establishment, and database management,
providing a robust foundation for handling dynamic content and
database interactions. I have successfully implemented key back-end
functionalities such as user authentication, session management, and
database operations, showcasing my ability to create secure and
scalable server-side components. The integration of front-end and back-
end technologies in a major project, specifically a Shopping Cart
application, reflects my holistic understanding of full stack development

33
and the seamless coordination required to deliver a functional and
efficient web application.

CONCLUSION:

Full Stack Java development involves building both the front-end and
back-end of web applications using Java and associated technologies. A
Full Stack Java developer is proficient in front-end technologies like HTML,
CSS, JavaScript, and frameworks such as Angular or React, while also
mastering back-end development using Java frameworks like Spring Boot
and Hibernate. They are skilled in managing databases (SQL and NoSQL),
creating RESTful APIs, implementing security features, and deploying
applications using tools like Git and cloud platforms. The role requires the
ability to handle the entire application lifecycle, from designing the user
interface to managing server-side logic, and offers versatility and high
demand in the job market. However, it also comes with the challenge of
mastering a broad set of technologies and staying updated with rapid
advancements in both front-end and back-end tools.
A Full Stack Java developer is expected to be well-versed in both client-
side and server-side programming. They must have a deep understanding
of how to structure a web application, from handling user interactions and
display logic in the front-end to data processing and API management in
the back-end. They are familiar with database integration, ensuring data is
stored efficiently and can be accessed and modified as needed. Full Stack
Java developers work with version control systems like Git to manage

34
code, collaborate with teams, and track project progress. Knowledge of
deployment tools and cloud platforms like AWS or Heroku is also essential
for bringing an application live.

35

You might also like