Java Training Report
Java Training Report
in the partial fulfillment of the requirements for the four weeks Summer Institutional
Training of Bachelor of Technology in Computer Science & Engineering
By
Hemant Baghel
23100030031
Submitted to
CSE Department
1
23100030031 Java Training Report
Completion Certificate
2
23100030031 Java Training Report
Acknowledgement
I would like to express my sincere gratitude to Prof. Aruna Bhatia for her
invaluable guidance during my summer training in Java. Despite the training
being conducted independently through the Infosys springboard platform,
her consistent support, timely feedback, and insightful suggestions greatly
enhanced my learning experience. Her encouragement motivated me to
deepen my understanding and to successfully complete the "Learn
programming with java – An interactive way" course.
This training experience has not only broadened my technical expertise but
also strengthened my ability to work independently and efficiently, which I
consider to be invaluable assets for my future
3
23100030031 Java Training Report
Table of Contents Page no.
1. Object Oriented Programming and Java Fundamentals: 6-13
a. is Java ,History of Java ,
b. Features of Java ,
c. Comparison in Java with and C++ ,
d. What JDK,
e. JRE & JVM ,
f. Data Statements Types,
g. Variables,
h. Arrays,
i. Operators and
j. Control Structures
2. Interfaces and Packages: 14-20
a. Interface basics; Defining,
b. implementing and extending interfaces,
c. differences between classes and interfaces,
d. Implementing multiple inheritance using interfaces ,
e. Basics of packages,
f. Creating and accessing packages,
g. System packages,
h. Creating user defined packages,
i. Exploring packages – Java.io, Java.util.
3. Exception Handling: 21-26
a. Using the main keywords of exception handling:
b. try,
c. catch,
d. throw,
e. throws and finally;
f. Nested try,
g. Multiple catch statements.
4. Multithreading: 27-29
a. Differences between multi-threading and multitasking,
b. thread life cycle,
c. creating threads,
d. synchronizing threads,
e. daemon threads,
f. thread groups.
4
23100030031 Java Training Report
a. The AWT class hierarchy ,
b. Events, Event sources,
c. Event classes,
d. Event Listeners,
e. Relationship between Event sources and Listeners,
f. Delegation event model,
g. Creating GUI applications using AWT,
h. Creating GUI applications using AWT.
6. Swing: 34-37
a. Introduction,
b. exploring swing-JApplet,JFrame and JComponent,
c. Icons and Labels,
d. Text fields, buttons – The Jbutton class,
e. Check boxes,
f. Radio buttons,
g. Combo boxes,
h. Tabbed Panes,
i. Scroll Panes,
j. Trees, and
k. Tables.
5
23100030031 Java Training Report
Module 1. Object-Oriented Programming and Java
Fundamentals
a. What is Java?
b. History of Java
o Java was initiated by James Gosling and his team at Sun Microsystems in the early 1990s.
Initially called "Oak," the language was later renamed "Java." The first version was released
in 1995, and it quickly became popular due to its platform independence, thanks to the Java
Virtual Machine (JVM).
c. Features of Java
o Platform Independence: Java code is compiled into bytecode, which can run on any system
with a JVM.
o Object-Oriented: Everything in Java is treated as an object.
6
23100030031 Java Training Report
o Simple and Secure: Java provides a simple and secure environment for developing
applications.
o Robust: Java has strong memory management, exception handling, and garbage collection.
o Multithreaded: Java supports multithreaded programming, allowing concurrent execution of
two or more threads.
o High Performance: Java achieves high performance with the help of the Just-In-Time (JIT)
compiler.
o Distributed: Java supports networking and can handle distributed applications.
o Memory Management: Java has automatic garbage collection, whereas C++ requires
manual memory management.
o Syntax: Both have similar syntax, but Java is simpler as it lacks pointers and multiple
inheritance (which is handled by interfaces).
o Platform Independence: Java is platform-independent due to the JVM, while C++ is
platform-dependent.
o Object-Oriented: Both are object-oriented, but Java is purely object-oriented (with no global
functions or variables), whereas C++ supports both procedural and object-oriented
programming.
o JDK (Java Development Kit): It includes tools to develop Java applications, such as the
compiler and libraries.
o JRE (Java Runtime Environment): It provides the libraries and JVM required to run Java
applications.
o JVM (Java Virtual Machine): It executes Java bytecode and provides platform
independence.
f. Data Types,
o Data Types: Java supports primitive data types like int, char, float, etc., and non-primitive
data types like arrays and objects.
7
23100030031 Java Training Report
Primitive Data Types: byte, short, int, long, float, double, char, boolean
// Output
8
23100030031 Java Training Report
g. Variables,
// Instance Variable
// Static Variable
// Local Variable
9
23100030031 Java Training Report
obj.display();
h. Arrays
o Arrays: Arrays in Java are objects that hold multiple values of the same type..An array is a
collection of variables of the same type.
// Array of integers
10
23100030031 Java Training Report
i. Operators
Operators: Operators are used to perform operations on variables and values. Java supports
various operators:
Arithmetic Operators: +, -, *, /, %
Relational Operators: ==, !=, >, <, >=, <=
Logical Operators: &&, ||, !
Bitwise Operators: &, |, ^, ~, <<, >>, >>>
Assignment Operators: =, +=, -=, *=, /=, %=
int a = 10, b = 5;
// Arithmetic Operators
// Relational Operators
11
23100030031 Java Training Report
// Logical Operators
System.out.println("a > 5 && b < 10: " + (a > 5 && b < 10));
// Bitwise Operators
j. Control Structures
o Control Structures: Java includes control structures like if, else, switch, while, for, do-
while, and break/continue for controlling the flow of the program.
if (number > 0) {
System.out.println("Number is positive.");
System.out.println("Number is negative.");
} else {
System.out.println("Number is zero.");
12
23100030031 Java Training Report
}
// While loop
int i = 1;
while (i <= 5) {
System.out.println("While Loop Iteration: " + i);
i++;
}
// Do-While loop
int j = 1;
do {
System.out.println("Do-While Loop Iteration: " + j);
j++;
} while (j <= 5);
}
}
13
23100030031 Java Training Report
Module 2. Interfaces and Packages
Interfaces in Java
Basics: An interface in Java is a reference type, similar to a class, that can contain only
abstract methods and final static variables.
Defining, Implementing, and Extending Interfaces: You define an interface using the
interface keyword, implement it using the implements keyword, and extend it using the
extends keyword.
// Define an interface
interface Animal {
System.out.println("Dog barks");
14
23100030031 Java Training Report
public static void main(String[] args) {
// Define an interface
interface Animal {
void sound();
void play();
System.out.println("Cat meows");
15
23100030031 Java Training Report
System.out.println("Cat plays");
Implementing Multiple Inheritance Using Interfaces: Java does not support multiple inheritance
with classes but allows it with interfaces.
interface Printable {
void print();
interface Showable {
void show();
16
23100030031 Java Training Report
class Document implements Printable, Showable {
System.out.println("Printing document");
System.out.println("Showing document");
17
23100030031 Java Training Report
class). (implements multiple interfaces).
Cannot have instance variables
Fields Can have instance variables (fields). (only constants).
Constructo Can have constructors for object No constructors (no object
r initialization. instantiation).
Access Methods and fields can have different
Modifiers access specifiers (public, private, etc.). All methods are implicitly public.
Example java class Dog { /* ... */ } java interface Car { /* ... */ }
Packages in Java
Basics: Packages are used to group related classes and interfaces, making it easier to manage
large codebases.
Program
// Package declaration
package mypack;
System.out.println("This is my package!");
18
23100030031 Java Training Report
import mypack.MyPackage;
System Packages:
User-Defined Packages: You can create your own packages to organize your code.
Exploring Packages: Commonly used packages include:
o java.io: For input and output operations.
o java.util: For utility classes like collections, date, and time.
list.add("Java");
19
23100030031 Java Training Report
list.add("Python");
20
23100030031 Java Training Report
Module 3. Exception Handling
1. Exception Handling in Java
o Basics: Exceptions are unwanted or unexpected events that occur during program
execution. Java provides a robust mechanism to handle exceptions.
o Key Keywords:
try: Encloses the code that might throw an exception.
catch: Used to handle the exception thrown by the try block.
throw: Used to explicitly throw an exception.
throws: Indicates the exceptions that a method can throw.
finally: Executes code after try and catch, regardless of whether an exception was
thrown.
o Nested try and Multiple catch Statements: Java allows nesting of try-catch blocks and
provides multiple catch blocks to handle different types of exceptions.
try {
} catch (ArithmeticException e) {
21
23100030031 Java Training Report
// Handling the exception
try {
} catch (ArithmeticException e) {
} catch (ArrayIndexOutOfBoundsException e) {
} catch (Exception e) {
22
23100030031 Java Training Report
3. Nested try-catch
try {
try {
} catch (ArithmeticException e) {
try {
} catch (ArrayIndexOutOfBoundsException e) {
} catch (Exception e) {
23
23100030031 Java Training Report
}
} else {
System.out.println("Eligible to vote");
try {
validateAge(16);
} catch (ArithmeticException e) {
24
23100030031 Java Training Report
5. Using `throws` Keyword
if (b == 0) {
} else {
try {
} catch (ArithmeticException e) {
6. `finally` Block
try {
25
23100030031 Java Training Report
} catch (ArithmeticException e) {
} finally {
System.out.println("Program continues...");
try {
26
23100030031 Java Training Report
Module 4. Multithreading
2. Creating Threads
27
23100030031 Java Training Report
class MyThread extends Thread {
public void run() {
System.out.println("Thread is running...");
}
}
4. Synchronizing Threads
class Counter {
synchronized void printCounter(int n) {
for (int i = 1; i <= 5; i++) {
System.out.println(n * i);
try {
Thread.sleep(400);
} catch (Exception e) {
System.out.println(e);
}
}
}
}
MyThread1(Counter counter) {
this.counter = counter;
}
28
23100030031 Java Training Report
counter.printCounter(5);
}
}
t1.start();
t2.start();
}
}
29
23100030031 Java Training Report
Module 5. Event Handling and AWT
Events: Respond to user actions (e.g., mouse clicks, key presses, window events).
Java AWT: Provides event listener interfaces and adapters for effective event handling.
Common Event Classes in AWT: ActionEvent: Button clicks, menu item selections.
30
23100030031 Java Training Report
Example: Tracking Mouse Movement
import java.awt.*;
import java.awt.event.*;
MouseMotionExample() {
label = new Label();
label.setBounds(50, 50, 200, 20);
// Frame properties
setSize(400, 400);
setLayout(null);
setVisible(true);
}
Explanation:
31
23100030031 Java Training Report
import java.awt.*;
import java.awt.event.*;
KeyEventExample() {
ta = new TextArea();
ta.setBounds(50, 50, 300, 200);
add(ta);
// Frame properties
setSize(400, 300);
setLayout(null);
setVisible(true);
}
Explanation:
import java.awt.*;
import java.awt.event.*;
32
23100030031 Java Training Report
FocusEventExample() {
tf1 = new TextField("Focus on me");
tf1.setBounds(50, 50, 150, 30);
tf1.addFocusListener(this);
tf2.addFocusListener(this);
add(tf1);
add(tf2);
setSize(300, 200);
setLayout(null);
setVisible(true);
}
Explanation:
33
23100030031 Java Training Report
Module 6. Swing
Swing components are more flexible and feature-rich compared to AWT components. They provide a
more consistent look and feel across different platforms.
java
Copy code
import javax.swing.*;
frame.add(panel);
frame.setVisible(true);
}
}
34
23100030031 Java Training Report
Explanation:
java
Copy code
import javax.swing.*;
import java.awt.event.*;
frame.add(textField);
frame.add(button);
frame.add(checkBox);
frame.add(radioButton);
frame.setVisible(true);
}
35
23100030031 Java Training Report
}
Explanation:
java
Copy code
import javax.swing.*;
// JComboBox
JComboBox<String> comboBox = new JComboBox<>(new String[]{"Option 1", "Option 2",
"Option 3"});
comboBox.setBounds(50, 50, 150, 30);
// JTabbedPane
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.setBounds(50, 100, 300, 100);
tabbedPane.addTab("Tab 1", new JLabel("Content of Tab 1"));
tabbedPane.addTab("Tab 2", new JLabel("Content of Tab 2"));
// JScrollPane
JTextArea textArea = new JTextArea("Scrollable content goes here...");
JScrollPane scrollPane = new JScrollPane(textArea);
scrollPane.setBounds(50, 220, 300, 100);
frame.add(comboBox);
frame.add(tabbedPane);
frame.add(scrollPane);
frame.setVisible(true);
}
}
Explanation:
36
23100030031 Java Training Report
JComboBox: Provides a drop-down list of options.
JTabbedPane: Allows for tabbed navigation between different panels.
JScrollPane: Provides a scrollable view of another component, like a JTextArea.
java
Copy code
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.table.DefaultTableModel;
// JTree
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("Child 1");
DefaultMutableTreeNode child2 = new DefaultMutableTreeNode("Child 2");
root.add(child1);
root.add(child2);
JTree tree = new JTree(root);
tree.setBounds(50, 50, 150, 150);
// JTable
String[] columnNames = {"Name", "Age", "City"};
Object[][] data = {
{"Alice", 30, "New York"},
{"Bob", 25, "San Francisco"},
37
23100030031 Java Training Report
Module 7. Applets and Servlets
1. Applets
An applet is a Java program that runs inside a web browser or an applet viewer. It is a client-side
program, meaning it is executed on the client machine. Applets are embedded in HTML pages and can be
executed via a browser with Java support.
Concepts of Applets
Applets differ from standard Java applications because they don't have a main() method. Instead,
they rely on several lifecycle methods, such as init(), start(), stop(), and destroy().
1. init(): This method is called when the applet is first loaded. It is used to initialize variables or set
up resources.
2. start(): Called after init(), or when the applet is restarted. It is where the execution starts or
resumes.
3. stop(): This method is called when the applet is stopped or the user navigates away from the
page.
4. destroy(): This method is called when the applet is about to be removed permanently from
memory.
38
23100030031 Java Training Report
// destroy() method - called before applet is removed from memory
public void destroy() {
System.out.println("Applet Destroyed");
}
Types of Applets
1. Local Applet: These applets are stored on the user's local machine. They don't need any network
access.
2. Remote Applet: These applets are stored on a remote web server and downloaded to the client's
machine when the web page containing the applet is loaded.
Runs inside
Runs
a web
independently
Execution browser or
as a Java
applet
program
viewer
Has init(),
Lifecycle start(), Uses only
methods stop(), main() method
destroy()
Limited
Full access to
access to
Security system
system
resources
resources
39
23100030031 Java Training Report
2. Servlets
Servlets are Java programs that run on a server and handle client requests and responses.
They are used to create dynamic web content, process form data, and interact with databases.
Servlets are managed by a web container (e.g., Tomcat, Jetty).
1. Initialization: The servlet is loaded and initialized using the init() method.
2. Request Handling: The servlet processes client requests using the service() method.
3. Destruction: The servlet is destroyed using the destroy() method when it is no longer needed.
HttpServlet: A class that extends GenericServlet and is used for handling HTTP requests.
HttpServletRequest: Represents the request made by the client.
HttpServletResponse: Represents the response to be sent to the client.
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Explanation:
40
23100030031 Java Training Report
3. Deploy to a Web Container: Place the WAR file in the webapps directory of a web container like
Tomcat.
4. Access the Servlet: Open a web browser and navigate to
http://localhost:8080/your-app/HelloWorldServlet.
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
response.setContentType("text/html");
response.getWriter().println("<html><body>");
response.getWriter().println("<h2>Form Data</h2>");
response.getWriter().println("Name: " + name + "<br>");
response.getWriter().println("Email: " + email);
response.getWriter().println("</body></html>");
}
}
Explanation:
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
41
23100030031 Java Training Report
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Cookie cookie = new Cookie("user", "JohnDoe");
response.addCookie(cookie);
response.getWriter().println("Cookie has been set.");
}
}
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
Explanation:
42
23100030031 Java Training Report
Practicle 1
1.A Write a java program to find the Fibonacci series
printFibonacci(terms);
int a = 0, b = 1;
int next = a + b;
a = b;
b = next;
}
1.B Write a java program to multiply two given matrices.
int[][] matrixA = {
};
int[][] matrixB = {
43
23100030031 Java Training Report
int[][] result = multiplyMatrices(matrixA, matrixB);
System.out.println("Resultant Matrix:");
System.out.println();
if (colsA != rowsB) {
return result;
44
23100030031 Java Training Report
2.A Write a java program for Method overloads and Constructor overloading.
public class OverloadingExample {
// Constructor Overloading
public OverloadingExample() {
System.out.println("No-argument constructor");
public OverloadingExample(int a) {
public OverloadingExample(double b) {
// Method Overloading
System.out.println("No-argument method");
45
23100030031 Java Training Report
obj1.display();
obj1.display(100);
obj1.display(200.5);
2.B Write a Java program that checks whether a given string is a palindrome
or not. Ex: MADAM is a palindrome.
public class PalindromeChecker {
str = str.toLowerCase();
start++;
end--;
return true;
if (isPalindrome(str)) {
} else {
46
23100030031 Java Training Report
3.A Write a Java program to create an abstract class named Shape that
contains two integers and an empty method named print Area ().
Provide three classes named Rectangle, Triangle, and Circle such
that each one of the classes extends the class Shape. Each one of the
classes contains only the method print Area () that prints the area of the
given shape
// Rectangle class
this.dimension1 = width;
this.dimension2 = height;
@Override
void printArea() {
// Triangle class
this.dimension1 = base;
47
23100030031 Java Training Report
this.dimension2 = height;
@Override
void printArea() {
// Circle class
this.dimension1 = radius;
@Override
void printArea() {
rect.printArea();
tri.printArea();
circ.printArea(); }
48
23100030031 Java Training Report
3.B Write a Java program to implement Inheritance,
// Base class Animal
class Animal {
void eat() {
void bark() {
void meow() {
dog.eat();
cat.eat();
dog.bark();
cat.meow(); }}
49
23100030031 Java Training Report
4. Write a Java program to implement interfaces and packages.
// Define an interface
interface Animal {
void makeSound();
@Override
System.out.println("Dog barks");
@Override
System.out.println("Cat meows");
dog.makeSound();
cat.makeSound();
50
23100030031 Java Training Report
package mypackage;
void makeSound();
package mypackage;
@Override
System.out.println("Dog barks");
package mypackage;
@Override
System.out.println("Cat meows");
package mypackage;
dog.makeSound();
cat.makeSound();
51
23100030031 Java Training Report
5. Write a program which will explain the concept of try, catch and throw.
52
23100030031 Java Training Report
6. Write a java program that handles all mouse events and shows the event
name at the center of the window when a mouse event is fired.
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public MouseEventDemo() {
setSize(400, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
addMouseListener(this);
@Override
super.paint(g);
FontMetrics fm = g2d.getFontMetrics();
g2d.drawString(eventName, x, y);
53
23100030031 Java Training Report
@Override
@Override
@Override
@Override
@Override
54
23100030031 Java Training Report
7. showing concept of threads by importing thread class
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public MouseEventDemo() {
setSize(400, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
addMouseListener(this);
@Override
super.paint(g);
FontMetrics fm = g2d.getFontMetrics();
g2d.drawString(eventName, x, y);
55
23100030031 Java Training Report
@Override
@Override
@Override
@Override
@Override
56
23100030031 Java Training Report
8. a) Write an applet program that displays a simple message.
import java.applet.Applet;
import java.awt.Graphics;
/*
<applet code="SimpleMessageApplet" width="300" height="100">
</applet>
*/
public class SimpleMessageApplet extends Applet {
@Override
public void paint(Graphics g) {
g.drawString("Hello, Applet!", 50, 50);
}}
8. b) Write a Java program compute factorial value using Applet.
import java.applet.Applet;
import java.awt.Graphics;
/*
<applet code="FactorialApplet" width="300" height="100">
</applet>
*/
public class FactorialApplet extends Applet {
@Override
public void paint(Graphics g) {
int number = 5; // Example number
g.drawString("Factorial of " + number + " is: " + factorial(number), 20, 50);
}
private int factorial(int n) {
if (n == 0) return 1;
return n * factorial(n - 1);
}}
8. c) Write a program for passing parameters using Applet.
import java.applet.Applet;
import java.awt.Graphics;
/*
<applet code="ParamApplet" width="300" height="100">
<param name="message" value="Default message">
</applet>
*/
public class ParamApplet extends Applet {
private String message;
@Override
if (message == null) {
message = "No message provided";
}}
@Override
public void paint(Graphics g) {
g.drawString(message, 50, 50);
}}
57
23100030031 Java Training Report
9.a) Write a program to describe AWT Class, Frames, Panels and Drawing.
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public AWTExample() {
setTitle("AWT Example");
setSize(400, 300);
setLayout(new BorderLayout());
addWindowListener(new WindowAdapter() {
});
add(panel, BorderLayout.CENTER);
add(new Canvas() {
g.setColor(Color.RED);
g.setColor(Color.BLUE);
}, BorderLayout.SOUTH);
new AWTExample().setVisible(true);
58
23100030031 Java Training Report
}
9.b) Write a Java program that works as a simple calculator. Use a grid layout
to arrange buttons for the digits and for the, -,*, % operations. Add a text field
to display the result. Handle any possible exceptions like divided by zero.
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public Calculator() {
setTitle("Calculator");
setSize(400, 500);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLayout(new BorderLayout());
add(display, BorderLayout.NORTH);
String[] buttons = { "7", "8", "9", "/", "4", "5", "6", "*", "1", "2", "3", "-", "C", "0", "=", "+" };
button.addActionListener(this);
panel.add(button);
add(panel, BorderLayout.CENTER);
59
23100030031 Java Training Report
public void actionPerformed(ActionEvent e) {
if ("0123456789".contains(command)) {
currentInput.append(command);
display.setText(currentInput.toString());
} else if (command.equals("C")) {
currentInput.setLength(0);
display.setText("");
result = 0;
operator = "";
} else if (command.equals("=")) {
try {
switch (operator) {
display.setText(String.valueOf(result));
currentInput.setLength(0);
display.setText("Error");
} else {
if (currentInput.length() > 0) {
result = Double.parseDouble(currentInput.toString());
currentInput.setLength(0);
60
23100030031 Java Training Report
}
operator = command;
61
23100030031 Java Training Report
10.Write a program to demonstrate JDBC and build an application.
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
try {
Class.forName("com.mysql.cj.jdbc.Driver");
// Create a statement
statement = connection.createStatement();
// Execute a query
resultSet = statement.executeQuery(sql);
62
23100030031 Java Training Report
// Process the result set
while (resultSet.next()) {
int id = resultSet.getInt("id");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
System.out.println("SQL Exception.");
e.printStackTrace();
} finally {
// Clean up resources
try {
} catch (SQLException e) {
e.printStackTrace();
63
23100030031 Java Training Report