Int413 Final
Int413 Final
By
Dadi Sampath Kumar
(21NT1A0413)
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.
EXTERNAL SIGNATURE
CERTIFICATE FROM SKILLDZIRE ORGANIZATION
DECLARATION
i
ACKNOWLEDGMENT
This work could not have been fruitful without the continuous
guidance and support from numerous people.
I thank the Almighty for giving me the strength and patience to work
through all these years.
ii
ABSTRACT
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:
iv
4.05-SQL Functions
4.06-SQL Constraints
4.07-SQL Indexes
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
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();.
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.
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.
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
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.
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
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.
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.
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.
14
CHAPTER-4
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.
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.
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
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.
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
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:
RAM -16 GB
29
Hard Disk - 20 GB
Monitor - SVGA
import java.util.Scanner;
class BankAccount {
private String accountHolder;
private String accountNumber;
private double balance;
30
}
// 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: ");
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
32
Technical skills I have acquired:
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