0% found this document useful (0 votes)
25 views22 pages

Iconic Simran Sahu

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

Iconic Simran Sahu

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

SIMRAN SAHU - XII (IT-802) IOAVAMS

Acknowledgement

I would like to express my sincere gratitude to my IT teachers for their invaluable support,
guidance, and encouragement throughout the completion of this project. Their constant
assistance and insightful advice have played a pivotal role in shaping the success of this project.

I would also like to extend my heartfelt thanks to my parents for their support, love, and
encouragement. Their constant belief in my abilities has been a source of inspiration and
motivation.

Additionally, I would like to convey my appreciation to my friends for their continuous interest
and encouragement, which inspired me to persevere and complete this project with dedication.

This project would not have been possible without the collective support of all those mentioned
above, and I am truly grateful for each of their contributions.
SIMRAN SAHU - XII (IT-802) IOAVAMS

Certificate

This is to certify that I, Simran Sahu, of class XII of Odisha Adarsha Vidyalaya, Govandapur,
Bargarh, has successfully completed the Project on “IOAVAMS -Iconic Odisha Adarsha
Vidyalaya Admission Management System” as prescribed by the Central Board of
Secondary Education (CBSE) for the academic year 2024-25.
.

Principal’s Signature:

External Examiner’s Signature: Internal Examiner’s Signature:


SIMRAN SAHU - XII (IT-802) IOAVAMS

Contents
1 Introduction 4
1.1 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Expected Outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Significance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.6 Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.7 Understanding the Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.8 Brainstorming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.9 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.10 Solution Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.11 Prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Database Schema Design 6

3 User Interface (UI) Design 7

4 Java Code Implementation 8


4.1 Main Class and GUI Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 GUI and Backend Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.3 Panels for User Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5 Database Schema 18
5.1 Tables ................................................................................................................................... 18

6 Outputs 19

7 References 21
ABHIJIT SETHI - XII (IT-802) IOAVAMS

1 Introduction

The Iconic OAV Admission Management System (IOAVAMS) is designed to automate and
streamline the admission process for Iconic Odisha Adarsha Vidyalaya, an esteemed insti- tution
nurturing 500 of Odisha’s brightest minds annually. Currently, the admission process is manual,
involving pen-and-paper methods prone to inefficiencies, errors, and delays.

1.1 Problem Statement


The manual admission process at Iconic Odisha Adarsha Vidyalaya is time-consuming, error-
prone, and inefficient. The lack of a centralized system leads to challenges in data management and
retrieval.

1.2 Goals
• Replace the manual admission process with an automated online system.
• Ensure accurate and secure data handling.
• Simplify the workflow for both students and administrators.

1.3 Expected Outcomes


• Streamlined and error-free admission process.
• Automated generation of registration numbers and hostel allocations.
• Improved user experience through an intuitive GUI.

1.4 Significance
The manual system creates challenges such as:
• Increased administrative workload.
• Errors in data handling and allocation.
• Errors in generating results like registration numbers and hostel room allotments.
By introducing IOAVAMS, the institution aims to:
• Reduce manual errors and increase accuracy.
• Ensure efficient data storage and retrieval using a centralized database.
• Provide a user-friendly interface for data input and management.

1.5 Objectives
The project’s objectives include:
• Automating the student registration process.
• Generating unique registration numbers and allocating hostel rooms.
• Providing an intuitive graphical user interface (GUI).

4
ABHIJIT SETHI - XII (IT-802) IOAVAMS

1.6 Preparation
The initial phase involved identifying the need for a digital admission management system and
gathering input from stakeholders, including school administrators, staff, and students.

1.7 Understanding the Users


This phase focused on analyzing the users’ needs:

• Students: A seamless interface for entering personal, academic, and banking details.

• Administrators: Tools for managing registrations, hostel allocations, and database updates.

1.8 Brainstorming
Key functionalities were brainstormed, including:

• Collecting student details in a structured format.

• Allocating hostel rooms and generating unique registration numbers.

• Integrating with a database for secure storage and retrieval.

1.9 Design
The design phase involved creating UI mockups and database schemas to visualize the system’s
workflow.

1.10 Solution Development


Using Java Swing for the frontend and MySQL for the backend, the system was developed in a
modular format, ensuring scalability and flexibility.

1.11 Prototype
A functional prototype was built to test the system’s usability and ensure the correct flow of
data between the GUI and the database.

5
ABHIJIT SETHI - XII (IT-802) IOAVAMS

2 Database Schema Design


The database schema is designed to store and manage data efficiently. Key tables include:

• Basic Information: Collects details like name, roll number, gender, caste, marks, etc.

• Personal Details: Captures information about parents, guardians, address, and medical
history.

• Bank Details: Records banking information, including account number and IFSC code.

• Marks and Stream Choices: Gathers information about academic preferences and
electives.

Figure 1: Database ER Diagram

6
ABHIJIT SETHI - XII (IT-802) IOAVAMS

3 User Interface (UI) Design


The system comprises four tabs, each dedicated to a specific set of inputs:

Figure 2: Basic Information Tab UI Figure 3: Personal Details Tab UI

Figure 5: Academic and SUBMIT UI


Figure 4: Bank Details Tab UI

7
ABHIJIT SETHI - XII (IT-802) IOAVAMS

4 Java Code Implementation


The following code forms the backbone of the IOAVAMS project, implementing the GUI, backend
logic, and database connectivity.

4.1 Main Class and GUI Initialization


1 // Main class starts here
2 package com . mycompany . i oavams;
3
4 import javax. swing .*;
5 import java. awt .*;
6 import java. sql .*;
7

8 public class IOAVAM S {


9 public s tatic void main ( String [] args) {
10 new Admi ss ion Ma na ge mentGUI (),
11 }
12 }

Listing 1: Main Class and GUI Setup

4.2 GUI and Backend Logic


1

3
4

10
11

12
13

14

15

16
17

18
19

20
21

22

23

24
25

26
27

28

29
30

8
ABHIJIT SETHI - XII (IT-802) IOAVAMS

31

32

33
34

35
36

37

38
39

40

41
42

43
44

45

Listing 2: Admission Management GUI Design and Backend Logic

4.3 Panels for User Input


Each tab in the GUI is represented by a panel collecting specific information.
1
2

3
4

6
7

9
10

11

12
13

14
15

16
17

18

19

20
21

22
23

24

25
26

27

28
29

30
31

32

33
34

35

36

37

38

39

9
ABHIJIT SETHI - XII (IT-802) IOAVAMS

40

41

42
43

44
45

46

47
48

49

50
51

52
53

54

55
56

57

58
59

60

61

62
63

64

Listing 3: Basic Information Panel

5
6

7
8

10
11

12

13
14

15

16
17

18
19

20

21
22

23

24
25

26
27

28

29
30

31

32
33

10
ABHIJIT SETHI - XII (IT-802) IOAVAMS

34 gua rd ia n Name Fi eld = new J Text Field (15);


35 pan el. add ( gu ard ian Name Field , gbc);
36
37 gbc. gridx = 0; gbc. gridy = 5;
38 pa nel. add ( new JL ab el( " G uardian ’s Co nt a ct :"), gbc);
39 gbc. gridx = 1;
40 gu ar dian Co n ta ct Fiel d = new J Te xtFie ld (1 0);
41 pa nel. add ( g ua rdi an Co nta ctF iel d , gbc);
42

43 gbc. gri dx = 0; g bc. gridy = 6;


44 pa nel. add ( new J L ab el( " A dd r e s s : "), gbc);
45 gbc. gridx = 1;
46 a ddres s Ar ea = new JTex tArea (3 , 20);
47 pa nel. add ( new J S cro llP a n e ( a ddres s Ar ea ), gbc);
48

49 gbc. gridx = 0; gbc. gridy = 7;


50 pa nel. add ( new J L ab el( " M edical De ta i ls :" ), gb c);
51 gbc. gridx = 1;
52 m e d ica lAr ea = new J Text Ar ea (3 , 20);
53 panel. add ( new J Scr o ll Pane ( m e dic alA r e a ), gb c);
54

55 // Navi gat ion Buttons


56 gbc. gridx = 0; gbc. gridy = 8;
57 pr ev Butt o n = new J Button (" Pr ev i ous ");
58 prev Butto n . add Actio n Listene r ( e -> t abs. se t Sel ect e d Index ( tabs.
get Sel ect ed Index () - 1));
59 save Button = new JButton (" Save ");
60 save Butto n . add Actio n Listen e r ( e - > save P er s o na lD et ails ());
61 next Butt on = new JButton (" N ext");
62 next But ton . add Action Listener ( e -> tabs. set Selec t ed In dex ( tabs.
ge t Se le ct ed Ind ex () + 1));
63

64 JPanel button Panel = new JPan el( new Flow Lay ou t ());
65 button Pa nel . add ( prevButton );
66 button Pa nel. add ( save Button );
67 button Pa n el. add ( nextButton );
68

69 gbc. gridx = 0; gbc. gridy = 9;


70 gbc. gri dwid th = 2;
71 pan el. add ( button Panel , gbc);
72

73 return panel;
74 }

Listing 4: Personal Details Panel

1 private J Panel cre ate Bank Det ails P an e l () {


2 JPanel panel = new JPan el( new Grid Bag Layout ());
3 Grid Bag C on st rai nt s gbc = new Grid Bag Co nst rain ts ();
4 gbc. insets = new Insets (10 , 10 , 10 , 10);
5 gbc. fill = Grid Bag C on str aints . H ORIZON TA L;
6

7 // Accoun t H older Name


8 gbc. gridx = 0; gbc. gridy = 0;
9 pa nel. add ( new J L ab el( " Account H older Name :"), gbc);
10 gbc. gridx = 1;
11 ac c ou n tH old e rField = new J Text Field (15); // Adjusted width
12 pan el. add ( ac c ou n tH o lde rFi eld , gbc);
13

14 // Relatio n to Student
15 gbc. gridx = 0; gbc. gridy = 1;
16 pa nel. add ( new JL ab el( " R elation to S t u d en t :" ), gbc);

11
ABHIJIT SETHI - XII (IT-802) IOAVAMS

17 gbc. gridx = 1;
18 rela tion Field = new JText Field (15); // A djusted width
19 panel. add ( relation Field , gbc);
20

21 // Account Number
22 gbc. gridx = 0; gbc. gridy = 2;
23 pan el. add ( new JLabel(" Accoun t N u mb er:"), gbc);
24 gbc. gridx = 1;
25 a ccountNo Field = new JTex tField (15); // Adjust ed width
26 panel. add ( accountNo Field , gbc);
27

28 // IFSC Code
29 gbc. gri dx = 0; gbc. gridy = 3;
30 pa nel. add ( new J L ab el(" IFSC Code :"), gb c);
31 gbc. gridx = 1;
32 ifs cField = new J TextField (10 ); // Adjusted width
33 pa nel. add ( ifscField , gbc);
34
35 // Branch Name
36 gbc. gridx = 0; gbc. gridy = 4;
37 pa nel. add ( new J L ab el(" Branch Name : "), gbc);
38 gbc. gridx = 1;
39 branch Name Field = new JTex tField (15); // Adjust ed width
40 panel. add ( branch Name Field , gbc);
41

42 // Navi gat ion Buttons


43 gbc. gridx = 0; gbc. gridy = 5;
44 pr ev Butt o n = new J Button (" Pr ev i ous ");
45 prev Butto n . add Actio n Listene r ( e -> t abs. se t Sel ect e d Index ( tabs.
ge tS el e ct ed I ndex () - 1));
46 pa nel. add ( prev Button , gbc);
47
48 gbc. gridx = 1; gbc. gridy = 5;
49 next But ton = new JB utton (" N ext ");
50 ne xtButt on . add Act ion Listen er ( e -> tabs. s e t Se le cte d Index ( tabs .
ge tS el e ct ed I ndex () + 1 ));
51 pan el. add ( next Button , gbc);
52

53 // Save Button
54 gbc. gridx = 0; gbc. gridy = 6;
55 gbc. gri dwid th = 2;
56 save Butto n = new J Button (" Save ");
57 save Bu tton . add Action Listener ( e -> save Bank Deta il s ()); // Add save button
action
58 pan el. add ( sav eButton , gbc);
59

60 return panel;
61 }

Listing 5: Account Information Panel

Academic Information Panel:


1 privat e JPane l cre at e A ca d e m ic D e t ai ls P an e l () {
2 // Stream Choice Drop down with an " Oth er" option
3 JComboBox <String > strea m Choice Dro pdown = new JComb o Box <>( new String []{"
J EE", " NEET ", " CLAT ", " NDA ", " Oth er "}) ;
4 J TextFi eld o the rS t rea m Field = new J T extFi eld (15); // To s pecify " Ot her "
strea m if selected
5 ot h e r Str ea m Field . s et Visible ( false ); // Hide initially
6

7 stream Choice Dro pdown . add Action Lis ten e r ( e -> {

12
ABHIJIT SETHI - XII (IT-802) IOAVAMS

8 if ( s tream Choice D rop do wn . ge tS ele ct e d Item (). eq u als (" Ot her ")) {
9 ot h e rSt re am Field . se tVisible ( true );
10 } else {
11 ot h er Str e am Field . s etV isibl e ( false );
12 }
13 });
14

15 // Academic Choice : Bio and Math ch eckboxes


16 bio CheckBox = new JChe ck Box(" Biology");
17 math CheckBox = new JChe ck Bo x(" Mat hematics ");
18

19 // E le ctives Dropd own


20 JComboBox <Stri ng > el ectiv e Box = new JCombo Box <>( new String []{" I T", "
Phys ica l E duca tion ", " Pa inting "});
21

22 // Create the panel with Grid Bag Layout


23 JPan el panel = new JPan el( new Grid Bag Layout ());
24 Grid Bag C on str ai nt s gbc = new Grid Bag C o ns tr ai n ts ();
25 gbc. insets = new Insets (10 , 10 , 10 , 10);
26 gbc. fill = Gr id Bag Co nstr aints . H ORIZON TAL;
27

28 // Stream Choice
29 gbc. gridx = 0;
30 gbc. gridy = 0;
31 panel. add ( new J Lab e l(" Stream Ch oice :"), gbc);
32 gbc. gridx = 1;
33 panel. add ( stream Choice Drop down , gbc);
34 gbc. gridx = 2;
35 p an el. add ( othe rSt ream Field , gbc);
36

37 // Academic Sub jects ( Bio and Math )


38 gbc. gridx = 0;
39 gbc. gridy = 1;
40 pa nel. add ( new JL ab el( " Choose Academic S ub j ect s : " ), gbc);
41 gbc. gridx = 1;
42 panel. add ( bio CheckBox , gbc);
43 gbc. gridx = 2;
44 panel. add ( math CheckBo x , gbc);
45

46 // Electives ( Visible only if one subject is selected )


47 gbc. gridx = 0;
48 gbc. gridy = 2;
49 panel. add ( new JLab el(" Elective Subjects ( Choose one if only one optional
is select ed ):"), gbc);
50 gbc. gridx = 1;
51 panel. add ( elect iv eB ox , gbc);
52

53 // Sub mit Button


54 gbc. gridx = 0;
55 gbc. gridy = 3;
56 s ubmitB utt on = new JButton (" Submit");
57 s ubmitB utt on . add Acti on Li sten er ( e -> handle Submit ( s trea m Choice Dropdo wn ,
ot her St rea m Field , ele ctive Box )); // Pass d ropd own and text field to
handle Submit
58 p an el. add ( submitBu tton , gbc);
59

60 // Hostel and Bed A llot m en t Details


61 ho st el R oo m Label = new JLabel( " To be A ll ocated ");
62 bed No Label = new J L ab el(" To be A llo cat ed ");
63 s ect ion Label = new J L ab el(" To be Allo ca ted ");
64

65 hos t el Roo m Label . s e tH o ri zont al Ali gn men t ( Swing Constan ts . LEFT );


13
ABHIJIT SETHI - XII (IT-802) IOAVAMS

66 bed No L ab el. s et H or i zo nt a l Ali gn me nt ( Swing Cons ta nts . LEFT );


67 section Label . s et H or iz o n t alA l i gn m en t ( Swin g Consta nt s . LEFT );
68
69 // Hostel and Bed In f or m at ion
70 gbc. gridx = 0;
71 gbc. gridy = 4;
72 pa nel. add ( new JL ab el( " H ostel Room :"), gbc);
73 gbc. gridx = 1;
74 panel. add ( hos telRoom Label , gbc);
75

76 gbc. gridx = 0;
77 gbc. gridy = 5;
78 pan el. add ( new JLabel(" Bed Nu mb er :"), gbc);
79 gbc. gridx = 1;
80 panel. add ( bed No Label , gbc);
81

82 gbc. gridx = 0;
83 gbc. gridy = 6;
84 pa nel. add ( new J L ab el(" Section :"), gbc);
85 gbc. gridx = 1;
86 panel. add ( se ction Label , gbc);
87

88 // Save Button
89 gbc. gridx = 0;
90 gbc. gridy = 7;
91 gbc. gri dwid th = 2;
92 save Butto n = new J Button (" Save ");
93 save Button . add Action Lis tene r ( e - > s ave Ac a d emi c De t ails (
stream Choice Dro pd ow n , otherStream Field , elective Box)) ;
94 pa nel. add ( sav eButto n , gbc);
95

96 return panel;
97 }

Listing 6: Basic Information Panel

Back End Operations:


1 private void co nn e ct To Database () {
2 try {
3 conn = D riv er Ma n ag er . get Co nn ec t ion (" jdbc: mysql :// localh os t :3306/
io av a ms ", " r oot ", "");
4 } catch ( SQ LE xcept i o n e) {
5 J Option Pane . s how Me ss age Dialog ( this , " Database Connection Failed :
" + e. getM es sa ge ());
6 }
7 }
8 private void s av e Ba sicIn fo () {
9 try {
10 // SQL query to insert basic details
11 Strin g sql = " IN SERT INTO s t u de n t_ b as i c_d e t a ils ( name , gender , caste ,
bo ar d _rol l_n o , marks , s ln _in _ m er it _ lis t ) " +
12 " VALUES (?, ?, ?, ?, ?, ?)";
13

14 Prep ared Sta te ment pst = conn . prepare Sta tement ( sql);
15 pst. s et String (1 , name Field . get Text ()); // Name
16 pst. s etS tr in g (2 , ( St rin g ) g en d er B o x. g e tS el ecte d It em ()); // Gender
17 pst. s et String (3 , ( String ) caste Box. getS el ect ed It em ()); // Caste
18 pst. setS tring (4 , b oard R oll Field . getTex t ()); // Board Roll No
19 pst. setInt (5 , I nt eg e r. pars e I nt( m ark sF ield . g etText ())); // Marks (
co nv er ted to int)

14
ABHIJIT SETHI - XII (IT-802) IOAVAMS

20 pst. setInt (6 , Intege r. parse In t( sln Field . getText ())); // SLN in Merit
List ( conv ert ed to int)
21

22 int row sA ffec t ed = p st. execu te Update ();


23 if ( row s Affect ed > 0) {
24 J Option Pane . show M essag e Dialog ( this , " Basic d etails saved
successful ly !");
25 } else {
26 J Option Pane . show M essag e Dialog ( this , " Error s aving basic det ails."
);
27 }
28 } catch ( S QL E xc ept io n e) {
29 JOption Pane . show M essage Dial og ( this , " Datab as e E rror: " + e. getM ess age
());
30 } catch ( N u mb e rF o rm at E x c ep tio n e) {
31 JOption Pane . show M essage Dial og ( this , " Invalid nu mber format in marks
or SLN field .");
32 }
33 }
34 priv a te void sav e P e rs on a lD eta ils () {
35 try {
36 String sql = " IN SE RT INTO s tu d en t _p er s on al_d et a ils ( st ud ent_ id ,
fath er_na me , mother_name , fa ther_aa dhaar , mother_aa dha ar , address ,
gu ardian _n ame , gu ard ian _cont act , medical_ d et ail s ) " +
37 " VAL UES (( SELECT MAX ( stud en t_id ) FROM
st u de n t_b a si c_de t a il s ), ?, ?, ?, ?, ?, ?, ?, ?)";
38 Prep ared State ment pst = conn . prep are Sta tement ( sql);
39 pst. se tStr ing (1 , fat h e rN a m e Field . getTe xt ());
40 pst. s et String (2 , mot he rN a me Fi eld . getText ());
41 pst. se tStr ing (3 , fath er Aa d h aar Fiel d . getText ());
42 pst. setStrin g (4 , mo th erA ad h aa rField . getText ());
43 pst. se tStr ing (5 , ad d ress A re a . get Te xt ());
44 pst. se tStr in g (6 , gu ar dian Name Field . getText ());
45 pst. se tStr in g (7 , guar dian Co nt act F ie ld . getTe xt ());
46 pst. se tStr ing (8 , me d ica lA re a . get Te xt ());
47

48 int row sA ffec t ed = p st. execu te Update ();


49 if ( row s Affect ed > 0) {
50 JOp ti on Pane . show M essag e Dialog ( this , " Person al d etails saved
succ essfully !");
51 } else {
52 JOp ti on Pane . show M essag e Dialo g ( this , " Error saving person al
details.");
53 }
54 } catch ( S QL E xc ept io n e) {
55 JOption Pane . show M essage Dial og ( this , " Datab as e E rror: " + e. getM ess age
());
56 }
57 }
58 privat e void save Ba nk D et a ils () {
59 try {
60 // SQL query to insert bank details
61 String sql = " IN SE RT INTO s t u d e n t _ b an k _ de t ail s ( st ude nt _id ,
ac c ou n t_ h old e r_ n am e , relati on _ to_st ud en t , accoun t_n o , ifsc _code ,
bra n ch_ na me ) " +
62 " VAL UES (( SELECT MAX ( stud en t_id ) FROM
st u de nt _b asic_d et ails ), ?, ?, ?, ?, ?)";
63

64 Prep ared State ment pst = conn . prep are Sta tement ( sql);
65 pst. s etSt rin g (1 , accoun tH old erField . getText ()); // Accou nt Holder
Name
66 pst. s etSt rin g (2 , relation Field . g etText ()); // Relation to Student

15
ABHIJIT SETHI - XII (IT-802) IOAVAMS

67 pst. se tStr in g (3 , acc ou ntN o Field . get Text ()); // Account Number
68 pst. setString (4 , ifscField . getText ()); // IFSC Code
69 pst. s et St ring (5 , branch Name Fi eld . g et Text ()); // Branch Name
70

71 int row sA ffec t ed = p st. execu te Update ();


72 if ( row s Affect ed > 0) {
73 JOp ti on Pane . show M essag e Dialog ( this , " Bank detai ls saved
successful ly !");
74 } else {
75 JOp ti on Pane . show M essag e Dialog ( this , " Error saving bank d et ails. ")
;
76 }
77 } catch ( S QL E xc ept io n e) {
78 JOption Pane . show M essage Dial og ( this , " Datab as e E rror: " + e. getM ess age
());
79 }
80 }
81 priva te void save A ca de m icDe tails ( JCombo Box <String > strea m Choice Dropdo wn ,
JT extF ield ot h erStr ea m Field , JCombo Box <String > e lect iv e Bo x) {
82 try {
83 String strea m Choice = st ream Choice Drop d own . g et Sel ec t ed Item (). to Stri ng
();
84 String electiv e = electi v e B ox. g et S el ect ed Item (). to St ring ();
85

86 // If " Other" is selected , use the text from ot h erS t r ea m Field


87 if ( str eam Ch oice . eq uals(" Ot he r ")) {
88 stream Choice = ot h e rS t re am Fiel d . getText ();
89 }
90

91 // Get the select ed subjects ( Bio / Math ) if they are checked


92 St rin g Bu ilde r se le cted Su b ject s = new Str ing Build er ();
93 if ( bio Ch e ck Bo x. is S ele ct ed ()) {
94 se lected Subj ects . ap pend (" Bio logy , ");
95 }
96 if ( math C he ck Bo x . i s Se lected ()) {
97 s elected Subjects . append (" Mathematics , ");
98 }
99 // Remove the trailing comma and space if any
100 if ( s elect ed S ubj ect s . length () > 0) {
101 se lected Subje cts . se tLe ngth ( se lect ed Su bject s . lengt h () - 2);
102 }
103

104 // SQL query to insert acad emic details


105 String sql = " IN SE RT INTO s t u de n t_ aca d e mic _ d et ails ( st ud ent_ id ,
st ream_choice , electiv e ) " +
106 " VAL UES (( SELECT MAX ( stud en t_id ) FROM
s t ud en t _ b as ic _ d e ta i ls ), ?, ?)";
107

108 Prep ared State ment pst = conn . prep are Sta tement ( sql);
109 pst. se tStr ing (1 , s tre am Choice );
110 pst. s etSt rin g (2 , elective );
111

112 int row sA ffec t ed = p st. execu te Update ();


113 if ( row s Affect ed > 0) {
114 JOp ti on Pane . show M essag e Dialog ( this , " Acad emic d et ails saved
successful ly !");
115 } else {
116 JOption Pane . show Mess age Dialog ( this , " Error s aving academic
d etails .");
117 }
118 } catch ( S Q LE xc ept i on e) {

16
ABHIJIT SETHI - XII (IT-802) IOAVAMS

119 JOption Pane . show Mess age Dialog ( this , " Database Error: " + e. getMessage
());
120 }
121 }
122 priva te void handle Submit ( JCombo Box <String > strea m Choice Dr opdown , JTextField
oth e rStre am Field , JCombo Box <String > electiv e Box) {
123 // Get the s electe d stream
124 Strin g selected Stream = ( String ) s tream Ch oice D rop do wn . ge tS el ec ted Item ();
125

126 // If " Other" is selected , check the ot her St rea m Field for input
127 Strin g stream Choice ;
128 if ( se lected Str ea m . e qu als(" Oth er ")) {
129 stream Choice = oth erSt ream Field . getText ();
130 System . ou t. prin tln (" Sel ect ed Other Stream : " + stream Choi ce );
131 } else {
132 stream Choice = sele cte d Strea m ;
133 System . out. println (" Selecte d Stream : " + stre am Cho ice );
134 }
135 // Get the selected electiv e
136 String e lecti v e Cho ice = ( String ) elec tiv e Box. ge tS el e ct ed Item ();
137 System . out. println (" Selected Elective : " + elect ive Ch oice );
138

139

140 save Aca de micDetai ls ( strea m Choice Dropdo wn , otherStrea m Field , elective Box );
141 }

Listing 7: Methods for Backend Operations

17
ABHIJIT SETHI - XII (IT-802) IOAVAMS

5 Database Schema
The MySQL database schema includes tables for storing student, hostel, and coaching details.

5.1 Tables
1 CREATE DATABASE IOAVAMS ;
2

3 USE IOAVA M S ;
4

5 -- Table for basic st udent details


6 CREATE TABLE s tu d e n t_ ba s ic _ d e tai ls (
7 s tudent_id INT AUTO_I NCRE MENT PRIMARY KEY ,
8 name VARCHAR (100) ,
9 gender VARCHAR (10) ,
10 caste VARCHAR (20) ,
11 board _ro ll_no VARCHAR (20) ,
12 marks INT ,
13 sl n_ in _ m e rit _li s t INT
14 );
15

16 -- Table for personal details


17 CREATE TABLE s tu den t_p er s ona l _de t ai ls (
18 personal_id INT AU TO _INC REMENT PRIMARY KEY ,
19 stud en t_id INT ,
20 fath er_na m e VARCHAR (100) ,
21 mother_na me VARCHAR (100) ,
22 fat her_aa dhaar VARCHAR (12) ,
23 mo ther_aadhaar VARCHAR (12) ,
24 address TEXT ,
25 guardian _na me VARCHAR (100) ,
26 gu ardian _co nta ct VARCHAR (15) ,
27 medi c al _de tails TEXT ,
28 FOREIGN KEY ( s tu dent_id ) REFE REN CE S s tu den t_ ba s i c _d eta ils ( s tudent_i d )
29 );
30

31 -- Table for bank details


32 CREATE TABLE s t ud ent _b a nk _d eta ils (
33 bank_id INT A UTO _IN CREMENT PRIMARY KEY ,
34 stud en t_id INT ,
35 a cc ount_h ol der _na me VARCHAR (100) ,
36 r ela ti o n_ to _s tud en t VARCHAR (50) ,
37 acc ount_no VARCH AR (20) ,
38 ifsc_code VARCHAR (20) ,
39 branch_name VARCHAR (50) ,
40 FOREIGN KEY ( s tu dent_id ) REFE REN CE S s tu den t_ ba s i c _d eta ils ( s tudent_i d )
41 );
42

43 -- Table for acade mic and hostel details


44 CREATE TABLE s t ud en t_a ca de mic_ d et a ils (
45 aca de mic _id INT AUTO _INC REMENT PRIMARY KEY ,
46 stud en t_id INT ,
47 st rea m_ch oi ce VARCHAR (50) ,
48 elective VARCHAR (50) ,
49 FOREIGN KEY ( s tu dent_id ) REFE REN CE S s tu den t_ ba s i c _d eta ils ( s tudent_i d )
50 );

Listing 8: tables in Database

18
ABHIJIT SETHI - XII (IT-802) IOAVAMS

6 Output

Listing 9: Saving Basic information

Listing 10: Saving Personal Information

19
ABHIJIT SETHI - XII (IT-802) IOAVAMS

Listing 11: Saving Bank Details

Listing 12: Saving Academic Information

20
ABHIJIT SETHI - XII (IT-802) IOAVAMS

7 References
• Information Technology: By Ruturaj Barik

• Java Swing Documentation: https://docs.oracle.com/javase/7/docs/api/javax/


swing/package-summary.html

• MySQL Documentation: https://dev.mysql.com/doc/

• Design Patterns for GUI: Head First Design Patterns, O’Reilly Media.

• Stack Overflow: A community-driven Q&A platform for coding-related queries. https:


//stackoverflow.com/

• NetBeans Documentation: A powerful IDE for Java development. https://netbeans.


apache.org/kb/

• WAMP Server Documentation: A guide for using WAMP for web development.
https://www.wampserver.com/en/

• MySQL Workbench Manual: A comprehensive guide for MySQL Workbench. https:


//dev.mysql.com/doc/workbench/en/
• GeeksforGeeks - Java Programming: Tutorials and examples for learning Java con-
cepts. https://www.geeksforgeeks.org/java/

• TutorialsPoint - Java: A beginner-friendly tutorial for Java programming. https:


//www.tutorialspoint.com/java/

21

You might also like