Aut Onomousi NST I T Ut I Onaf F I L I at Edt Ovtu, Bel Agavi
Aut Onomousi NST I T Ut I Onaf F I L I at Edt Ovtu, Bel Agavi
Aut Onomousi NST I T Ut I Onaf F I L I at Edt Ovtu, Bel Agavi
V.COLLEGEOFENGI NEERI
NG
BENGALURU–560059
(
Aut
onomousI
nst
it
uti
onAf
fi
li
atedt
oVTU,Bel
agav
i)
DEPARTMENTOFCOMPUTERSCI
ENCEANDENGI
NEERI
NG
“
STUDENTI ONMANAGEMENTSYSTEM”
NFORMATI
MI
NI-
PROJECTREPORT
OBJECTORI
ENTEDPROGRAMMINGUSINGJAVA(
16CS44)
I
VSEMESTER
2017-
2018
Submi
tt
edby
SAKSHAM LAKHERA(
1RV16CS125)
SALEEM (
1RV16CS126)
Undert
heGui
danceof
MANONMANIS
Depar
tmentofCSE,R.V.
C.E.
,
Benagal
uru-560059
R.
V.COLLEGEOFENGINEERI
NG, BENGALURU-560059
(Aut
onomousI
nsti
tut
ionAffi
l
iat
edtoVTU,Bel
agav
i)
DEPARTMENTOFCOMPUTERSCI
ENCEANDENGI
NEERI
NG
CERTI
FICATE
Cert
if
iedthattheMi ni-
projectwor kti
tl
edSTUDENTI NFORMATI ONMANAGEMENT
SYSTEM hasbeencar ri
edoutby SAKSHAM LAKHERA( 1RV16CS125) ,SALEEM
(1RV16CS126) ,bonaf idest udentsofR. V.Coll
egeofEngineering,Bengaluru,have
submi t
tedinparti
al f
ulfi
lmentf ortheAssessmentofCour se:OBJECTORI ENTED
PROGRAMMI NGUSI NGJAVA( 16CS44)– Open- EndedExper i
ment sduringthey ear
2017-2018.Iti
scer t
if
iedt hatallcorr
ecti
ons/suggesti
onsindicatedfortheinternal
assessmenthav ebeenincorporat
edinther eport.
MANONMANIS Dr.G.SHOBHA
Depart
mentofCSE,R.
V.C.
E., HeadofDepart
ment,
Benagal
uru–560059 Depar
tmentofCSE,R.
V.C.
E
Bengalur
u–560059
R.
V.COLLEGEOFENGINEERING,
BENGALURU-560059
(AutonomousI
nst
it
uti
onAffi
l
iat
edt
oVTU)
DEPARTMENTOFCOMPUTERSCI
ENCEANDENGI
NEERI
NG
DECLARATI
ON
Pl
ace:
Bengal
uru <SAKSHAM LAKHERA> Si
gnat
ure
Dat
e: <SALEEM> Si
gnat
ure
Cont
ent
s
1.
Int
roduct i
on
1.
1Obj ectOrientedConcepts
1.
2Ov erview
1.
2.1Col l
ecti
onFr amework
1.
2.2LambdaExpr essions
1.
2.3Jav aFXf r
amewor k
1.
2.4JDBC
1.
2.5JSP
1.
3Pr oposedSy stem
1.
3.1Obj ect
iveoft heProj
ect
1.
3.2Met hodology
1.
3.3Scope
2.RequiredSpecifi
cat
ions
2.1Softwar eRequi
rements
3.System DesignandImplementati
on
3.1Modul arDescri
pti
on/Pseudo-
code
4.Result
sandSnapshot sandcode
5.Conclusion
6.Bi
bli
ogr aphy
. I
I ntr
oduct
ion
Themi
nipr
ojectunder
takenseekst
oimpl
ementt
heconcept
sofJav
ataughtdur
ing
t
her
egul
arcour
sebydev
elopi
ng2separ
atest
andal
oneappl
i
cat
ions.
Thef
ir
stst
andal
oneappl
i
cat
ioni
sasi
mpl
e“l
i
brar
ymanagementsy
stem”whi
ch
i
ncor
por
atesJav
aconcept
ssuchasLambdaExpr
essi
ons,
Col
l
ect
ionf
ramewor
k
whi
chi
ncl
udesl
i
sts,
dict
ionar
yandhasht
abl
e,andJav
aFXf
ramewor
kfor
dev
elopi
nganeatUserI
nter
face-enabl
i
ngt
heusert
oper
for
m oper
ati
onswi
thout
r
equi
ri
ngt
heknowl
edgeast
ohowt
hebackend(
i.
e.howt
hecomput
ati
onsar
e
per
for
med)wor
ks.Thi
sappl
i
cat
ionpr
ovi
desbasi
cmat
hemat
ical
oper
ati
onssuchas
addi
ti
on,
mul
ti
pli
cat
ion,
subt
ract
ionanddi
vi
sionknowl
edgeofv
ect
ors,
arr
ayl
i
stand
wr
it
ingt
oaf
il
e.
Thesecondst
andal
oneappl
i
cat
ionmakesuseofJav
aSer
verPages(
JSP)t
opr
ovi
de
ar
eal
timef
eel
oft
hesy
stem f
orbot
hcl
i
entandser
versi
de,
iti
san“
ency
clopedi
a”
t
odemonst
rat
ewhathasbeent
old.Thedat
aisst
oredbyt
hei
mpl
ement
ati
onof
JDBC(
Jav
aDat
abaseConcept
s)t
hrought
heusageofSQL(
Str
uct
uredQuer
y
Language)
.SQLhasbeenusedf
orr
equest
ingt
hei
nfor
mat
ionf
rom t
hedat
abase,
as
wel
lasf
orper
for
mingupdat
ionoper
ati
ons.
Atpr
esentbot
hthest
andal
oneappl
i
cat
ionsar
eint
hei
rrudi
ment
aryf
orm andt
her
e
i
sscopef
orscal
i
ngt
hesest
andal
oneappl
i
cat
ionsi
nabi
gway
,possi
blychal
l
engi
ng
exi
sti
ngsy
stemsi
npl
ace.
1.
1OBJECTORI
ENTEDCONCEPTS
OOP isadesi gnphi losophy .I
tstandsf orObj ectOri
entedPr ogrammi ng.
Object
-
Ori
ented Programmi ng( OOP)usesadi ff
erentsetofpr ogrammi nglanguagest han
ol
d pr oceduralpr ogrammi ng l
anguages ( C,Pascal,etc.).Ev eryt
hing in OOP i
s
gr
oupedassel fsustainable"obj
ects"
.Hence,y ougainreusabi l
i
tybymeansoff our
mainobj ect-
orient
edpr ogrammi ngconcepts.
I
nor dert oclearl
yunder standtheobjectorient
ation
model,let’
st akeyour“ hand”as
anexampl e.The“ hand”i sacl ass.Yourbodyhast woobj ect
sof t
he t
y pe hand"
" ,
named "
lefthand" and
"ri
ghthand" .Thei
rmai nf uncti
onsar econtroll
edor
managed
byasetofel ect
ricalsignalssentthroughy ourshoul der
s(throughani nt
erface)
.So
theshoulderisani nt
erface t
hat
yourbodyusest oi nt
eractwi t
h y
ourhands.The
handisawel l
-ar
chi t
ect
edcl ass.Thehandi sbeingr eusedtocr eat
ethelefthandand
ther
ighthandbysl ight
lychangingt hepropert
iesofi t
.
1.
2OVERVI
EW
1.
2.1COLLECTI
ONFRAMEWORK
1)Hashmap: Itisusedt ostoretheresult
softheel
ecti
onwi ththepartynameaskey
andthevotesast hevaluestoredagainsteachkey.
2)Array
List
:Itisapartof
coll
ectionframework
andispresentinjava.
uti
lpackage.I
t
provi
desusdy nami carraysinJav a.Though,i
tmaybesl owert hanstandar
dar r
ays
butcanbehelpful i
nprogramswher elot
sofmanipulat
ioninthearrayi
sneeded.
1.
2.2LAMBDAEXPRESSI
ON
Iti
sananony
mousfunct
ionusedtohandlefunct
ionali
nter
faceswi
thl
essl
i
nesof
code.
Iti
susedt
ohandl
ecl
i
ckev ent
sonUIcont
rol
s
1.
2.3JAVAFX
JavaFXisasoftwar
epl at
for
mforcr eati
nganddeli
veri
ngdesktopappl
icat
ionst
hat
runacrosswidevar
ietyofdevi
ces.TheGUIhel psinmaki ngtheappl
i
cati
onmor e
userfr
iendl
y.
j
avaFXi susedt
odesigntheUIt
opr ovideari
chuserexper
ience.
1.
2.4JDBC
JavaDatabaseConnect i
vi
ty (
JDBC)i san appli
cati
onpr ogrammi ngi nt
erface (API)
forthe
programminglanguage Java, whi
chdefineshowacl ientmayaccessa database.I t
i
sJav a
baseddataaccesst echnologyandusedf orJav adatabaseconnectivit
y.Itispar tof
the
JavaStandardEditi
on plat
form,fr
om OracleCorporati
on. I
tprovidesmet hodst o
queryandupdatedat ainadat abase,andi sorient
edt owards r
elati
onaldat abases.
AJDBC- t
o-ODBC bri
dgeenabl esconnectionstoanyODBC- accessibledatasour cei n
the
Javavir
tualmachine (
JVM)hostenv ironment .
1.
2.5JSP
JavaServerPages (
JSP) i s a technology that helps soft
ware
developers
create
dynamical
l
y generated web pages
based
on HTML, XML,orot herdocumenttypes.Released i
n 1999 by
Sun
Microsystems,
JSP is simil
arto
PHP and ASP,butituses the
Java
programmi nglanguage.
Todepl
oyandr
unJav
aSer
verPages,
acompat
ibl
ewebser
verwi
th
a
ser
vletcont
ainer
,suchas
ApacheTomcat
or
Jet
ty,
isr
equi
red
1.
3PROPOSEDSYSTEM
1.
3.1OBJECTI
VEOFTHEPROJECT
Tocreateanst udentinf
ormationmanagementsy stem t
hattakesthe
det
ail
soft hestudentast hei nputsand st or
esi tindatabaseina
cat
egorical
manner
Lat
ert he inf
ormati
on can be r et
r i
eved accordi
ng to needs ofthe
admini
strat
ororuserforvar
iouspur poses.
1.
3.2METHODOLOGY
1.
3.1SCOPEOFTHEPROJECT
Whatar
eScopeofSt
udentI
nfor
mat
ionManagementSy
stem?
1. Inf
ormationcanbest oredeasi
lybytheadmini
str
atoraboutt
he
st
udentsi
ncategoricalmanner.
2. Retr
ievalofi nfor
mation i
s much easi
erwhen compar ed t
o
manualstor
agesystem.
3. Furt
heranalysiscanbecar ri
edoutwiththebasicinf
ormati
on
pr
ovi
dedbyt hi
ssyst em.
Goal
soft
heSy
stem ar
easFol
l
ows:
I
tMaint
ainsallTheI
nformati
onofal
ltheStudent
s.
YoucanobserveAll
Infor
mationRel
atedtoapart
icularst
udent
.
Fi
nal
lyavoidi
ngproblemsli
kedatal
oss,easymaintenance.
2.REQUI
REDSPECI
FICATI
ONS
2.
1Sof
twar
eRequi
rement
s
a)JDK
b)My SQLCommunit
ySer
ver
c)ApacheTomcat9.
0
d)Jav
aFX
3.Sy
stem Desi
gnandI
mpl
ement
ati
on
3.
1Modul
arDescr
ipt
ion/
Pseudo-
code
JDBC
St
udentdetai
l
sandmar ksstor
edi
nmy sqldat
abase
Dat
ainser
ted/ret
ri
evedusi
ngappr
opr
iatequer
ies.
Jav
aFXappl
i
cat
ion
Al
i
brar
ymanagementsy
stem whi
chmai
ntai
nst
hebooksdet
ail
s,
member
det
ail
s
Use ofUIt
o gi
vet
he st
andar
dinputt
hrough but
tons and
scenebui
l
der
.
Ther
esul
tisout
puti
naLabel
presentwi
thi
ntheSt
age.
JSP
Thel
ogi
npagepr
ovi
dest
heaccesst
otheuseri
napr
otect
ed
env
ironment
.
Thei
ndexpagedi
rect
stoapagei
fwher
ewor
diswr
it
tenandal
l
i
t’
sdet
ail
sar
eshown
TheJSPcodei
sresponsi
blet
oli
nkt
hedat
abaset
othewebpage
t
over
if
yifwor
dispr
esentornot
CODE:
Mai
n
packageappl
i
cat
ion;
i
mpor
tjav
afx.
appli
cat i
on.Appl
i
cat
ion;
i
mpor
tjav
afx.
fxml.FXMLLoader;
i
mpor
tjav
afx.
stage.Stage;
i
mpor
tjav
afx.
scene.Parent;
i
mpor
tjav
afx.
scene.Scene;
i
mpor
tjav
afx.
scene.layout.
Bor
der
Pane;
publi
cclassMai nextendsAppl i
cation{
@Ov erri
de
publicvoidst ar
t(St
agepr imar yStage){
tr
y{
Parentr oot=FXMLLoader l
.oad( getCl
ass().
get
Resour
ce("
/appli
cation/
logi
n1.f
xml"
));
Scenescene=newScene( root,400,400);
scene.getStyl
esheet s()
.add(get Class()
.get
Resour
ce("
appl
icat
ion.css")
.t
oExter
nal
Form()
);
primaryStage.setTi
tle("
LibraryAssi sstantLogi
n")
;
primaryStage.setWidth(649.0);
primaryStage.setHeight(448.0);
primaryStage.setScene(scene) ;
primaryStage.show() ;
}catch(Excepti
one){
e.pri
ntStackTrace();
}
}
publi
cstati
cvoidmai
n(St
ri
ng[
]ar
gs){
launch(
args)
;
}
}
mai
ncont
rol
l
er
packageappl
i
cat
ion;
i
mpor
tjav
a.i
o.Buffer
edReader;
i
mpor
tjav
a.i
o.Fil
eReader;
i
mpor
tjav
a.net.
URL;
i
mpor
tjav
a.uti
l.
Array
List;
i
mpor
tjav
a.uti
l.
It
erat
or;
i
mpor
tjav
a.uti
l.
ResourceBundl
e;
i
mpor
tjav
afx.
concur r
ent.Task;
i
mpor
tjav
afx.
event.Acti
onEv ent
;
i
mpor
tjav
afx.
fxml.FXML;
i
mpor
tjav
afx.
fxml.FXMLLoader ;
i
mpor
tjav
afx.
fxml.I
niti
ali
zable;
i
mpor
tjav
afx.
scene.Parent;
i
mpor
tjav
afx.
scene.Scene;
i
mpor
tjav
afx.
scene.control.
Label;
i
mpor
tjav
afx.
scene.control.
TextFiel
d;
i
mpor
tjav
afx.
scene.control.
ProgressBar
;
i
mpor
tjav
afx.
stage.Stage;
publ
iccl
assMai
nCont
rol
l
er{
@FXML
pr
ivat
eLabell
Login;
@FXML
pr
ivat
eTextFi
eldt
fUser
name;
@FXML
pr
ivat
eText
Fiel
dtf
Passwor
d;
publicvoidlogi
n(ActionEventevent)throwsExcepti
on
{
i
f(
( t
fUsername.getText(
).equal
s("shiv
am" )&&
t
fPasswor d.get
Text(
).equal
s( "
sm"))|
|(t
fUsername.getText
().
equals(
"si
ddhant
")&&
t
fPasswor d.get
Text(
).equal
s( "
ss")
)||
(tf
Username.getText(
).
equals("
saksham")&&
t
fPasswor d.get
Text(
).equal
s( "
sl"
)))
{
lLogin.
setText
("LoginSuccesful!"
);
St
ri
ngl
i
ne;
t
ry(
Fi
leReaderi sr=new
Fi
l
eReader("C:\\Users\\saksham\ \Deskt op\\
Libmanage\
\sr
c\\
appl
icat
ion\
\books.
txt
");
BufferedReaderbr=newBuf fer
edReader(i
sr)
){
whil
e( (l
ine=br .readLi ne()
)!=nul l
){
String[]str
=li
ne. split(
"");
booksdet ai
lsbd=newbooksdet ail
s()
;
bd.booki d=str[
0] ;
bd.bookn=st r[1];
bd.bookaut hor =st r[
2];
bd.bookpubl icat ion=str[
3];
bookscont r
oll
er .a.add(bd);
bookscont r
oll
er .hash_Set.add(str
[0]
);
}}
catch(
Excepti
one)
{
System.out.
pri
ntl
n(e)
;
}
t
ry(
Fi
leReaderi
sr=new
Fi
l
eReader(
"C:\
\Users\\
saksham\
\Desktop\\
Libmanage\\
src\
\appl
icat
ion\
\member
sid.
txt
");
Buff
eredReaderbr
2=newBuf f
eredReader
(i
sr)
){
whi
le((l
ine=br2.readLine()
)!=nul
l){
St
ring[
]str=li
ne.split(
"")
;
member detai
l
smem=newmember det
ail
s()
;
mem. member i
d=st r[
0];
mem. member name=st r[
1];
mem. member phone=st r
[2]
;
mem. member emai l=str[
3];
member contr
oll
er.a.add(mem);
member contr
oll
er.hash_Set.
add(
str
[0])
;
}
}
catch(Excepti
one)
{
System.out.
pri
ntl
n(e)
;
}
t
ry(
Fi
leReaderi
sr=new
Fi
l
eReader(
"C:\
\Users\\saksham\ \Desktop\\Li
bmanage\\
src\
\appl
icat
ion\
\issue.
txt
");
Buff
eredReaderbr1=newBuf f
eredReader
(i
sr)
){
whil
e((li
ne=br 1.r
eadLine()
)!=null){
Stri
ng[]str
=line.
spli
t(
"");
i
ssuedetai
lsi
sue=newi ssuedetai
ls(
);
i
sue.booki
d=str
[0];
i
sue.memberid=str
[1]
;
i
ssuecontr
oll
era.
. add(
isue);
i
ssuecontr
oll
erhash_
. Set.add(
isue.
booki
d);
}
}
cat
ch(Except
ione)
{
Sy
stem.out.
pri
ntl
n(e)
;
}
Stagepr i
mar y
Stage=newSt age();
Parentroot=FXMLLoader l
.oad(getCl
ass().
get
Resource("
/appli
cation/
int
erf
ace.f
xml"
));
Scenescene=newScene( root,
400,400);
scene.getStyl
esheets()
.add(getClass()
.get
Resource(
"appl
icat
ion.css")
.t
oExt
ernal
For
m( )
);
pri
mar yStage.
setTit
le("
LibraryAssistantMenu");
pri
mar yStage.
setWidth(649.0);
pri
mar yStage.
setHeight(448.0);
pri
mar yStage.
setScene(scene) ;
pri
mar yStage.
show( );
}
el
se{
lLogi
n.set
Text
("Logi
nFai
led!
")
;
}
}
i
ssuecont
rol
l
er
publ
icclassi
ssuecontrol
ler
{
@FXML
pri
vateLabeli
ssuelabel;
@FXML
pri
vateTextFi
eldmember id;
@FXML
pri
vateTextFi
eldbookid;
@FXML
pri
vateLabelshowbook;
publicstati
cAr r
ayList<i
ssuedet ails>a=newAr r
ayLi
st<>()
;
publicstati
cSet<St r
ing>hash_ Set=newHashSet <Stri
ng>()
;
@FXML
publicvoidcheck(Act i
onEv entev ent)
{
issuedetail
sb=newi ssuedet ails();
b.member id=member id.getText ()
;
b.bookid=bookid.getText (
);
if
(!member control
lerhash_
. Set .contai
ns(b.
member i
d))
{
i
ssuelabel.
setText("MEMBERNOTFOUND" );
}
elseif
(!bookscontroll
er.hash_ Set .
contai
ns(b.
booki
d)){
i
ssuelabel.
setText("BOOKNOTFOUND" )
;
}
el
sei f(issuecont roller.hash_ Set.contai
ns(b.bookid)){
issuel abel .
set Text ("BOOKNOTAVAI LABLE" )
;
showbook. setText ("
NOTFOUND" )
;
}
el
se
{
showbook. setText ("
FOUND" );
i
ssuel abel .
set Text ("I
SSUEDSUCCESSFULLY" );
Iterator<booksdet ail
s>i tr=bookscontrollera.
. i
terator(
);
whi le(i
tr.hasNext ())
{
booksdet ailsbk=i tr.
next ();
if
(bk.booki d.equal s(
b. bookid))
{
showbook. setText ("
BOOKI D:"
+bk. bookid+"\n"+"BOOKNAME: "
+bk.
bookn+"\
n"+"BOOK
AUTHOR: "+bk. bookaut hor +"\
n"+" BOOKPUBLI CATI ON:"+bk.bookpubli
cati
on);
break;
}
}
try(Fi leWr it
erf =new
Fi
leWrit
er( "C:\\User s\\ saksham\ \Desktop\\Libmanage\ \src\
\appli
cati
on\\i
ssue.
txt
",
tr
ue)){
f.wr i
te("\n"+b. booki d+"" +b.member i
d);
a.add( b);
hash_ Set.add( b. bookid);
}cat ch(Except i
one)
{
Sy stem. out .
pr intln(e);
}
}
}
}
i
nter
facecont
rol
l
er
packageappl
i
cat
ion;
i
mpor
tjav
a.i
o.BufferedReader ;
i
mpor
tjav
a.i
o.Fil
eReader ;
i
mpor
tjav
a.ut
il.
ArrayList;
i
mpor
tjav
afx.
ev ent.
Act i
onEvent;
i
mpor
tjav
afx.
fxml .
FXML;
i
mpor
tjav
afx.
fxml .
FXMLLoader ;
i
mpor
tjav
afx.
geomet ry.I
nsets;
i
mpor
tjav
afx.
scene.Gr oup;
i
mpor
tjav
afx.
scene.Par ent;
i
mpor
tjav
afx.
scene.Scene;
i
mpor
tjav
afx.
scene.cont rol
.*;
i
mpor
tjav
afx.
scene.lay out.
VBox;
i
mpor
tjav
afx.
scene.t ext.
Font;
i
mpor
tjav
afx.
stage.St age;
publ
iccl
assi
nter
facecont
rol
l
er{
publ
icvoi
dinterf
ere(Act
ionEventevent)t
hrowsExcepti
on
{
Stri
ngval
ue=((Butt
on)event
.getSource(
)).
get
Text
();
if
(val
ue.
equals("
ADDBOOK" ))
{
Stageprimary
Stage=newStage();
Parentroot=FXMLLoader.l
oad(getCl
ass().
get
Resour
ce("
/appli
cation/
main.
fxml"
));
Scenescene=newScene( r
oot,
400,400);
scene.get
Styl
esheet
s().
add(get
Class()
.get
Resour
ce("
appl
icat
ion.css")
.t
oExt
ernal
Form(
));
pr
imar
ySt
age.
setTi
tle("
AddNewBook" )
;
pr
imar
ySt
age.
setWidth(574.0);
pr
imar
ySt
age.
setHeight(385.0);
pr
imar
ySt
age.
setMaxWi dth(574.0);
pr
imar
ySt
age.
setMaxHei ght(385.0)
;
pr
imar
ySt
age.
setScene(scene) ;
pr
imar
ySt
age.
show() ;
}
el
sei f
(val
ue.equals(
"ADDMEMBER" ))
{
Stagepr i
mar y
Stage=newSt age( );
Parentroot=FXMLLoader .l
oad( getCl
ass().
get
Resour
ce("
/appli
cation/
member .
fxml "
));
Scenescene=newScene( r
oot ,400,400);
scene.getStyl
esheets().
add( get Class()
.get
Resour
ce("
appl
icat
ion.css")
.t
oExternalForm())
;
primaryStage.
setTit
le("AddNewMember "
);
pri
maryStage.set
Wi dth(574. 0);
pri
maryStage.set
Hei ght (
385. 0);
primaryStage.
setMaxWi dth(574. 0);
primaryStage.
setMaxHei ght(385. 0);
primaryStage.
setScene( scene) ;
primaryStage.
show( );
}
el
sei f
(val
ue.equals(
"I
SSUEBOOK" )
)
{
Stagepr i
mar y
Stage=newSt age( );
Parentroot=FXMLLoader .l
oad( getCl
ass().
get
Resour
ce("
/appli
cation/
issue.
fxml ")
);
Scenescene=newScene( r
oot ,400,400);
scene.getStyl
esheets().
add( get Class()
.get
Resour
ce("
appl
icat
ion.css")
.t
oExternalForm())
;
pri
maryStage.set
Title("BookI ssue" );
primaryStage.
setWidth(574. 0);
primaryStage.
setHeight(385. 0);
primaryStage.
setScene( scene) ;
primaryStage.
show( );
}
el
seif(
value.equals(
"RETURNBOOK" ))
{
Stagepr i
mar y
Stage=newSt age();
Parentroot=FXMLLoader l
.oad(getClass(
).get
Resour
ce("
/appli
cation/
retur
n.f
xml"
));
Scenescene=newScene( r
oot ,
400,400);
scene.getStyl
esheets()
.add(getClass().
getResour
ce("
appl
icat
ion.css")
.t
oExter
nal
Form()
);
primaryStage.set
Titl
e("BookRet ur
n" )
;
pri
mar yStage.
setWidth(574.0);
pri
mar yStage.
setHeight(385.0);
pri
mar yStage.
setMaxWi dth(574.0);
pri
mar yStage.
setMaxHei ght(385.0);
pri
mar yStage.
setScene(scene) ;
pri
mar yStage.
show( );
}
el
sei
f(
val
ue.
equal
s("
BOOKSLI
ST"
))
{
Stagepr i
mar y
Stage=newSt age();
Parentroot=FXMLLoader l
.oad(getCl
ass().
get
Resour
ce("
/appli
cation/
booksl
ist
.f
xml"
));
Scenescene=newScene( r
oot ,
400,400);
scene.getStyl
esheets()
.add(getClass()
.get
Resour
ce("
appl
icat
ion.css")
.t
oExt
ernal
For
m());
primaryStage.set
Titl
e("BookLi st"
);
pri
mar yStage.
setWidth(574.0);
pri
mar yStage.
setHeight(385.0);
pri
mar yStage.
setMaxWi dth(574.0);
pri
mar yStage.
setMaxHei ght(385.0);
pri
mar yStage.
setScene(scene) ;
pri
mar yStage.
show() ;
}
el
sei
f(
val
ue.
equal
s("
SEARCHMEMBER"
))
{
Stagepr i
mar y
Stage=newSt age();
Parentroot=FXMLLoader l
.oad(getCl
ass().
get
Resour
ce("
/appli
cation/
member l
ists.
fxml"
));
Scenescene=newScene( r
oot ,
400,400);
scene.getStyl
esheets()
.add(getClass()
.get
Resour
ce("
appl
icat
ion.css")
.t
oExt
ernalFor
m( )
);
pri
mar yStage.
setTit
le("
Sear chMember" );
pri
mar yStage.
setWidth(649.0);
pri
mar yStage.
setHeight(448.0);
pri
mar yStage.
setScene(scene) ;
pri
mar yStage.
show( );
}
}
bookscont
rol
l
er
publ
icclassbookscontroll
er{
@FXML
pri
vateLabelbooklabel;
@FXML
pri
vateTextFi
eldbook_ i
d;
@FXML
pri
vateTextFi
eldbook_ name;
@FXML
pri
vateTextFi
eldbook_ publi
cati
on;
@FXML
pri
vateTextFi
eldbook_ author
;
publ
icst
ati
cArr
ayLi
st<booksdet
ais>a=newAr
l ray
List
<>();
publ
icst
ati
cSet
<Str
ing>hash_Set=newHashSet
<Str
ing>(
);
@FXML
publicvoi dcheck( Act i
onEv entev ent)
{
booksdet ai
lsb=newbooksdet ail
s();
b.booki d=book_ id.getText ()
;
b.bookn=book_ name. get Text ()
;
b.bookaut hor =book_ aut hor.get Text(
);
b.bookpubl ication=book_ publ icati
on.getText(
);
i
f(hash_ Set.cont ai
ns( b.
booki d))
{
bookl abel .
set Text("BOOKALREADYEXI STS");
}
else
{
try(FileWr iterf=new
Fi
l
eWr iter
("C: \\User s\\saksham\ \Deskt op\\
Libmanage\\
src\\
appl
icat
ion\\books.
txt
",
tr
ue)
){
f .
write( "\
n" +b.bookid+"" +b.bookn+"" +b.bookaut
hor
+""+b.
bookpubli
cati
on);
a.add( b) ;
hash_ Set .
add( b.booki d);
bookl abel .
set Text("ADDEDSUCCESSFULLY" );
/*System. out .
pr i
ntl
n( "
bookscont rol
ler
:\n")
;
I
terat or<booksdet ail
s>i tr=a.iter
ator(
);
while( i
tr.
hasNext ())
{
booksdetail
sbd=i t
r.next(
);
Sy st
em.out.
pri
ntln(bd.booki
d+"
\n"
+bd.
bookn)
;
}
*/
}catch(Except
ione)
{
System.out.
pri
ntl
n(e);
}
}
}
}
r
etur
ncont
rol
l
er
publi
ccl assr eturncontroll
er{
@FXML
privateLabel r et
urnlabel;
@FXML
privateText Fieldbooki d;
@FXML
privateText Fieldmember id;
@FXML
pri
vateLabel br;
@FXML
publ i
cv oidcheck( Act i
onEv entevent){
Stri
ngbooki d1=booki d.
get Text(
);
Stri
ngmember i
d1=member i
d.getText(
);
I
terator<issuedetails>it=i ssuecontrol
l
er.a.
it
erat
or(
);
i
f(!member contr
oll
erhash_
. Set
.contai
ns(member i
d1)
){
retur
nlabel.
setText
("MEMBERNOTFOUND" )
;
}elsei
f(!bookscontr
oller
.hash_Set.
contai
ns(booki
d1)){
retur
nlabel.
setText
("BOOKNOTFOUND" )
;
}elsei f( !i
ssuecont r
oller hash_
. Set.
contains(bookid1)){
retur nlabel .setText (
"BOOKNOTI SSUED" );
}else{
intf l
ag=0;
whi le( it.hasNext ()){
issuedet ailsbd=i t
.next (
);
if(bd. booki d.equal s(booki d1)&&! bd.member i
d.equal s(
member i
d1)){
flag=1;
br eak;
}
}
if(flag! =1){
retur nl abel .
set Text("RETURNEDSUCCESSFULLY" );
Iterat or <booksdet ail
s>i tr
=bookscont r
ollera.
. i
terator()
;
whi le( itr.
hasNext ())
{
booksdet ail
sbk=i tr .
next();
if(bk. booki d.equal s(booki d1))
{
br .set Text (
"BOOKI D:"
+bk. bookid+"\n"+"BOOKNAME: "+bk.bookn+"\n"
+"BOOK
AUTHOR: "+bk. bookaut hor +"\n"+"BOOKPUBLI CATI ON:"+bk.bookpubl i
cati
on);
br eak;
}
}
St r
ingl ine, val=" ";
try( FileReaderf r=new
Fi
leReader ("C: \\User s\\saksham\ \Desktop\\Libmanage\ \src\\
applicati
on\\
issue.t
xt")
;
Buf fer edReaderbr=newBuf feredReader ((
fr)
);
FileWr iterfw=new
Fi
leWr i
ter("C: \ \User s\\saksham\ \Desktop\\Libmanage\ \src\\
applicati
on\\t
emp. t
xt")
){
whi l
e( (l
ine=br .r
eadLi ne( )
)!=nul l
){
St ring[ ]str=l i
ne. spli
t("");
i
f(str[
0].
equal s(bookid1)){
i
ssuecont rollerhash_
. Set .
remove(booki
d1)
;
/*It
erat
or <booksdet ai
ls>itr1=bookscontr
oll
er.
a.i
ter
ator
();
while(i
tr1.hasNext ()
){
booksdet ai
lsbk=i t
r1.next(
);
i
f(bk.booki d.
equals(bookid1))
{
i
ssuecont roller.
a.r
emov e(bk);
}*/
continue;
}
fw.wr i
te(l
i
ne+" \n")
;
}
}catch( IOExceptione){
System. out
.pr
intln(e)
;
}
try(Fil
eReaderfr=new
Fi
l
eReader("C:\\Users\\saksham\ \Desktop\\Libmanage\\src\
\appl
icat
ion\
\temp.txt
");
Buf f
eredReaderbr=newBuf feredReader(
(fr
));
Fil
eWr iterf
w=new
Fi
l
eWriter(
"C:\\Users\\saksham\ \Desktop\\Libmanage\\src\\
appli
cati
on\\
issue.
txt"
)){
while((l
ine=br .
readLine()
)!=nul l
){
String[]st
r=l i
ne.spli
t(
"");
fw.wr i
te(l
i
ne+" \n")
;
}
}catch( IOExceptione){
System. out
.pri
ntln(
e);
}
}else{
returnlabel.
setText("
MISMATCH"
);
}
}
}
4.
Resul
tsandSnapshot
s
JSPANDJDBC
Code
<!DOCTYPEht ml >
<!-
-[
ifltIE7]><ht ml class="lt-
ie9lt-i
e8lt-
ie7"lang="en"><![
endi
f]
--
>
<!-
-[
ifIE7]><ht ml class=" l
t-i
e9lt-i
e8"lang=" en"
><![endif
]-
->
<!-
-[
ifIE8]><ht ml class=" l
t-i
e9"lang="en"><! [
endif
]--
>
<!-
-[
ifgtIE8]><! -
-><ht ml lang="en"><!--
<![endif
]-
->
<head>
<met acharset ="utf-8">
<met ahttp-equiv="X- UA-Compat i
ble"content="I
E=edge,chrome=1"
>
<ti
tle>encyclopedia</ ti
tle>
<li
nkr el
="stylesheet "href="sak.css">
</head>
<body >
<sectionclass=" cont ai
ner">
<divclass="login">
<h1>Ency clopedi a</h1>
<f
orm met
hod="
post
"act
ion="
index
.ht
ml"
>
wor
dtosear
ch:
<i
nputt
ype="
text
"name="
usr
"/>
<i
nputt
ype="
submi
t"v
alue="
sear
ch"
/>
</
p>
</
div
>
</
sect
ion>
<sectionclass="about"
>
<pcl ass="about-
li
nks"
>
<a hr ef="htt
p:/
/www.cssf
low.
com/
sni
ppet
s/l
ogi
n-f
orm"t
arget
="_
par
ent
">f
oll
ow
onf acebook</ a>
</p>
</section>
</body >
</html>
JSPFORCONNECTI
ON
}
el
se
{
out.
pri
ntl
n("
Inv
ali
dpasswor
dtryagai
n")
;
}
}
el
se
%>
<ahref
="i
ndex.ht
ml"
>Home</a>
</body
>
</html
>
5.
Concl
usi
on
Theactualpur
poseofgoi
ngf
orthi
ssyst
em i
stomaket
he
organi
zati
onalpr
ocesst
ospeedup.
6.
Bibl
i
ogr
aphy
JavaFXdocumentati
on:
htt
p://
www.oracl
e.com/
technet
wor
k/j
ava/
jav
afx/
document
ati
on/
index.
html
JDBCDocument at
ion:
docs.
oracl
e.com/j
avase/
7/docs/t
echnotes/
gui
des/
jdbc
ApacheTomcat9.0:tomcat.
apache.
org
Wewoul
dli
ket
othankt
hef
oll
owi
ngsour
ceswhi
chenabl
edust
o
successf
ull
ycar
ryoutourpr
oject
:-
[
1]GeeksForGeeks
[
2]YouTube
[
4]www.
oracl
e.com