You are on page 1of 83

ANALYSIS AND DESIGN OF LIBRARY MANAGEMENT SYSTEM

[PROJECT REPORT]

COMPILED BYNIRUPAMA GUIDED BYMrs. Shabana Parveen

This is to certify that NIRUPAMA Of STD XII D COMMERCE has complete her pro!ect "# er my $"i a#ce a# s"per%isio# I certify that this pro!ect is i# &ith accor a#ce &ith the $"i eli#es iss"e 'y C(SE)

Date ..
*Si$#at"re+ Teacher i# char$e

I am thankful to Mrs. Shabana Parveen my Informati s Pra ti es tea her !ho has "rovi#e# re$uisite %ui#an e an# hel" for the su essful om"letion of this "ro&e t an# also last but not the least I !oul# like to thank all those !ho #ire tly or in#ire tly hel"e# me in the su essful om"letion of this "ro&e t

'ate(...............

)Si%nature*
Stu#ent

CO+TE+TS
,. System 'es ri"tion at a %lan e -. Problem 'es ri"tion C. 'atabase 'esi%n '. Pro&e t Control .lo! E. Pro&e t Out"ut

System 'es ri"tion at a /lan e


British Library is a library, which provides reading services to its members. Any person can become a member of the library by filling a prescribed form and paying appropriate amount of fees. This membership is given for one- year duration, during which members can avail following facilities. The can get the boo s and !ournals for reading "reference. They can get boo s issued, so that they can ta e them home and return them on or before due date.

#or providing the reading services, library purchases boo s from the mar et. $hen arrived in the library, they are physically inspected and if they are found in order, they are ta en into account, else they are re!ected. Details of the boo s are noted in the ac%uisition register. After these formalities, boo s can be issued to the readers on their re%uest. $hen a member re%uest for a boo , librarian searches it in the library according to the ac%uisition number and the accession number of the boo . &f it is available 'not issued to other member( then it is issued to the member and details of the issue are noted down in a register called issue register. After reading the boo , member returns the boo to the librarian. At the time of returning of the boo , librarian should update the library and member data. Time to time librarian scans through the issue register and finds out list of boo s, which are issued and should return in time. #ollowings are the activities of librarian of B)&T&*+ library,

, $uisition of book Membershi" maintenan e -ook issue -ook return ,ns!er mana%ement $ueries

Problem 'es ri"tion


Acq !s!"!#n #$ B##%s
P"rchase epartme#t of the li'rary p"rchases %ario"s 'oo,s) After p"rchase- these 'oo,s are i#specte a# if fo"# i# or er a "#i."e #"m'er calle ac."isitio# #"m'er is assi$#e to each 'oo,) P"rchase epartme#t the# se# s these 'oo,s to li'raria#) (ase o# the s"'!ect- a"thor of the 'oo,s etc)- li'raria# assi$#s a co e to the 'oo,) This co e is calle as accessio# #"m'er) /e also e#ters %ario"s etails re$ar i#$ a 'oo, i# ac."isitio# re$ister) /e cha#$es e#tries of the ac."isitio# re$ister- if some cha#$e i# 'oo, i#formatio# ta,es place) 0ormat of ac."isitio# re$ister is $i%e# 'elo&1

Acquisition Register
Sl.No Acq.No. Acc.No. Title&Authour Publisher Price&pages Date(P) Status

Me&bersh!' Ma!n"enance
A perso#- &ho &a#ts to 'e a mem'er of the li'rary- has to fill a# applicatio# form a# $i%e# it to the li'raria# alo#$ &ith mem'ership fee *mi#im"m 2333+ a# ca"tio# mo#ey *433+ 5i'raria# assi$#s a "#i."e mem'ership #"m'er to him a# e#ters the etails of this mem'er i# mem'ership re$ister) After some time- if a#y mem'er &a#ts to re "ce or i#crease his ca"tio# mo#eyli'raria# ma,es cha#$es accor i#$ly i# the mem'ership mo ificatio# form) If a mem'er &a#ts to isco#ti#"e i# 'et&ee#- li'raria# stri,es off his e#try form the mem'ership re$ister a# ret"r#s the ca"tio# mo#ey) 0ormat of mem'ership re$ister is $i%e# 'elo&1

MEMBERSHIP REGISTER

S(. N#

Me&b.N #

Na&e) A**ress

Me&b.Da" e

E+'!r, Da"e

Me&bersh! ' Fees

Ca "!#n M#ne,

5i'raria# iss"e o#ly o#e 'oo, at a time to a mem'er) A mem'er fills a re."isitio# slip a# re."ests the li'raria# to iss"e the 'oo, to him) 0ormat of the re."isitio# slip is chec,e 'y the li'raria# a# the li'raria# first chec,s i# mem'er re$ister- &hether his mem'ership is still co#ti#"i#$) If #ot- he oes #ot accept the re."est else he physically chec,s for the prese#ce of the 'oo, i# the li'rary) If #ot prese#t- he re!ects the re."est of the mem'er6 other&ise he iss"es the 'oo, to mem'er) 5i'raria# #otes o&# the etails i# Iss"e re$ister) 0ormat of iss"e re$ister is $i%e# 'elo&1

ISSUE REGISTER

S(. N#

Me&b. N#

Acq.

Acc. N#

B##% Iss e* On

Da"e O$ Re" rn

BOO- RETURN
7he# a mem'er ret"r# a 'oo, the li'raria# sho"l "p ate the li'rary re$ister *set Stat"s as y-i)e)- a%aila'le+ a# mem'er re$ister *set mem8 iss"e as N- i)e- #ot iss"e + properly)

'atabase 'esi%n
The following are the si- table with respective fields, .( Table , /ublisher

.iel# +ame PUB_ D PUB_NA"# PUB_ADDR#SS PUB_ P)*N# + PUB_ P)*N# , STATUS

.iel# Ty"e nt $archar $archar $archar $archar -)AR

0i#th ! %& !& +, +, +

'es ri"tion Publisher D Publisher Na'e Publisher A((ress Publisher phone + Publisher phone , Publisher continue or not (./N). .0 continue N0 Del

MyS95 Comma# -reate table publisher (pub_i( int(!)pri'ar1 2e1 not null3 pub_na'e 4archar(%& )not null3 pub_ a((ress 4archar(!&)3 pub_phone+ 4archar(+,) pub_phone 4archar(+,) status char(+))5

2+

Table , L&B FIELD TYPE NT $AR-)AR $AR-)AR $AR-)AR NT 86*AT DAT# NT NT -)AR .IDT/ ! %& %& %& ! 9 ! ! + DESCRIPTION A--#SS *N N*. B**7 T T6# 8 RST AUT)*R S#-*ND AUT)*R PUB6 S)#R D PR -# *8 B**7 PUR-)AS# DAT# N*. *8 PA:#S PUB6 S)#D .#AR (e(ition) -URR#NT STATUS *8 B**7 (./N)

FIELD NAME A--_N* T T6# AUT)*R+ AUT)*R, PUB_ D PR -# PA:#S PDAT# #DT *N STATUS MyS95 Comma#

-reate table lib (acc_no int (!)3 acq_no int (!)3 btitle 4archar(%&) not null 3 author+ 4archar(%&)3 author, 4archar(%&)3 pub_i( int(!)3 price ;loat(/)3 p(ate (ate3 pages int(!)3 e(tion int (!)3 8*R :#N 7#.(pub_i() R#8R#N-#S publisher(pub_i()3 Status char(+))5 0( Table , 121B2) 8 #6D NA"# "#"B_N* "#"B_NA"# "#"B_ADD "#"B_P)*N# "DAT# "#DAT# "8## "#"_STATUS "#"_ SSU# 8 #6D T.P# NT $AR-)AR $AR-)AR $AR-)AR DAT# DAT# NU"B#R -)AR -)AR < DT) ! %& !& +& +& +& 93, + + D#S-R PT *N "e'ber no "e'ber na'e "e'ber a((ress "e'ber phone no "e'bership (ate "e'bership e=pire (ate "e'bership ;ee "e'bership continue or not (./N).0 continue N0 (elete( #ither boo2 issue( or not (./N) .0 issue( N0 not issue(

MyS95 Comma# -reate table 'e'ber ('e'b_no int(!) pri'ar1 2e13 'e'b_na'e 4archar(%&)3

'e'b_ a(( 4archar (!&)3 '(ate (ate3 'e(ate (ate3 ';ee (ouble (93 ,)3 'e'_status char (+)3 'e'_issue char (+))5 :+ Table 1 MISS2E )this ta'le is for master iss"e0 0iel #ame A--_N* "#"B_N* DAT# RDAT# 0iel type NT NT DAT# DAT# 7i th ! ! +& +& Descriptio# Accession no. "e'ber no. ssue (ate Return (ate

MyS95 Comma# -reate table 'issue ( acc_no int(!)3 acq _no int (!)3 'e'b_ no int(!)3 i(ate (ate3 r(ate (ate ) 5

Table 1 TISS2E)this ta'le is for aily tra#sactio# p"rpose+


0iel #ame A--_N* "#"B_N* DAT# RDAT# MyS95 Comma# -reate table Tissue (acc_no int(!)3 'e'b_no int (!)3 i(ate (ate3 r(ate (ate )5 0iel type NT NT DAT# DAT# 7i th ! ! +& +& Descriptio# Accession no. "e'ber no. ssue (ate Return (ate

Pro&e t Control .lo!


The pro!ect co#tai#s %ario"s form *)!a%a+ file &ith respecti%e me#" optio#) The me#" is as1

P"'lisher P"'lisher Co#sole Mo ificatio# Deletio# Recor Na%i$atio#

(oo, (oo, Co#sole Mo ificatio# Deletio# (oo, Iss"e (oo, Ret"r#e

Mem'er Mem'er Co#sole Mo ificatio# Deletio# Recor Na%i$atio#

Reporter 9"it A%aila'le (oo, 5itst Applicatio# Iss"e (oo, 5ist Mem'er 5ist

The following listing shows the java files with respective menu options

MemUI.java Memb ditUI.jav a !eletion Mem!elUI.java #ecord Navi$ation MemNavUI."ava #eport 'vailable boo& List '%ListUI.java Issued %oo& List I%ListUI.java Member List MListUI.java (uit 'pplication

Menu Caption Main Library Form Publisher Publisher Console Modification !eletion #ecord Navi$ation %oo& %oo& Console Modification !eletion %oo& Issue %oo& returned Member Member Console Modification

Form File Main UI.java pubUI.java Pub ditUI.java Pub!elUI.."ava PubNavUI.java LibUI.java Lib ditUI.java LIb!elUI.java IssueUI.java #eturnUI.java

Variable Name mnuPub mnuPMod mnuP!el mnuPNav mnuLib mnuLib dit mnuLib!el mnuIssue mnu#etun mnuMemb mnuMMod mnuM!el MnuMNav mnu'%List mnuI%List mnuMList mnu(uit

Program output
5i'rary Mai# Me#" Scree# *Mai#Ui!a%a+

So"rce Co e 1 Mai#UI)!a%a

pri4ate 4oi( 'nu PubAction Per;or'e((>a4a .a?t.e4ent.Action #4ent e4t) @ //this.set$isible(;alse)5 ne? pubU ( ).set$isible(true)5 ne? pubU ( ).getAlign'entA( )5 B pri4ate 4oi( 'nuCuitActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ S1ste'. e=it(*)5 B pri4ate 4oi( 'nuP"o(ActionPer;or'e((>a4a.a?t3e4ent.Action#4ent e4t) @ ne? Pub#(itU ( ).set$isible(true)5 B pri4ate 4oi( 'nuPDelActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ ne? PubDe U ( ).set$isible(true)5 B pri4ate 4oi( 'nuPNa4ActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ ne? PubNa4U ( ).set$isible(true)5 B pri4ate 4oi( 'nu6ibActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ ne? 6ibU ( ).set$isible(true)5 B pri4ate 4oi( >"enulte'DActionPer;or'e((>a4a.a?t.e4entAction#4ent e4t) @ ne? "e'bU ( ).set$isible(true)5 B pri4ate 4oi( >"enulte'EActionPer;or'e((>a4a.a?t.e4ent.Actio;l#4ent e4t) @ ne? "e'b#(itUl( ).set$isible(true)5 B pri4ate 4oi( 'nu"Del ActionPer;or'e((>a4a.a?t.e4ent.Actio;l#4ent e4t) @ ne? "e'bDe U ( ).set$isible(true)5 B pri4ate 4oi( 'nu"Na4ActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ ne? "e'bNa4U ( ).set$isible(true)5 B pri4ate 4oi( 'nulssueActionPer;or'e((>a4a.a?t3e4ent.Action#4ent e4t) @ ne? ssueU ( ).set$isible(true)5 B pri4ate 4oi( 'nuReturnActionper;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ ne? ReturnUl( ) .set$isible(true)5 B pri4ate 4oi( 'nuAB6istActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @

ne? AB6 stU ( ).set$isible(true)5 B pri4ate 4oi( 'nulB6istActionPer;or'e((>a4a.a?t.e4entAction#4ent e4t) @ ne? B6istU ( ).set$isible(true)5 B pri4ate 4oi( rnnu"6istActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ ne? "6istUT( ).set$isible(true)5

P"'lisher E#try *p"'Ul)!a%a+

So"rce Co e 1 p"'U5!a%a Use( -lass/Pac2ages i'port >a4a.sql.F5 i'port >a4a=.s?ing.G*ptionPane5 E;it1 Action#4ent Proce(ure pri4ate 4oi( c'(#=itActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ this. set$isib le (;alse) ne? "ainU ( ).set$isible(true)5 B 8or' loa( proce(ureH pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a.a?t.e4ent.<in(o?#4ent e4t) @ t=tPno.set#(itable(;alse)5 // Deacti4ate the Sa4e button ?hen ;or' loa(s c'(Sa4e.set#nable((;alse)5 B

Ne&H Action#4ent Proce(ure pri4ate 4oi( c'(Ne?ActionPer;or'e((>a4a.a?te4ent.Action#4ent e4t) @ // Acti4ate the Sa4e button ?hen Ne? button clic2e( c'(Sa4e.set#nable((true)5 tr1 @ -lass.;orNa'e(Ico' . '1sql.>(bc.Dri4erJ)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(J>(bcH '1sqlH//localhostH %%&E/6ibrar1L3LrootL3reeta)5 State'ent st't K null5 ResultSet rs K null5 // ResultSet ;or publisher table. String SC6 K S#6#-T F 8R*" publisherL5 st't K con.createstate'ent( )5 // -onnection string ;or ResuitSet 0 rs. rs K st't.e=ecuteCuer1(SC6)5 int pno K +5 int P D K &5 ?hile (rs.ne=t( )) @ P D K rsgetlnt(Ipubi(J)5 pnoMM5 B P+ D M M5 pno K P D5 t=tPno.setTe=t( nteger.toString(pno))5 t=tPNa'e.set8ocusable(true)5 con .close( )5 rs.close( )5 st't.close( )5 B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3e.get"essage( ))5 e.printStac2Trace( )5 B B Sa%e H Action#4ent Proce(ure pri4ate 4oi( c'(Sa4eActionPer;or'e((>a4a .a?t.e4ent.Action#4ent e4t) @ tr1 @ -lass.;orNa'e(Jco'. '1sql.>(bc. Dri4er)5 -onnection con K (-onnection) Dri4er"anager.get-onnection (I>(bcH'1sqlH//localhostH%%&E/6ibrar1J3JrootJ3JretaJ)5

State'ent st't K null5 ResuitSet rs K null5 String SC6 K OS#6#-T F 8R*" publisherJ5 st't K con.createState'ent( ) 5 rs K st't.e=ecuteCuer1(SC6)5 int Pno K nteger. parselnt(t=tPno. getTe=t( ))5 String PNa'e K t=tPNa'e.getTe=t( )5 String PA(( K t=tPA((3getTe=t ( ) 5 String Pphl K t=tPhl.getTe=t( )3 String Pph, K t=tPh,.getTe=t ( )5 char PStatus KL.L5 int co(e K N*ptionPane.sho?-on;ir'Dialog(this3 IAre 1ou sure to a((PJ3 I-on;ir'ation Dialog Bo=J3 N*ptionPane..#S_N*_-AN-#6_*PT *N3 N*ptionPane. N8*R"AT *N_"#SSA:#)5 i; (co(e KK %*ptionPane..#S_*PT *N) @ String strSC6K I NS#RT NT* Publisher(pub_i(3 pub pub a((ress3 H pub_phone,3 status) $A6U#S (IM(Pno)MJ3 IM(PNa'e)MJ3 IM(PA(( IM(Pphl)MJ3 IM(Pph,)MJ3 IM(PStatus)MJ)J5 int ro?s#;;ecte( K st't. e=ecuteUp(ate(strSC6)5 N*ptionPane.sho?"essageDialog(this3 IRecor( a((e( success;ull1 into Publisher tableJ)5 B con.close( )5 st't.close( )5 rs close ( )5 c'(Sa4e.set#nable((;alse)5 B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage( ))5 B Clear Action#4ent Proce(ure pri4ate 4oi( c'(-learActionPer;or'e((>a4a .a?t.e4ent.Action#4ent e4t) @ t=tPno.setTe=t(IJ)5 t=tPNa'e.setTe=t(IJ)5 t=tPA(( .setTe=t(IJ)5 t=tPhl .setTe=t( I I)5 t=tPh, .setTe=t( I I)5

c'(Sa4e.set#nable((;alse)5 B B E it__> Action#4ent Proce(ure pri4ate 4oi( c'(#(itActionPer;or't ((>a4a.a?t.e4ent.Action#4ent e4t) @ this.set$isible(;alse)5 ne? Pub#(itU C.set$isible(true)5 B

Source -*D# H Pub#(it.>a4a Use( class/pac2agesH i'port >a4a.sql.F 5 i'port >a4a=.s?ing.NoptionPane5 i'port >a4a=.s?ing.De;ault6ist"o(el5 8ro' loa( 4proce(ure H pri4ate 4oi( ;ro'<in(o? :aine(8ocus(>a4a.a?t.e4ent e4t) @ t=tPno.setTe=t(;alse)5 //-reating a 6ist"o(el ob>ect ("o(el to per;or' De;ault6ist"o(el // 'etho( operations De;ault6ist"o(le ("o(el K (De;ault6ist"o(el) >6istl.get"o(elC5 // "etho( toa(( ele'ents into >6ist+ control ("o(el.clear( )5 tr1@

-lass.;orNa'e(Ico'.'1sql.>(bc.Dri4erJ)5 -onnection con K (-onnection) Dri4er"anager.get-onnection (I>(bcH'1sqlH//localhostH%%&E/6ibrar1J3JrootJ3JretaJ)5 State'ent st'tK null5 ResultSet rs K null5 String SC6K S#6#-T F 8R*" PublisherJ st't K con.createState'ent( )5 rs K st't.e=ecuteCuer1(SC6)5 ?hile(rs.ne=t( ) ) @ String PNoK rs.getString(pubi(J)5 String PNa'e K rs.getString(pub_na'e)5 //To 'a2e the publisher no. as ! (igit because ?e ?iil e=tract ! (igit ;ro' list 4alue // in 'ouse clic2 e4ent. i;(Pno.length( ) Q!) @ int = Pno.length( )5 int nl K !0=5 ?hile( nlR*)@ Pno K Pno M IJ5 nl0 0 B ("o(el.a((#le'ent(Pno MJ0I M PNa'e)5 B >6istl .set"o(el(("o(el)5 con.close( )5 B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3e.get"essage( ))5 e printStac2lrace( )5 B Mo"se clic, e%e#t Proce "re1 pri4ate 4oi( >6istl"ouse-lic2e((>a4a .a?t. e4ent. "ouse#4ent e4t) @ // getSelecte($alue() 'etho( e=tracts the current cursor location 4alue into a 4ariable String "Pub K (String) >6istl.getSelecte($alue( )5 // #=tract the ;irst ! characters as publisher D into a 4ariable

String PubN K"Pub.tri'( ).substring(*3 %)5 String quer1 K OS#6#-T F 8R*" Publisher <)#R# pub_i( K IM PubN MJ5J5 tr1@ -lass.;orNa'e(Ico'.'1sql.>(bc.Dri4erJ).ne? nstance( )5 -onnection con K (-onnection) Dri4er"anagerget-onnection( I>(bcH'1sqlH//localhostH%%&E/6ibrar1J3JrootJ3JreetaJ)5 // -reate SC6 state'ent an( e=ecute quer1. State'ent st't K con.createState'ent( )5 ResultSet rs K st't.e=ecuteCuer1(quer1) 5 i; (rs.ne=t*) @ //PubN K rs.getString(Jpub_noJ)5 String PubNa'e K rs.getString(Ipub_na'eJ)5 String PubA(( K rs.getString( Ipub_a((ressJ)5 String PubPhl K rs.getString( Ipub_phone+J)5 String PubPh, K rs.getString(Ipub_phone,J)5 String PStatus K rs.getString(JstatusJ)5 // Displa1ing the contents in respecti4e te=t bo=es. t=tPno.setTe=t(PubN)5 t=tPNa'e.setTe=t(PubNa'e)5 t=tPA((.setTe=t(PubA(()5 t=tPhlsetTe=t(PubPhl)5 t=tPh,.setTe=t(PubPh,)5 t=tStatus.setTe=t(PStatus)H t=tPrio.set#(itable(;alse)5 // -lose the operational ob>ect ;or Stu(ent con .close( )5 st't.close( )5 rs.cloe( )5 Belse@ N*ptionPane.sho?"essageDialog(null 3 IRecor( (oes not ;oun( in publisher tableJ)5 B B catch (#=ception e) @ N*ptionPanesho?"essageDialog(this3 e.get"essage( ))5 B B

E;it < Actio#E%e#t Proce "re pri4ate 4oi( c'(#=itActionPer;or'e((>a4a a?t. e4ent.Action#4ent e4t) @ this.set$isible(;alse)5 //ne? "ainU ( ).set$isible(true)5 B Up ate HAction#4ent Proce(ures pri4ate 4oi( c'(Up(ateActionPer;or'e((>a4a .a?t.e4ent.Action#4ent e4t) @ tr1@ // -onnect to "1SC6 (atabase // Dont ;orget to i'port the t?o pac2ages // i'port >a4asql.F5 // i'port >a4a=.s?ingN*ptionPane5 -Sass.;orNa'e(Jco' .'1sql.>(bc. Dri4erJ)5 -onnection con K (-onnection) Dri4er"anagerget-onnection(J>(bcH '1sqlH//localhostH %%&E/6ibrar1J3JrootJ3JreetaJ)5 State'ent st't K null5 ResultSet rs K null5 String SC6 K OS#6#-T O 8R*" PublisherJ5 st't HK concreateState'ento5 rs st't.e=ecuteCuer1(SC6)5 int pno K nteger.parselnt(t=tPno.getTe=t( ) Hri'())5 String PubNa'e K t=tPNa'e.getTe=t( )5 String PubA(( K t=tPA((getTe=t ()5 String PubPhl K t=tPhlgetTe=t()5 String PubPh, K t=tPh,getTe=t()5 String PStatus K t=tStatus.getTe=t()5 String strSC6K I Up(ate publisher set pub_na'e KOOM(PubNa'e)MJJ3 pub_a((ress K I (PubA(()MJ pub_phonel K IM(PubPh+)MJ3 pub_phone, K IM(PubPh,)MJ3 status K IM(PStatus)MJ ?here pub_i( M (pno)5 int ro?s#;;ecte( K st't.e=ecuteUp(ate(strSC6)5 i; (ro?s#;;ecte( KK &) N*ptionPanesho?"essageDialog(this3 IRecor( (oes not e=istsJ)5 else N*ptionPane.sho?"essageDialog(this3JRecor( 'o(i;ie(J)5 con.close( )5

st't.close()5 rs.ciose()5 B catch (#=ception e) @ N*ptionPanesho?"essageDialog(this3 e.get"essage())5 B B P"'lisher Delitio# *p"'DelUI)!a%a+

Source Code 1 P"'DelUi!a%a Use( -lass/Pac2agesH i'port >a4a.sql.F5 i'port >a4a=.s?ing .N*ptionPane5 i'port >a4a=.s?ing.De;ault6ist"o(el5 :lobal $ariables H State'ent st't K null5 ResultSet rs K null5 String SC6 IS#6#-T F 8R*" PublisherJ5 Delete1 Action#4ent Proce(ures pri4ate 4oi( c'(DeleteActionPer;or'e((>a4a a?t.e4ent.Action#4ent e4t) @ tr1@ -lass.;orNa'e(Oco'.'1sql.>(bc.Dri4erL)5 -onnection con K (-onnection)

Dri4er"anager.get-onnection(J>(bcH'1sqlH//localhostH%%*E/6ibrar1J3JrootJ3JreetaJ)5 st't K concreateState'ent()5 rs K st't.e=ecuteCuer1(SC6)5 int pno K nteger.parse nt(t=tPno.getTe=t().tri'())5 // Steps to con;ir' (eletion int opt K N*ptionPane.sho?-on;ir'Dialog(null3 IAre 1ou sure to (elete this recor( PJ)5 i; (opt KK N*ptionPane.#S_*PT *N) @ tr1@ char stb K ONL5 // "e'ber table String strSC6 IUp(ate publisher set status KIM(stb)MJ ?here pub_i( K I M (pno)5 int ro?s#;;ecte( K st't.e=ecuteUp(ate(strSC6)5 i; (ro?s#;;ecte( K K &) N*ptionPane.sho?"essageDialog(this3 IRecor( (oes not e=istsJ)5 else @ N*ptionPane.sho?"essageDialog(this3JRecor( Delete(J)5 // Te=t bo=es cleare( t=tPno.setTe=t(LJ)5 t=tPNa'e.setTe=t(IJ)5 t=tPA(( .setTe=t(JL)5 t=tPh + setTe=t(JJ)5 t=tPh,setTe=t(IJ)5 t=tStatus.setTe=t(J)5 t=tPno.set#(itable(true)5 B B catch (#=c e) @ N*ptionPane.sho?"essageDialog(nu l3 IUnable to (eleteJ)5 B B B catch (#=ception e) N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B E;it H Action#4ent Proce(ure pri4ate 4oi( c'(#=itActionPer;or'e((>a4a a?t.e4ent3Action#4ent e4t) @

this.set$isible(;alse)5 //ne? "ainU ( ).set$isible(true)5 'ouse clic2 e4ent Proce(ure H pri4ate 4oi( >6istl"ouse-lic2e((>a4a.a?t.e4ent."ouse#4ent e4t) @ // getselecte($alue() 'etho( e=tracts the current cursor location 4alue into a 4ariable String "Pub K (String) >ustl .getSelecte($alue()5 // #=tract the ;irst ! characters as roll nu'ber into a 4ariable String PubN K"Pub.tri'( ).substring(&3 %)5 String quer1 K S#6#-T F 8R*" Publisher <)#R# pub_ ( I M ubN M I5I5 tr1@ // -onnect to "1SC6 (atabase // Dont ;orget to i'port the t?o pac2ages // i'port >a4a.sql.F5 // i'port >a4a=.s?ing>*ptionPane5 - ass.;orNa'e(Jco'.'1sql.>(bc.Dri4erJ).ne? nstance( )5 -onnection con K (-onnection) Dri4er"anager.get-onnection(J>(bcH '1sql H//localhostH %%&E/6ibrar1J3 IrootJ3LreetaJ)5 // -reate SC6 state'ent an( e=ecute quer1. st't K con.createState'ent()5 rs K st't.e=ecuteCuer1(quer1)5 i; (rs.ne=t( )) @ //PubN K rs.getStrin1(Jpub_noL)5 String PubNa'e K rs getString( pub_na'e )3 String PubA(( K rs.getString(Jpub_a((ressJ)5 String PubPhl K rs.getString(Jpub_phonelJ)5 String PubPh, K rs.getString(Jpub_phone,J)5 String PStatus K rs.getString(JstatusJ)5 // Displa1ing the contents in respecti4e te=t bo=es. t=tPno. setTe=t(PubN)5 t=tPNa'e setTe=t(PubNa'e)5 t=tPA((.setTe=t(PubA(()5 t=tPhl.setTe=t(PubPhl)5 t=tPh,.setTe=t(PubPh,) t=tStatus.setTe=t(PStatus)5 t=tPno set#(itable(;alse) B else @

N*ptionPane sho?"essageDialog(null3 Recor( (oes not ;oun( in Stu(ent table )3 B catch (#=ception e) @ N*ptionPane sho?"essageDialog(this3 e get"essage( ))5 B B 8ro' loa( proce(ureH pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a a?t e4ent <in(o?#4ent e4t) @ t=tPno set#(itable(;alse)3 // -reating a 6ist"o(el ob>ect ("o(el to per;or' De;ault6ist"o(el // 'etho( operations De;ault6ist"o(el ("o(el K (De;ault6ist"o(el) >6istl .get"o(el( )5 // "etho( to a(( ele'ents into >6istl control ("o(el.clear( )5 tr1@ -lass. orNa'e(Lco'.'1sql.>(bc. Dri4erJ)5 -onnection con (-onnection) Dri4er"anager.get-onnection(I>(bcH '1sqlH//localhost/%%&E/6ibrar1J3JrootJ 3 IreetaJ)5 st't K con.createState'ent( )5 rs K st't.e=ecuteCuer1(SC6)5 ?hile (rs.ne=t()) @ String Pno K rs.getString(Ipub_i(J)5 String PNa'e K rs.gctString(Ipub_na'eJ)5 // To 'a2e the publisher no. as ! (igit because ?e ?ill e=tract ! (igit ;ro'list 4alue //in 'ouse clic2 e4ent. i; (Pno.length() Q !) @ int = K Pno.length()5 intt ni K ! 0 =5 ?hile (nl R &)@ Pno K Pno MJ J5 nl005 B B ("o(el.a((#le'ent(Pno M M PNa'e)5

B >6ist+.set"o(el(("o(el)5 con.close()5 B catch (#=ception e) @ N&ptionPane.sho?"essageDialog(this3e.get"essage( ) )5 e. printStac2Trace( ) B B P"'lisher Na%i$atio# *P"'Na%UI)!a%a+

Source -o(eH PubNa4Ui>a4a usse( -lass/Pac2ages i'port >a4a3sql.F5 i'port >a4a=.s?ing.N*ptionPane5 :lobal $ariables an( a 'etho( State'ent st't K null5 ResultSet rs K null5 String SC6 IS#6#-T F 8R*" publisherJ public 4oi( (isable te=t;iel(s() @ t=tPno.set#(itable(;alse)3 t=tPNa'e.set#(itable(;alse)5 t=tPA(( .set#(itable(;alse)5 t=tPhl .set#(itable(;alse)5 t=tPh,.set#(itable(;alse)3 t=tStatus . set#(itable(;alse)5 B

8irst Action#4ent Proce(ures pri4ate 4oi( c'(8irstActionPer;or'e((>a4a .a?t.e4ent.Action#4ent e4t) @ @ -lass.;orna'e(Ico'.'1sql.>(bc.Dri4erJ)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(J>(bcH '1sqlH//localhostH%%&E/6ibrar1J3JrootL3JreetaJ)5 i; (rs.;irst()) @ String PubN K rs.getString(Jpubi(J)5 String PubNa'e K rs.getString(Jpub_na'eJ)5 String PubA(( K rs.getString(Lpub a((ressL)5 String PubPhl K rs.getString(Jpub phone+J)5 String PubPh, K rs.getString(Jpub phone ,J)5 String PStatus K rs.getString(JstatusJ)5 // Displa1ing the contents in respecti4e te=t bo=es. t=tPno.setTe=t(PubN)5 t=tPNa'e3setTe=t(PubNa'e)5 t=tPA(( .setTe=t(PubA(()5 t=tPh + setTe=t( PubPh +)5 t=tph,setTe=t(PubPh,)5 t=tStatus.setle=t(PStatus)3 c'( 8irst. set#nable( (;alse)5 c'(Ne=t.set#nable((true)5 c'( Pre4. set#nable( (;alse)5 c'(6ast.set#nable((true)5 B else @ c'( 8irst. set#nable( (;alse)5 c'( Ne=t. set#nable( (;alse)5 c'(Pre4.set#nable((;alse)5 c'(6ast.set#nable((;alse)5 N*ptionPane.sho?"essageDialog(this3 IRhere is no recor( in tableJ3 IStu(entJ3*)5 B Bcatch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage( ))5 Ne=t Action#4ent Proce(ures

pri4ate 4oi( c'(Ne=tAction Per;or'e((>a4a .a?t. e4ent.Action#4ent e4t) @ tr1@ -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erJ)5 -onnection con (-onnection) Dri4er"anager.get-onnection(J>(bcH '1sqlH//localhostH %%&E/6ibrar1L 3IrootJ3J reetaJ)5 i; (rs.ne=t()) @ String PubN K rs3getString(Jpub_i(J)5 String PubNa'e K rs.getString (Ipub na'eJ)5 String PubA(( K rs.getStrinq(Jpub a((ressJ)5 String PubPhl K rs.getString(Jpub_phone+J)5 String PubPh, K rs.getString(Jpub phone,L)5 String PStatus K rs.getString(JstatusJ)5 // Displa1ing the contents in respecti4e te=t bo=es. t=tPno. setTe=t(PubN)5 t=tPNa'e.setTe=t(PubNa'e)5 t=tPA(( .setTe=t(PubA(()5 t=tPh + .setTe=t(PubPh +)5 t=tPh, .setTe=t(PubPh,)5 t=tStatus setTe=t( PStatus)5 c'(8irst.set#nable((true)5 c'(Ne=t.set#nable((true)5 c'(Pre4.set#nable((true)5 c'(6ast.set#nable((true)5 B else @ c'(Ne=t.set#nable((;alse)5 N*ptionPane.sho?"essageDialog(this3 I.ou are at last recor( positionJ3Jstu(entJ3&) 5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage( ))5 B B #=it Action#4ent Proce(ure pri4ate 4oi( c'(#=itActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ this3set$isible(;alse)5 B Pre4ious Action#4ent Proce(ures

pri4ate 4oi( c'(PrActionPer;or'e((>a4a .a?t.e4ent.Action#4ent e4t) @ tr1@ -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erJ)5 -onnection c K (-onnection) Dri4er" iager.get-onnection(J>(bcH '1sqlH//localhostH%%&E/6ibrar1J3JrootJ5JreetaJ)5 i; (rs.pre4iou ( )) @ String PubN K rs.getString(Jpub_i(J)5 String PubNa'e K rs.getString(Jpub_na'eL)5 String PubA(( rs.getString(Jpub_a((ressJ)5 String PubPhl K rs.getString(Jpub_phonelJ)5 String PubPh, K rs.getString(Jpubphone,J)5 String PStatus K rs. getString(JstatusJ)5 // Displa1ing the contents in respecti4e te=t bo=es. t=tPno.setTe=t(PubN)5 t=tPNa'e3setTe=t(PubNa'e)5 t=tPA((.setTe=t(PubA(()5 t=tPh + .setTe=t( PubPh +)5 t=tPh,.setTe=t(PubPh,)5 t=tStatus.setTe=t(P c'(8irst.set#nable((true)5 c'(Ne=t.set#riable((true)5 c'(Pre4.set#nable((true)5 c'(6ast.set#nable((true)5 B else @ c'(Pre4.set#nable((;alse)5 N*ptionPane.sho?"essageDialog(this3 .ou are at ;irst positionJ3 IStu(entJ3*)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage( ) )5 B 6ast Action #4ent Proce(ures Dri4ate 4oi( c'(6astActionPer;or'e((>a4a .a?t.e4entAction#4ent e4t) @ tr1@ -lass.;orNa'e(Jco' '1sql.>(bc. Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(L>(bcH '1sqlH//localhostH%%&E/6ibrar1J3LrootJ )5 i; (rs.last( )) @

String PubN rs.getString(Jpub>(J)5 String PubNa'e K rsgetString(Jpub_na'eJ)5 String PubA(( K rs.getString(Jpuba((ressJ)5 String PubPhl K rs.getString(Jpub_phone+J)5 String PubPh, K rs.getString(Jpub_phone,J)5 String PStatus K rs.getString(JstatusL)5 / Displa1ing the contents in respecti4e te=t bo=es. t=tPno3setTe=t(PubN)5 t=tPNa'e.setTe=t(PubNa'e)5 t=tPA(( . setTe=t(PubA(()5 t=tPh + .setTe=t(PubPhl)5 t=tPh, .setTe=t(PubPh,)5 t=tStatus . setTe=t( PStatus)5 c'(8irst.set#nable((true)5 c'(Ne=t.set#nable((;alse)5 c'(Pre4.set#nable((true)5 c'(6ast.set#nable((;alse)5 B else @ N*ptionpane .sho?"essageDialog(this3 I.ou are alrea(1 at last recor(J3 IStu(entJ3*)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B 8R*" loa( proce(ure pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a .a?t.e4ent. <in(o?#4ent e4t) @ (isable_te=t;iel(s()5 tr1@ -lass.;orNa'e(Jco' .'1sql3>(bc. Dri4erJ)5 -onnection con K (-onnection) Dri4er"anager.getconnection(L>(bcH '1sqiH//localhostH%%&E/6ibrar1J3rootJ3LreetaJ)5 st't K con.createState'ent()5 rs K st't.e=ecuteCuer1(SC6)5 i; (rs;lrst( )) @ String PuhN K rs.getString(Ipub_ i(J)5 Strnig PubNa'e K rs.getString(Ipub_ na'eJ)5 String >bA(( rsgetString(pub _a((ressJ)5

String PubPhl rsgetString(pub_ phone+L)5 String PuoPh, K rs.getString(Jpub_ phone,J) String PStatus K rs.getString(IstatusJ)5 // Dispia1 the contents in respec(4e te=t bo=es. t=tpno.setTe=t( PubN)5 t=tPNarne.setTe=t(PubNarne)5 t=tPA(( setTe=t(IPubA((J) t=tPhl.setTe=t(PubPh +)5 t=tph,.setTe=t(PuhPh,)5 t=tStatus.setTe=t(PStatus)5 c'(8irstset#nahle((;alse)5 c'(Ne=tset#nable((true)5 c'(Pre4.set#nable((;alse)5 c'(6ast.set#nable((true)5 B else@ c'( 8irst. set#nab le( (;alse)5 c'( Ne=t set#nable( (;alse)5 c'(Pre4.set#nable((;alse)5 c'( 6ast. set#nable((;alse)5 N*ptionPane.sho?"essageDialog(this3 IRhere is no recor( in tableJ3 IStu(entJ3&)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage( ))5 B B (oo, Co#sole1* 5i'UI)!a%a+

So"rce Co e1 5i'UI)!a%a use( -lass/Pac2ages i'port >a4a.sql.F5 i'port >a4a=.s?ing.G*ptionPane5 irnport >a4a=3s?ing.De;ault6ist"o(el5 : oba6 $ariablesH //;or table 6ib state'ent st't K null5 ResultSet rs K null5 STR N: SC6 K S#6#-T F 8R*" 6ibJ5 // ;or table Publisher sate'ent st'tl K null5 ResultSet rsl K null5 String SC6+ S#6#-T F 8R*" publisher5 E;it H Action#4ent Proce(ureH pri4ate 4oi( c'(#=itActionper;or'e((>a4a.a?t.e4e;lt.Acti*;l#$e;lt e4t) @ this. set $isible (;alse) B E it 1Action#4ent Proce(ureH pri4ate 4oi( crn(#(itActionPer;orrne((>a4a.a?t.e4ent.Action#$ent e4t) @ this.set$isible(;alse)5 ne? 6ib#(itU ( ).set$isible(true)5 B

Sa%e HAction#4ent Proce(ure pri4ate 4oi( c'(Sa4eActionPer;or'e((>a4a.a?t.e4ent.Acti*n#4ent e4t) @ tr1@ -lass. ;orNa'e( corn. '1sql .>(bc. Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(>(bcH '1sql H//localhostH %%&E/6ibrar1J3JrootJ3TreetaL)5 st't K con.createState'ent( )5 rs K st't.e=ecuteCuer1(SC6)5 int Acno K nteger.parselnt(t=tAcno.getTe=t*.tri'( ))5 String bTitle K t=tBTitle.getTe=t( )5 String Auth+ K t=tAuth+.getTe=t( )5 String Auth, K t=tAuth,.getTe=t( )5 // -reating a String ob>ect pNarne String pNa'e K (String) >-o'boBo=l .getSelecte(lte'( )5 // #=tract the ;irst ! characters as publisher nu'ber into a 4ariable String PubNo K String.4alue*;(pNarne.substring(*3 %).tri'( ))5 int pno K nteger.parselnt(PubNo)5 >6abell*.setTe=t(Mpno)5 ;loat Price K 8loat.parse8loat(t=tPrice.getTe=t( ))5 int pages K nteger.parselnt(t=tPages.getTe=t( ))5 int e(ition K nteger.parselnt(t=t#(ition.getTe=t( ))5 String P(ate K t=tPDate.getTe=t( )5 char BStatus K O.L5 int co(e K N*ptionPane.sho?-on;ir'Dialog(this3 OAre 1ou sure to a((PL3 I-on;ir'ation Dialog Bo=J3 N*ptionPane..#S_N*_-AN-#6_*PT *N3 N*ptionPane. N8*R"AT *N "#SSA:#)5 i; (co(e K K N*ptionPane..#S *PT *N) @ String strSC6 K I NS#RT NT* 6ib(acc_no3 btitle3 authorl3 author,3 pub_i(3 price3 p(ate3 pages3 e(ition3 status) $A6U#S (IM(Acno)MJ3 IM(bTitle)MJ3 IM(Authl)M OIM(Auth,)MJ3 IM U IM(Price)MJ3 OIM(P(ate) MJ IM(pages)MJ3 IM(e(ition)MJ3 OIM(BStatus)MJ)5 int ro?s#;;ecte( K st't.e=ecuteUp(ate(strSC6)5 G*ptionPane.sho?"essageDialog(this3 Recor( a((e( success;ull1 into 6ib tableJ)5 B c'(Sa4e.set#nable((;alse)5 B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage( ))5

B B ONe& Action#4ent Proce(ure pri4ate 4oi( c'(Ne?ActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ // Acti4ate the Sa4e button ?hen Ne? button presse( c'(Sa4e.set#nable((true)5 De;ault-o'boBo="o(el c"o(el K (De;ault-o'boBo="o(el) >-o'boBo=l .get"o(el( )5 c"o(el. re'o4eAll#le'ents( )5 t=tStatus.set#(itable(;alse)5 //Acti4ate the Sa4e button ?hen Ne? button clic2e( c'(Sa4e.set#nable((true)5 tr1 @ -lass.;orNa'e(Jco'.'1sql.>(bc. Dri4er)5 -onnection con K (-onnection) Dri4er"anager.get-onnection( '1sqlH//localhostH %%&E/6ibrar1J3 IrootJ3 IreetaJ)5 st't K con.createState'ento5 // -onnection string ;or ResultSet 0 rs. rs K st't.e=ecuteCuer1(SC6)5 int acnoK&3 A-N* K &5 // To generate auto'atic accession no. ?hile (rs.ne=t( )) @ A-N* K rs.getlnt(Jacc_noJ)5 B A-N*M M5 acno K A-N*5 t=tAcno.setTe=t( nteger.toString(acno))5 st't K con.createState'ento5 ?hile (rs+.ne=t( )) @ String pubno K rs+.getString(Ipub_i(J)5 String pubNa'e K rsl.getString(Jpub na'eJ)5 // To 'a2e the p iblisher no. as ! (igit because ?e ?ill e=tract ! (igit ;ro' list // in 'ouse clic2 e4ent t=tStatus.setTe=t( I.J)5 // Because it is a ne? boo23 ?hen it ?ili be issue3 // itLs status ?ill be N. i; (pubno.length( Q !) @ int = K pubno.length To list publishers in >-o'boBo=i co'ponent rslK st't+.e=ecuteCuer1(SC6+)5

int n K ! 0 ?hile (n R &) @ pubno K pubno M IJ5 nl005 B B c"o(el.a((#le'ent(pubno M I0 I M pubNa'e)5 B B catch (#=ception e) @ N&ptionPane.sho?"essageDialog(this3e.get"essage( ))5 e.printStac2Trace( )5 B B Clear H Action#4ent Proce(ureH pri4ate 4oi( c'(-learActionPer;or'e((>a4a.a?t.e4ent.Action#4erit e4t) @ De;ault-o'boBo="o(el c"o(el K (De;ault-o'boBo="o(el) >-o'boBo=l.get"o(el( )5 t=tAcno .setTe=t(JJ)5 t=tBTitle.setTe=t(JL)5 t=tAuth + .setTe=t(LJ)5 t=tAuth,.setTe=t(JJ)5 c"o(el. re'o4eAll#le'ents()5 t=tPrice setTe=t(IJ)5 t=tPages.setTe=t t=t#(ition.setTe=t()5 t=tPDate.setTe=t( IJ)5 t=tStatus. setTe=t(J)5 c'(Sa4e set#nable( (;alse)5 B 8or' loa( proce(ure pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a.a?t.e4ent.<in(o?#4ent e4t) @ t=tAcno.set#(itable(;alse)5 // Deacti4ate the Sa4e button ?hen ;or' loa(s c'( Sa4e set# nable( (;alse)5 B Delete 1 Action#4ent Proce(ureH

pri4ate 4oi( c'(DeleteActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ this.set$isible(;alse)5 ne? 6ibDelU ( ).set$isible(true)5 (oo, Mo ificatio# *5i'E itUi!a%a+

So"rce Co e1 5i'E itUi!a%a Use( -lass/Pac2ages i'port >a4a.sql.F5 i'port >a4a=.s?ing.N*ptionPane5 i'port >a4a=.s?ing.De;au;t6ist"o(el5 i'port >a4a=s?ing.De;ault-o'boBo="*(e 5 :loba $ariables //;or table Publisher State'ent st't K null5 ResultSet rs+ K null5 String SC6+ K IS#6#-T F 8R*" publisher5 State'ent st't K null5 ResultSet rs K null5 String SC6 K OS#6#-T F 8R*" 6ibJ5 Up ate 1Action#4ent Proce(ures

pri4ate 4oi( c'(Up(ateActionPer;or'e((>a4a.a?te4e;lt.Action#4ent e4t) @ tr1 @

-lass.;orNa'e(Jco' .'1sql.>(bc.Dri4erJ)5 -onnection con K (-onnection) Dri4er"anager.get-onnectio;l(L>(b- '1sqlH//localhostH%%&E/6ibrar1J3JrootJ3JreetaJ)5 st't K con.createState'ent( )5 rs K st't.e=ecuteCuer1(SC6)5 int Acno K nteger.parse String bTitle K t=tBTitle. getTe=t( )5 String Auth+K t=tAuthl.getTe=t( )5 String Auth, K t=tAuth,3getTe=t()5 // -reating a String ob>ect pNa'e String pNa'e K (String) >-o'boBo=.getSelecte(lte'( )5 // #=tract the ;irst ! characters as publisher nu'ber into a 4ariable String NPubNo K String.4alue*8(pNa'e.substrinb(&3%)tri'( ))5 int Npno K nteger.parse nt(NPubNo)5 int P D K nteger.pars .parse nt(t=tP D)5 i;(Npno SK P D) P D K Npno5 ;loat Price K 8loat.parse8loat(t=tPrice.getTe=t( ))5 int pages K nteger.parselnt(t=tPages.getTe=t( ))5 int e(ition K nteger. parse nt(t=t#(ition .getTe=t())5 String P(ate K t=tPDate .getTe=t( )5 String BStatus K t=tStatus. getTe=t()5 String strSC6 K IUp(ate 6ib set btitle KOOM(bTitle)MJL3 authori K IM(Authl)U auth K IM (Auth,)MJ3 pub i( K OM(P D)0+0J3 priceK IM(price)MJp(ate K IM(P(ate)MLL3 pages K I0h(pages)M I3 e(ition K M(e(ition)M3 status K IM(BStatus)MJ ?here acc no K I M (Acno)5 int ro?s#;;ecte( K st't.e=ecuteUp(ate(strSC6)5 i; (ro?s#;;ecte( K K &) N*ptionPane .sho?"essageDialog(this3 ORecor( (oes not e=istsJ)5 else N*ptionPane3sho?"essageDialog(this3LRecor( 'o(i;ie()5 catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage( ))5 B B 8or' loa( proce(ure pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a.a?t.e4ent.<in(o?#4ent e4t) @ t=tAcno .set#(itable(;alse)5

t=tP D .set#(itabie(;alse)5 t=tStatus. set#(ita bie(;alse)5 // -reating a 6ist"o(el ob>ect ("o(el to per;or' De;ault6ist"o(el // 'etho( operations De;ault6ist"o(el ("o(el K (De;ault6ist"o( >6istl .get"o(el()5 // "etho( to a(( ele'ents into >6istl control ("o(e6clear( )5 tr1 @ -lass. ;orN a'e( corn '1sqi.>(bc. Dri4erL) -onnection con K (-onnection) Dri4er"anager.get-onnection(I>(bcH'1sqlH//localhostH%%&E/6ibrar1 I3JrootJ3reeta)5 st't K con.createState'ent()5 rs Kstrnte=ecuteCuer1(SC6)5 ?hile (rs3ne=t()) @ String Ano K rs.getString(Iacc_noJ)5 String BTitle K rs.getStrHng(IBTitleJ)5 // To 'a2e the Accession no. as ! (igit because ?e ?ill e=tract ! (igit ;ro' list 4alue //in 'ouse clic2 e4ent. i; (Ano.length() Q !) B int = K Ano. ength()5 int nl K ! 0 =5 ?hile (ni R *)@ AnoKAnoV I5 D"o(e6a((#le'ent(Ano M I0 M BTitle)5 B >6istl .set"o(el(("o(el)5 // To list the publisher i( an( na'e into N-o'boBo=l. De;ault-o'boBo="o(el c"o(el K (De;ault-o'boBo="o(el) >-o'boBo=l.get"o(elC5 c"o(e6re'o4eAl(#le'ents()5 st'tl K con.createState'ent()5 // To list publishers in i-o'boBo=i co'ponent rsl K st'tl.e=ecuteCuer1(SC6+)5 ?hile (rsl.ne=t()) @ String pubno K rsl.getString(Ipub_i(J)5 String pubNa'e K rsl.getString(Ipub_ na'eL)5 // To 'a2e the publisher no. as ! (igit because ?e ?ill e=tract ! (igit ;ro' list 4alue // in 'ouse clic2 e4ent

t=tstatus.setTe=t(J.J)5 // Because it is a ne? boo23 ?hen it ?ill be issue3 // its status ?ill be N. i; (pubno.length() Q !) @ int = K pubno3length()5 int nl K ! 0 =5 ?hile (nl R&)@ pbno K pbnoMJJ5 nl005 B B c"o(el.a((#le'ent(PbnoMJ0IMPubna'e)5 B Bcatch (#=ception e)@ N*ptionPane.Sho?"essageDialog(this3e.get"essage())5 e.printStac2Trace()5 B B E;it Action#4ent Proce(ure pri4ate 4oi( c'(#=itActionPer;or'e((>a4a .a?t. e4ent.Action#4ent e4t) @ this.set$isible(;alse)5 B "ouse clic2 e4ent Proce(ure pri4ate 4oi( >6istl"ouse-lic2e((>a4a.a?t.e4ent."ouse#4ent e4t) @ // getSelecte($alue() 'etho( e=tracts the current cursor location 4alue String "Boo2 K (String) >6istl.getSelecte($alue()3 // #=tract the ;irst ! characters as Accession nu'ber into a 4ariable String Acno K"Boo2.tri'().substring(*3 %)5 String quer1 K IS#6#-T F 8R*" 6ib <)#R# accno K M Acno M I5J5 tr1 @ -lass .;orNa 'e( corn '1sql.>(bc. Dri4erL) ne?lnstance()5 -onnection con K (-onnection) Dri4er"anager.get-onnection(J>(bcH//localhostH %%&E/6ibrar1J3JrootJ3JreetaJ)5 // -reate SC6 state'ent an( e=ecute quer1. st't K con.createState'ent()5

rs st't.e=ecuteCuer1(quer1)5 i; (rs3ne=tC) @ String bTitle K rs.getString(JbtitleJ) String Authl K rs.getString(JauthorJ) String Auth, K rs.getString(Lauthor,)5 String P D K rs.getString(Lpub>(L)5 String Price K rs.getString(LpriceJ)5 String PDate K rs.getString(Jp(ate)5 String pages K rs.getString(JpagesJ) String e(ition K rs.getString(Le(itionJ) String PStatus K rs. getString(LstatusL)5 // Displa1ing the contents in respecti4e te=t bo=es. t=tAcno.setTe=t(Acno)5 t=tBT itle.setTe=t(bTitle)5 t=tAuth + .setTe=t(Auth +)5 t=tAuth,.setTe=t(Auth,)5 t=tP D.setTe=t(P D)5 t=tPrice. setTe=t( Price)5 t=tPD t=tPages. setTe=t( pages)5 t=t#( ition .setTe=t(e(ition)5 t=tStatus.setTe=t( Status)5 // -lose the operaional ob>ect ;or Stu(ent con.close()5 st't.close()5 rsclose()5 B else @ N*ptionPane.sho?"essageDialog(null3 IRecor( (oes not ;oun( in Stu(ent tableL)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDia og(th e.get"essage())5 B B

(oo, Deletio#* 5i'DelUl)!a%a+

So"rce Co e1 5i'DelUl)!a%a
Use( -lass/Pac2ages i'port >a4a.sql.F5 N i'port >a4a=.s?ing.N*ptionPane5 i'port >a4a=.s?ing.De;ault6ist"o(el5 :lobal $ariables State'ent st't K null5 ResultSet rs K null5 String SC6 K IS#6#-T F 8R*" libJ5 Delete Action#4ent Proce(ures pri4ate 4oi( c'(DeleteActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ tr1@ -lass .;orNa'e(Jco' .rn1sql.>(bc.Dri4erJ)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(J>(bcH '1sqlH//localhostH %%&E/6ibrar1J3LrootJ3JreetaL)5 st't K con.createState'ent()5 rs K st't.e=ecuteCuer1(SC6)5 int Ano K nteger.parsolnt(t=tAcno.getTe=t().tri'())5 // Steps to con;ir' (eletion int opt K N*ptionpane.sho?-on;ir'Dialog(null3JAre 1ou sure to (elete this recor( PI)5 i; (opt KK N*ptionPane3.#S *PT *N) @ tr1@

i; (t=tStatus.getTe=tC.contains(.)) String strSC6 K ODelete ;ro' 6ib ?here acc_no K I M (Ano)5 int ro?s#;;ecte( K st't.e=ecuteUp(ate(StrSC6)W i; (ro?s#;;ectec( K &) N*ptionPane.sho?"essageDialog(this IRecor( (oes not e=ists)5 else @ B N*ptionPane.sho?"essageDialog(this ORecor( Delete(J)5 B else N*ptionPane. sho?"essageoiaiog (this3 IRecor( cannot be (elete(3 because status is ONJ)5 B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(null3 IUnable to (eleteJ)5 B B con.close()5 st't.close()5 rs.close()5 B catch (#=ception e) @ N*ptionPane.sho?"essageD>alog(this e.get"essage())5 B E;it Action#4ent Proce(ure pri4ate 4oi( c'(#=itActionPer;or'e((>a4a .a?t. e4ent.Action#4ent e4t) @ this.set$isible(;alse)5 "ouse clic2 e4ent Proce(ure pri4ate 4oi( >6istl"ouse-lic2e((>a4aa?te4en;"ouse#4ent e4t) @ // getSelecte(4alue() 'etho( e=tracts the current cursor location 4alue into a 4ariable String "Boo2 (String) >6istl.getSelecte(4alue()5 // #=tract the ;irst ! characters as Accession nu'ber into a 4ariable String Acno KO"Boo2.tri'().substring(o3 %)5 String quer1 K IS#6#-T F 8R*" 6ib <)#R# acc_no I M Acno M I5I5 tr1@ -lass. ;o rN a 'e (Icorn. '1sq .>( bc. Dri4erJ) .ne? nsta nce()5 -onnect>on con (-onnection)

Dri4er"anager.get-onnection(J>(bcH '1sqlH//localhostH %%&E/6ibrar1J3LrootJ3JreetaL)5 // -reate SC6 state'ent an( e=ecute quer1. st't K con.createState'ent()5 rs K st't.e=ecutCuar1(quer1)5 i; (rsne=t()) @ String bTitle K rs. getString( IbtitleL)5 String Auth + K rs.getString(Jauthor+J)5 String Auth, K rs.getString(Jauthor,J)5 String P D K rs.getString(Jpubi(J)5 String Price rs.getString(JpriceJ)5 String PDate K rs.getString(Ip(ateJ)5 String pages K rs.getString(LpagesJ)5 String e(it K rs.getStrinq(e(itionJ)5 String PStatus K rs.getString(JstatusJ) // Displa1ing the contents in respecU4e te=t bo=es. t=tAcno . setTe=t(Acno)5 t=tBlitle.setTe=t(bTitle)5 t=tAuthl.setTe=t(Authl)5 t=tAuth ,. setTe=t(Auth ,)5 t=tPl D.setTe=t(P D)5 t=tPr t=tPDate.setTe=t(PDate)5 t=tPages setTe=t(pages)5 t=t#(ition .setTe=t(e(ition)5 t=tStatus .setTe=t(PStatus)5 // -lose the operational ob>ect ;or Stu(ent con.ciose()5 st't close()5 rs.close() B else @ N*ptionPane.sho?"essageDiatog(nutl3 ORecor( (oes not ;oun( in Stu(ent tableJ)5 B B catch (#=ception e)@ >*ptionPanesho?"essageDiatog(this3 eget"essage())5 B 8or' loa( proce(ure pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a3a?t.e4ent.<in(o?#4ent e4t) @ t=tAcno.set#(itabie(;alse)5

t=tPl D . set#( i tab a (;alse)5 t=tStatus .set#(itabie(;alse)5 // -reating a 6ist"o(e ob>ect ("o(el to per;or' De;ault6ist"o(el // 'etho( operations De;ault6ist"o(ei ("o(el K (De;au;t6ist"o(el) >6istl3get"o(el()5 /+/ "etho( to a(( ele'ents into >6istl control ("o(el3ciear()3 tr1 @ -lass. ;o rN a 'e (Icorn. '1sq .>( bc. Dri4erJ)5 -onnect>on con (-onnection) Dri4er"anager.get-onnection(J>(bcH '1sqlH//localhostH %%&E/6ibrar1J3LrootJ3JreetaL)5 st't K con.createState'ent()X5 rs K st't.e=ecuteCuer1(SC6)5 ?hile (rs.ne=t()) @ String Ano K rs.getString(Iacc_noJ)5 String BTit e K rs.getString(IbtitleJ)5 // To 'a2e the Accession no. as ! (igit because ?e ?ilt e=tract ! (igit ;ro' 5/ list 4alue in 'ouse clic2 e4ent. i; (Ano.length() Q !) @ int = K Ano.length()5 i nt nl K ! 0 =5 ?hile (nl R&)@ Ano K Ano MIJ5 nl005 B B ("o(ei.a((#le'ent(Ano M 0 I M BTitle)5 B >6istl .set"o(el(("o(el)5 B catch (#=ception e) @ N*ptionPanesho?"essageDialog(this3e.get"essage())5 e. printStac2Trace()5 B B

(oo, Iss"e *Iss"eUl)!a%a+

So"rce Co e1 Iss"eUl)!a%a
Use( -lass/Pac2ages i'port >a4a.sql.F5 i'port >a4a=.s?ing.N*ptionPane5 i'port >a4a=.s?ing.De;ault6ist"o(el5 :lobal $ariables State'ent st't K null5 ResultSet rs K null5 char sti K ONL5 char 's K ON5 String SC6 K IS#6#-T F 88*" "e'ber <)#R# 'e'_issue K IMst+MJ an( 'e'_status KJM 's MJJ5 State'ent st'tl K null5 ResuitSet rsl K null5 char st K O.L5 // 6ib table String SC6+ K S#6#-T F 8R*" 6ib <)#R# status O M St MJ5J5 State'ent st't, K null5 ResultSet rs, K null5 String SC6, K IS#6#-T F 8R*" "issue5 State'ent st't% K null5 ResuitSet rs% K null5 String SC6% IS#6#-T F 8R*" TissueL5

"ouse clic2 e4ent Proce(ure pri4ate 4oi( >6istl"ouse-lic2e((>a4aa?t.e4ent."ouse#4e;lt e4t) @ // getSelecte($alue() 'etho( e=tracts the current cursor location 4alue into 4ariable String "e'bNo K (String) >6istl.getSelecte($alue()5 // #=tract the ;irst ! characters as "e'ber No into a 4anable String "no K"e'bNo.tri'( ).substring(*3 %)5 String quer1 K IS#6#-T 8R*" "e'ber <)#R# 'e'b_no I M ("no) tr1 @ -lass ;orNa 'e( Icorn '1sql3>(bc. Dri4erJ). ne?lnstance()5 -onnection con (-onnection) Dri4er"anager.get-onnection(J>(bcH '1sq locahostH %%&E/6ibrar1J3JrootJ3JreetaJ)5 // -reate SC6 state'ent an( e=ecute quer1 st't K con.createState'ent()5 rs K st't.e=ecuteCuer1(quer1)5 i; (rs.ne=t())@ String "Na'e rs.getString(J'e'b_na'eJ)5 String "Date K rsgetString(J'(ateJ)5 String "Status K rs.getString(J'e'_statusJ)5 // Displa1ing the contents in respecti4e te=t bo=es. t=t" No. setTe=t( "n o)5 t=t"Na'e.setTe=t("Na'e)5 t=t" Date .setTe=t(" Date)5 t=t"Status.setTe=t("Status)5 B else N*ptionPane.sho?"essageDialog(nu l3 IRecor( (oes not ;oun( in "e'ber tableJ)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B 8or' loa( proce(ure pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a 3a?t.e4ent.<in(o?#4ent e4t) @ t=t"No .set#(ita ble(;alse)5 t=t" Na'e setS ( ita b e(;alse)5 t=t"Date.set#(ita ble(;alse)5 t=t"Status. se;#(itable(;alse)5

t=tAcno.set#(itabie t=tBTitie .set#(itable(;ase)5 t=tAuth + .set#(itable(;alse)5 t=tPl D set#( ta b e (;alse)5 t=tStatus .set#(itable(;a se)5 // ("o(el to per;or' De;ault6ist"o(el ;or "e'ber // 'etho( operations De;ault6ist"o(e ("o(el K (De;ault6ist"o(el) >6istl.get"o(el()5 // "etho( to a(( ele'ents into >usti control ;or 'e'ber ("o(el.clear()5 tr1 @ -lass.;orNa'e( -onnection conK(-onnection) Dri4er"anager.get-onnection(J>(bcH'1sgqlH//localhostH%%&E//6ibrar1JrootJ3reeta J)5 // 6isting "e'bers st't K con.createState'ent()5 rs K st't.e=ecuteCuer1(SC6)5 ?hile (rs.ne=t()) @ String "no K rs.getStri ((J'e'b_noJ)5 String "Na'e K rs.getString(J'e'b na'eJ)5 // To 'a2e the "e'ber no. as ! (igit because ?e ?ill e=tract ! (igit ;ro' list 4alue // in 'ouse (ic2 e4ent. i; ("no.length() Q !) @ nt = K "no. ength()5 nt ni K ! 0 =5 ?hile (ni R&)@ "no K "no MJJ5 ni005 B B ("o(el.a((#ie'ent("no 0i0 I0 M "Na'e)5 >6istl .set" o(el( ("o(el)5 // c"o(ei to per;or' De;ault6ist"o(el ;or 6ibrar1 // 'etho( operations De;ault6ist"o(el c"o(el (De;auit6ist"o(el) >6ist,get"o(elC5

// "etno( to a(( ele'ents into >6is( control ;or 6ibrar1 c"o(el.clear*3 // 6isting boo2s st'tl K con.createState'ent()5 rsl K st'tl .e=ecuteCuer1(SC6+)5 ?hile (rslne=t()) @ String Ano K rsl.getString( acc_noL)5 String BTitle K rsl.getString(JbtitieL)5 // To 'a2e the Accession no. as ! (igit because ?e ?ill e=tract ! (igit ;ro' list 4alue // in 'ouse clic2 e4ent. i; (Anolength() Q !) @ int = K Ano. ength()5 int ni ! 0 =5 ?hile (nl R&)@ Ano K Ano MJJ5 nl005 B B c"o(el.a((#le'ent(Ano M O0 I 0i0 BTitle)5 B >6ist,set"o(e (c"o(el)5 B catch (#=ception e) @ N*ptionpane.sho?"essageDialog(this3e3get"essage())5 e.printStac2Trace()5 B B EXITAction#4ent Proce(ure5 pri4ate 4oi( c'(#=itActionPer;or'e((>a4a.a?t.e4ent.Action e4ent(; e4t)@ this.set$isible(;alse)5 B "ouse clic2 e4ent Proce(ure pri4ate 4oi( >6ist,"ouse-lic2e((>a4a.a?t.e4ent."ous#4ent e4t)@ // getSelecte($alue() 'etho( e=tracts the current cursor location 4alue into a 4ariable String "Boo2 K (String) >6ist,.getSelecte($alue()5 // #=tract the ;irst ! characters as Accession nu'ber into a4ariable String Acno K"Boo2.tri'().substring(&3 %)5 String quer1 K S#6#-T F 8R*" 6ib <)#R# acc_no K I M AcnoMJ5

tr1 @ -lass.;orNa'e(Jco' . '1sql.>(bc. Dri4erJ). ne?lnstance()5 -onnection con K (-onnection) Dri4er"anager.get-onnecton(>(bcH'1sqlH// localhostH%%&E/6ibrar1J3JrootJ3JreetaJ)5 / . / -reate SC6 state'ent an( e=ecute quer1 st't+ K con.createState'ent()5 rs K st't +.e=ecuteCuer1(quer1)5 i; (rsl.ne=t()) @ String bTitle K rs+.getString(IbtitleJ)5 String Auth+ K rs+.getString(Iauth+J)5 String P DKrsl.getString(Ipub_i()5 String PStatus K rsl .getString(JstatusJ)5 // Displa1ing the contents in respecti4e te=t bo=es . t=tAcno .setTe=t(Acno)5 t=tBTitle. setTe=t( bTitle)5 t=tAuth + .setTe=t(Auth +)5 t=tP D.setTe=t(P D)5 t=tStatus.setTe=t(PStatus)5 B else @ N*ptionPane.sho?"essageDialog(null3 IRecor( (oes not ;oun( in 6ib(ent tableL)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B Iss"e Action #4ent Proce(ure pri4ate 4oi( c'(lssueActionPer;or'e((>a4aa?t.e4ent.Action#4ent e4t) @ tr1 @ -lass.;orNa'e(Jco'.'1sql.>(bc. Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(I>(bcH '1sqlH//localhostH %%&E/6ibrar1J3JrootL3JreetaJ)5 // "issue table st't, K concreateState'ent()5 rs, K st't.e=ecuteCuer1(SC6)5 // Tissue table st't% K con.createState'ent()5 rs% K st't.e=ecuteCuer1(SC6)5

int Acno K nteger3parse nt(t=tAcno.getTe=t().tri'())5 i nt "no K nteger.parse nt(t=t "no.getTe=t().tri'())5 String i(t K t=+Date.getTe=t()5 String r(t K i(t5 // Te'poraril1 assigne( ;or testing purpose int co(e K N*ptionPane.sho?-on;ir'Dialog(this3J Are 1ou sure to a((PJ3 I-on;ir'ation Dialog Bo=J3 N*ptionPane.#S_N*-AN-#6*PT *N3 N*ptionPane. N8*R"AT *N "#SSA:#)5 i; (co(e KK N*ptionPane..#S *PT *N) @ // Recor( up(ate( into "issue an( Tissue tables String strSC6 K I NS#RT NT* "issue(acc_no3 'e'b_no3 (ate3 r(ate) $A6U#S (IM(Acno)MJ3 IM("no)MJ3 IM(i(t)MJL3 OIM(r(t)MJ)J5 String strSC6l K I NS#RT NT* Tissue(acc no3 'e'b_no3 (ate3 r(ate) $A6U#S (IM(Acno)MJ3 IM("no)MJ3 I0 OIM(r(t)MJL)J5 st't, e=ecuteUp(ate(strSC6)5 st't%.e=ecuteUp(ate(strSC6l)5 // -hange the status as librar1 boo2 issue( char sta ONL5 /+ 6ib table String strSC6a K IUp(ate 6ib set status KI0i0(sta)MJ ?here acc_no K I M (Acno)5 st'tl .e=ecuteUp(ate(strSC6a)5 // -hange the status as "e'ber has a boo2 char stb KL.L//'e'ber table String strSC6b K IUp(ate "e'ber set 'e'_issue KIM(stb)MJ ?here 'e'b_no K M ("no)5 st't.e=ecuteUp(ate(strSC6b)5 N*ptionPane.sho?"essageDialog(this3 IRecor( up(ate success;ull1J)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B (oo, Ret"r# *Ret"r#Ul)!a%a+

So"rce Co e1 Ret"r#Ul)!a%a Use( -lass/Pac2ages i'port >a4a.sql.F5 i'port >a4a=.s?ing .>*ntionPane5 i'port>a4a=.s?ing. De;ault6ist"o(elH :lobal $ariables State'ent st't K null5 ResultSet rs K null5 char st+ KO.L5 String SC6 K S#6#-T 8R*" "e'ber <)#R# 'e'_issue K M sti M I5I5 State'ent st'tl. K null5 ResultSet rsl K null5 char st K O.5 /+ 6ib table String SC6+ K S#6#-T F 8R*" 6ib <)#R# status K I M St M IO5I5 State'ent st't, K null5 ResultSet rs, K null5 String SC6, K S#6#-T F 8R*" "lssueL5 State'ent st't% K null5 ResultSet rs% K null5

String SC6% S#6#-T 8R*" TissueL5 "ouse clic2 e4ent Proce(ures pri4ate 4oi( >6istl"ouse-lic2e((>a4a.a?t.e4ent."ouse#4ent e4t) @ // getSelecte($alue() 'etho( e=tracts the current cursor location 4alue into a 4ariable String "e'bNo (String) >6istl .getSelecte($alue()5 // #=tract the ;irst ! characters as "e'ber No into a 4ariable String "no K"e'bNo.tri'(&3 %)5 String quer1 K S#6#-T F 8R*" "e'ber <)#R# 'e'b_no K I M ("no) M I5I5 tr1 @ -lass ;o rN a 'e (Icorn. '1sq .>( bc. Dri4erJ). n e?l nsta n ceo5 -onnection con K (-onnection) Dri4er"anager.get-onnection rn1sqlH// localhostH %%&E/6ibrar13JrootJ3JreetaJ)5 // -reate SC6 state'ent an( e=ecute quer1. st't K con.createStaternent()5 rs K st't.e=ecuteCuer1(quer1)5 i;(rs3ne=t()) @ String "Na'e K rs.getString(Jrnernb_na'eJ)5 String "Date K rs.getString(L'(ateL)5 String "Status K rs.getString(O'e'_statusL)5 // Displa1ing the contents in respecti4e te=t bo=es. t=t"No.setTe=t("no)3 t=t" Na 'e. setTe=t(" Na 'e)5 t=t" Date3setTe=t(" Date)5 t=t"Status.setTe=t("Status)5 B else @ N*ptionPane3sho?"essageDialog(null3 IRecor( (oes not ;oun( in "e'ber tableJ)5 // #=trating the Acc_no ;ro' Tissue table to ;in( boo2 eYa)s in 6ib table String quer1l K S#6#-T F 8R*" Tissue <)#R# rne no K I Z ("no) M I5O5 // -reate SC6 state'ent an( e=ecute quer1 st't% K con .createState'ent()5 rs% K st't%e=ecuteCuer1(quer1l)5 int A-no K &5 i;(rs%.ne=t()) @ A-no K rs%.getint(Jacc no)5 t=tAcn o s etTe=t( String. 4aue*;(A-no ))5

B // #=trating the 6ibrar1 (etails ;or Acc_no ;ro' 6ib table String quer1,K S#6#-T F 8R*" Tissue <)#R# rne no K I M (A-no) M I5O5 // -reate SC6 state'ent an( e=ecute quer1. St't+ K con.createStaternent()5 rs+ K st't+.e=ecuteCuer1(quer1)5 i;(rsl.ne=t())@ BTitie K rsl .getString(btitleJ)5 Auth K rsi .getString(LauthorlJ)5 t=tBTitle setle=t(BTitleL)5 t=tAuth .setTe=t(Auth)5 >6abel[.setTe=t( ssue(J)5 B B catch (#=ception e) @ N*ptionPanesho?"essaqeDialog(this3 e3get"essage())5 B B 8or' loa( proce(ure pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a .a?t.e4ent.<in(o?#4ent e4t) @ t=t"No.set#(itable(;alse)5 t=t"Na'e. set#(itable(;alse)5 t=t"Date.set#(itabie(;aise)5 t=t"Status. set#(itable(;alse)5 t=tAcno .set#(itable(;alse)5 t=tBTitle. set#(itable(;alse)5 t=tAuth.set#(table(;alse)5 // ("o(el to per;or' De;ault6ist"o(el ;or "e'ber // 'etho( operations De;ault6ist"o(el ("o(el K (De;ault6ist"o(el) >6istl .get"o(el()5 // "etho( to a(( ele'ents into >6istl control ;or 'e'ber ("o(ei.clear()5 tr1 @ -lass .;orNa'e(co' .'1sql.>(bc. Dri4er)5 -onnection con K (-onnection) Dri4er"anager.get-onnection\>(bc '1sqlH//localhostH %%*E/6ibrar1J3JrootL3JreetaJ)5

// 6isting "e'bers st't K con.createState'ent()5 rs K st't.e=ecuteCuer1(SC6)5 ?hile (rs3ne=t()) @ String "no K rs3getString('e'b no)5 String "Na'e K rs.getString('e'b_narne)5 // To 'a2e the "e'ber no. as ! (igit because ?e ?ill e=tract ! (igit ;ro' list 4al. //in 'ouse clic2 e4ent. i; ("no.ler 5th() Q !) @ int = K I"no.length()5 int ni K ! 0 =5 ?hile (n R &)@ "noK"noMJJ5 nl005 B B ("o(el.a((#le'ent("no M I0 I M "Na'e 5 B 6ist +. set"o(el (( "o(el)5 B catch (#=ception e) @ N*ptionPane sho? "essage Dialog (this3 e.get" essage( ))5 e.printStac2Trace()5 B B E;it Action#4ent Proce(ure

pri4ate 4oi( c'(#=itActionPer;or'e((>a4a.a?t.e4ent.Action#4e;lt e this. Set$isible(;alse)5 B Ret"r# Action#4ent Proce(ure

pri4ate 4oi( c'(ReturnActionPer;or'e((>a4a.a?t.e4e;lt.A-ti*;l#4e;lt e4t) @ tr1@

-lass . ;o rNa 'e( Ocorn . '1sql.>( bc D ri4erL) -onnection con K (-onnection) Dri4er"anager.get-onnection(>(bcH '1sqi H//localhostH %%&E/6ibrar1L Ho 3Oreeta // "issue table int "no K &3 Acno K &5 "no K nteger.parselnt(t=t"No.getTe=to.tri'*)5 Acno K nteger.parse +/ Steps to con;ir' return 't opt K N*ptionPane.sho?-on;ir'Dialog(null3 Are 1ou sure to return this boo2 PI)5 i; (opt KK N*ptionPane..#S_*PT *N) @ String strSC6r K IDelete ;ro' Tissue ?here 'e'b_no K I M ("no)5 st't% .e=ecuteUp(ate(strSC6r)5 // -hange the status as librar1 boo2 issue( char sta K O.L5 // 6ib table String strsC6a K Up(ate 6ib set status KIM(sta)MJ ?here acc_no K I M (Acno)5 st'tl .e=ecuteUp(ate(strSC6a)5 // -hange the status as "e'ber has a boo2 char stb K ONL5 // "e'ber table reeta ) String strSC6b K OUp(ate "e'ber set 'e' issue KOOM(stb)MJ ?here 'e'b_no K M ("no)5 st't.e=ecuteUp(ate(str N*ptionPane.sho?"essageDialog(this3 IThan2s ;or returning boo2)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B Mem'er E#try *Mem'U5!a%a+

So"rce Co e1 Mem'U5!a%a Use( *ass/Pac2ages i'port >a4a.sq6 i'port >a4a=.s?ing.NoptionPane5 :lobal $ariables H State'ent st't K null5 ResuitSet rs null5 // ResuitSet ;or publisher table. String SC6 K OS#6#-T F 8R*" "e'ber5 Action#4ent Proce(ures pri4ate 4oi( c'(-learActionPer;or'e((>a4a a?t.e4ent.Action#4ent e4t) @ t=t"No.setTe=t(J)5 t=t"Na'e.setTe=t(JJ)5 t=t"A((.setTe=t(IJ)5 t=t"Ph.setTe=t(LJ)5 t=t"Date.setTe=t(IJ)5 t=t"8ee.setTe=t(IJ)5 t=t"Status.setTe=t(IJ)5 c'(Sa4e.set#nable((;alse)5 B E it Action#4ent Proce(ure pri4ate 4oi( c'(#(itActionPer;or'e((>a4a.a?t.e4ent3Act e4t) @ this.set$ ible(;alse)5 ne? "e'b#(itU ().set$isible(true)5 B

E;it Action#4ent Proce(ure pri4ate 4oi( c'(#=itActic Per;or'e((>a4a.a?t.e4ootAction#4ent e4t) @ this.set$sible(;alse)5 B sa%e Action#4ent Proce(ure

pri4ate 4oi( c'(Sa4eActionPer;or'e((>a4a.a?t.e4e;lt.Action#4ent e4t) @ tr1@ -lass.;orNa'e(Jco'.'1sql.>(bc. Dri4er)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(L>(bcH '1sqlH/HiocalhostH%%&E/6ibrar1L3LrootJ3JreetaJ)5 st't K con.createState'ent()3 rs K st't.e=ecuteCuer1(SC6)5

int "no K nteger.parselnt(t=t"No.getTe=t())5 String "Na'e K t=t"Na'e.getTe=t()5 String "A(( K t=t"A((.getTe=t()5 String "Ph+ K t=t"Ph.getTe=t()3 String " Date K t=t" DategetTe=t()5 // This is te'poraril1 assigne( sa'e as 'e'bership (ate String "#Date K t=t"Date (ouble "8ee K Double.parseDouble(t=t"8ee.getTe=t())5 char "Status K O.L5 // "e'ber status is . char "lssue ONL5 // Boo2 issue status is N 't co(e K N*ptionPanc.sho?-on;ir'Dialog(this3 IAre 1ou sure to a((PJ3 I-on;ir'ation Dialog Bo=J3 N*ptionPane..#S_N*_-AN-#6_*PT *N3 N*ption Pane N 8*R" OT *N "#SSA:#)5 i;(co(e K K N*ptionPane..#S_*PT *N) @ String strSC6 K O NS#RT NT* "e'ber('e'b_no3 'e'b na'e3 'e'b_a((3 'e'b phone. '(ate3 'e(ate3 ';ee3 'o'_status3 'e' issue) $A6U#S (IM("no)MJ3 IM("Na'e)MJ3 IM("A(()MJ3 IM("Phl)MJ3 IM("Date)MJ3 OIM("#Date)ML IM("8ee)MJ3 IM("Status)MJ3 IM("lssue)MJ)J5 int ro?s#;;ecte( K st't.e=ecuteUp(ate(strSC6)5 N*ptionPane.sho?"essageDiaiog(this3 IRecor( a((e( success;ull1 into "e'ber tableJ)5 B c'(Sa4e.set#nable((;alse)5

B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B Ne& Action#4ent Proce(ure pri4ate 4oi( c'(Ne?ActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ t=t"Status.setTe=t(J.J)5 // Acti4ate the Sa4e button ?hen Ne? button clic2e( c'(Sa4e .set#nable((true)5 tr1 @ -lass.;orNa'e(Jco'. '1sql.>(bc. Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(J>(bcH '1sqlH//localhostH %%&E/6ibrar1J3JrootJ3JreetaJ)5 st't K con.createState'ent()5 // -onnection string ;or ResultSet 0 rs. rs K st't nt "N*K*3 "no K &5 ?hile (rs.ne=t()) @ "N* K rs.getlnt(I'e'b_noJ)5 "N*MM5 "no K "N*5 t=t"No.setTe=t(lnteger.toString("no))5 t=t"Na'e.set8ocusable(true)5 B catch (#=ception e) N*ptionPane sho? "essage Dialog (this3 e.get" essage( ))5 e.printStac2Trace()5 B B 8or' loa( proce(ureH pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a.a?t.e4ent.< e4t) @ t=t" No. set#(itable (;alse)5 t=t"Status.set#(itable(;alse)5 // Deacti4ate the Sa4e button ?hen ;or' loa(s c'(Sa4e.set#nable((;alse)5 B

pri4ate 4oi( c'(DelAct e4t) @ th is . set $isible (;alse) ne? "e'bDelU *.set$isible(true)5 B Mem'er Mo ificatio# *Mem'E itUi!a%a+

So"rce Co e1 Mem'E itUi!a%a Use( -lass/Pac2ages i'port >a4a.sqlF5 i'port >a4a=.s?ing.N*ptionPane i'port >a4a=.s?ing.De;ault6ist"o(el5 :lobal $ariables State'ent st't K null5 ResultSet rs K null5 String SC6 K OS#6#-T F 8R*" "e'berL5 E;it Action#4ent Proce(ure pri4ate 4oi( c'(#=itActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t)@ this.set$isible(;alse)5 B Up ate Action#4ent Proce(ures

pri4ate 4oi( c'(Up(ateActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e.H H tr1 @ -lass.;orNa'e(Jco'. '1sql.>(bc. Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(J>(bcH '1sqlH//localhostH %%&E/6ibrar1J3JrootJ3JreetaJ)5 st't con.createState'ent()5 rs K st't.e=ecuteCuer1(SC6)5 int "no K nteger. parse nt(t=t"No.getTe=t() .tri'())5 String "Na'e K t=t"Na'e.getTe=t()5 String "A(( K t=t"A(( .getTe=t()5 String "Ph+ K t=t"Ph.getTe=()5 String " DateK t=t" Date. getTe=t()5 // This is te'poraril1 assigne( sa'e as 'e'bership (ate String "#Date K t=t"Date.getTe=t ()5 (ouble "8ee K Double.parseDouble(t=t"8ee.getTe=t())5 char "Status K O.L5 // "e'ber status is . String strSC6 K OUp(ate "e'ber set 'e'b_na'e KIM("Na'e)ML3 'ernb_a(( K IM("A(()MJL3 'e'b phone K '(ate K OIM("Date)MJ ';ee K IM("8ee)MJ ?here 'e'b_no K M ("no)5 int ro?s#;;ecte( K st't.e=ecuteUp(ate(strSC6)5 i; (ro?s#;;ecte( K K &) N*ptionPane.sho?"essageDialog(this3 Recor( (oes not e=ists)5 else N*ptionPane.sho?"essageDialog(this3LRecor( 'o(i;ie(L)5 B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage*)5 B B

"ouse clic2 e4ent Proce(ure pri4ate 4oi( >6istl"ouse-lic2e((>a4a.a?t.e4ent."ouse#4ent e4t) @ // getSelecte($alue() 'etho( e=tracts the current cursor location 4alue into a 4ariable String "e'bNo K (String) >6istl.getSelecte($alue()5 //#=tract the ;irst ! characters as "e'ber No into a 4ariable

String "no K"e'bNo.tri'().substring(&3 %)5 String quer1 K IS#6#-T F 8R*" "e'ber <)#R# 'e'b_no K I M ("no) M I5I5 tr1 @ -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erL).ne?lnstanceC5 -onnection con K (-onnection) Dri4er"anager.get-onnection(L>(bcH '1sqlH// locaihostH %%&E/6ibrar1J3JrootL3JreetaJ)5 // -reate SC6 state'ent an( e=ecute quer1. st't con.create rs K St't.e=ecuteCuer1(quer1) B i;(rs.ne=t())@ String "Na'e K rs.getstring(J'e'b_na'eJ) String 'A(( K rs.getstring(I'e'b_ a((J)5 String "Ph+ K rs.getstring(I'e'b_ phoneJ)5 String "Date K rs.getstring(I'(ateJ)5 String "#Date K rs.getstring(J'e(ateJ) String "8ee K rs.getString(J';eeJ)3 String NiStatus K rs.getString(I statusL)5 String "issue rs.getString(L'e'_issueJ)5 // Displa1ing the contents in respecti4e te=t bo=es. t=t" No. setTe=t("no)5 t=t"Na'e. setTe=t("Na'e)5 t=t"A(( .setle=t("A(()5 t=tNl Ph .setTe=t("Phl)5 t=t"Date.setTe=t("(ate)5 t=t" Pee.setTe=t(" 8ee)5 t=t" Status.setTe=t("status)5 t=t" Status .set#(itable(;alse)5 B else @ N*ptionPane.sho?"essageDialog(null3 IRecor( (oes not ;oun( in "e'ber tableJ)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B

8or' loa( proce(ureH pri4ate 4oi( ;or'< a?t e4ent <in(o?#4ent e4t) @ t=t" No. set#(itable (; alse)5 t=t"Status . set#(itable(;alse)5 // -reating a 6ist"o(el ob>ect ("o(el to per;or' De;ault6ist"o(el // 'etho( operations De;ault6ist"o(el ("o(el K (De;ault6ist"o(el) >6ist+.get"o(el // "etho( to a(( ele'ents into >6istl control ("o(el.clear()5 tr1 @ -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(L>(bcH '1sqlH// locaihostH %%&E/6ibrar1J3JrootL3JreetaJ)5 rs K st't.e=ecuteCuer1(SC6)5 ?hile (rs.ne=t())@ Strirg "no K rs.getString(Jrne'b_noJ)5 Stnrg "Na'e rs.getString(Lrne'b _na'eL)5 // To 'a2e the "e'ber no. as ! (igit because ?e ?ill e=tract ! (igit ;ro' list 4alue //in 'ouse clic2 e4ent. i; ("no.length() Q!) @ int = K "no.length()5 int nl K ! ] = 5 ?hile (nl R &) @ "rio K "i o M IJ5 nl0 05 B B ("o(ela((#le'ent("no MJ0IM "Na'e)5 B >6istl .set"o(el(("o(el)5 B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3e.get"essage())5

e. printStac2Trace()5 B B

Mem'er Deletio# *Mem'DelUl!a%a+

SOURCE Co e1 Mem'DelUI!a%a Use( -lass/Pac2ages i'port >a4a.sqlF5 'port >a4a=.s?ing.N*ptionPane5 i'port >a4a=.s?ing.De;ault6ist"o(el5 :lobal $ariables State'ent st't K null5 ResultSet rs K null5 String SC6 K S#6#-T F 8R*" "e'ber5 Action#4ent Proce(ures H pri4ate 4oi( >6istl"ouse-lic2e((>a4a.a?t.e4ent."ouse#4ent e4t) @ // getSelecte($alue() 'etho( e=tracts the current cursor location 4alue String "e'bNo K (String) >6istl .getSelecte($alue()5 // #=tract the ;irst ! characters as "e'ber No into a 4ariabie String "no K"e'bNo.tri'().substring(*3 %)5 String quer1 K S#6#-T F 8R*" "e'ber <)#R# 'e'b_no K IM ("no) M I5I5 tr1 @ -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erL)5

-onnection con K (-onnection) Dri4er"anager.get-onnection(L>(bcH '1sqlH// locaihostH %%&E/6ibrar1J3JrootL3JreetaJ)5 // -reate SC6 state'ent an( e=ecute quer1. st't K con.createstate'ent()5 r st't.e=ecuteCuer1(quer1)5 i; (rs.ne=tC) @ String "Na'e K rs.getString(J'e'b_na'eJ) String 'A(( K rs.getstring(I'e'b_ a((J)5 String "Ph+ K rs.getstring(I'e'b_ phoneJ)5 String "Date K rs.getstring(I'(ateJ)5 String "#Date K rs.getstring(J'e(ateJ) String "8ee K rs.getString(J';eeJ)3 String NiStatus K rs.getString(I statusL)5 String "issue rs.getString(L'e'_issueJ)5 // Displa1ing the contents in respecti4e te=t bo=es. t=t"No.setTe=t("no)5 t=t"Na'e.setTe=t("Na'e)5 t=t"A(( . setTe=t("A(()5 t=t"Ph.setTe=t("Ph +)5 t=t"Date.setTe=t("Date)5 t=t" 8ee .setTe=t( "8ee)5 t=t"Status3setTe=t( "status)5 t=t"Status.set#(itable(;alse)5 B else @ N*ptionPane.sho?"essageDialog(null3 IRecor( (oes not ;oun( in "e'ber tableJ)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage()5 B B E;it Action#4ent Proce(ureH

pri4ate 4oi( c'(#=itlActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ this.set$isible(;alse)5 //ne? "ainU ().set$isible(true)5 B

Delete Action#4ent Proce(ure pri4ate 4oi( c'(DeleteActionPer;or'e((>a4a.a?t.e4ent.Action#4ent e4t) @ tr1 @ -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(L>(bcH '1sqlH// locaihostH %%&E/6ibrar1J3JrootL3JreetaJ)5 st't K con.createstate'ent()5 rs K st't.e=ecuteCuer1(SC6)5 int "no K nteger.parse nt(t=t"No.getTe=t() .tri'())5 // Steps to con;ir' (eletion int opt K N*ptionPane.sho?-on;irrnDialog(null3 IAre 1ou sure to (elete this recor( PI)5 i; (opt N*ptionPane..#S_ *PT *N) @ tr1 @ char stb KL NL5 // "e'ber table String strSC6 K IUp(ate "e'ber set 'e'_status K IM(stb)M I?her 'e'b no K O M ("no)5 int ro?s#;; ecte( K st't.e=ecuteUp(ate(strSC6)5 i; (ro?s#;;e te( K K &) N*ptionPane.sho?"essageDialog(this3 IRecor( (oes not e=istsJ)5 else @ N*ptionPane.sho?"essageDiaiog(this3JRecor( Delete()5 // Te=t bo=es cleare( t=t"No.setTe=t(IJ)5 t=t"Na'e.setTe=t(IJ)5 t=t"A(( . setTe=t(IJ)5 t=t"Ph.setTe=t(IJ)5 t=t"Date.setTe=t(IJ)5 t=t" 8ee .setTe=t( IJ)5 t=t"Status3setTe=t( IL)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(null3 IUnable to (eleteL)5 B B

B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B 8or' loa( proce(ure pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a.a?t.e4ent.<in(o?#4ent e4t) @ t=t" No3 set#(itable ( ;alse)5 t=t"Na'e.set#(itable( ;alse)5 t=t"A(( .set#(itable(;alse)5 t=t"Ph .set#(itab (;alse)5 t=t"Date.set#(itable(;alse)5 t=t"8ee.set#(itable(;alse)5 t=t"Status.set#(itable(;alse)5 // -reating a 6ist"o(el ob>ect ("o(el to per;or' De;ault6ist"o(el // 'etho( operations De;ault6ist"o(e ("o(el K (De;ault6ist"o(el) >6istl.get"o(e // "etho( to a(( ele'ents into >6istl control ("o(el.clear()5 tr1 @ -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(L>(bcH '1sqlH// locaihostH %%&E/6ibrar1J3JrootL3JreetaJ)5 st't K con.createstate'ent()5 rs K st't.e=ecuteCuer1(SC6)5 ?hile(rs.ne=t())@ String "no K rs.getString(I'e'b_noJ)5 String "Na'e K rs.getString(I'e'b_na'eJ)5 // To 'a2e the "e'ber no. as O because ?e ?ill e=tract ! (igit ;ro' list 4alue // in 'ouse clic2 e4ent. i; ("no. ength() Q !) @ int = K "no.length()5 int nl K ! 0 =5 ?hile (nl R *)@ "no K "no MJJ5 nl005

B B ("o(el.a((#le'ent("no M I0 I M "Na'e)5 B >6istl .setNlo(el(("o(el)5 B catch (#=ception e) ( N*ption Pane. sho?"essageDialog(this3 e.get"essage ())5 e. printStac2Trace()5 B B Mem'er Na%i$atio# *Mem'Na%Ui!a%a+

So"rce Co e1 Mem'Na%Ui!a%a Use( -lass/Pac2ages i'port >a4a.sql.F5 i'port >a4a=.s?ing.N*ptionPane5 :lobal $ariables ?ith a 'etho( State'ent st't null5 ResultSet rs K null5 String SC6 K OS#6#-T F 8R*" "e'berJ5 public 4oi( (isable_te=t;iel(s() @ t=t"No.set#(itable(;alse)5 t=t"Na'e.set#(itable(;alse)5 t=t"A((.set#(itable(;alse)5

t=t"Ph.set#(itable(;alse)5 t=t"Date3set#(itable(;alse)5 t=t"8ee. set#(itable(;alse)5 t=t"Status.set#(itable(;alse)5 t=t"lssue.set#(itable(;alse)5 B Pre%io"s Action#4ent Proc(ures pri4ate 4oi( c'(Pre4ActionPer;or'e(( >a4a.a?t.e4ent.Action#4ent e4t) @ tr1 @ -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(L>(bcH '1sqlH// locaihostH %%&E/6ibrar1J3JrootL3JreetaJ)5 i; (rs.pre4ious()) @ String "no K rsgetString(Jrne'b_noJ)5 String "Na'e K rs.getString(J'e'b_na'e O)5 String "A(( K rs.getString(I 'e'b_a((J)5 String "Ph+ K rs.getString(J'e'b phoneJ)5 String "Date K rs.getString(J'(ate I)5 String "#Date K rs.getString( I'(ateJ)5 String "8ee K rs.getString(I';eeJ)5 String "Status K rs.getString( status)5 String "lssue K rs.getString(J'e'b_issue)5 // Displa1ing the contents in respecti4e te=t bo=es. t=t" No. setTe=t( " no) t=t" Na 'e. setTe=t("Na'e) t=t"A(( . setTe=t( "A(()5 t=t"Ph.setTe=t("Ph +)5 t=t"Date.setTe=t( "Date)5 t=t"8ee.setTe=t("8ee)5 t=t"Status .setTe=t("Status)5 t=t"lssue.setTe=t("lssue)5 c'(8irst.set#nabie((true)5 c'(Ne=t.set#nable((true)5 c'(Pre4. set#nable( (true)3 c'(6ast.set#nable( (true)

Belse @ c'(Pre4.set#nable((;alse)5 N*ptionPane.sho?"essageDialog(this3J.ou are at ;irst positionJ3 OStu(ent3*)5 B catch (#=ception e) @ N*ptionPane.sho?"essageDiloge(this3e.get"essage())5 B B 5ast Action#4ent proce(ureH pri4ate 4oi( c'(6astActionPertor'e((>a4a3a?t.e4ent.Action#4ent e4t) @ tr1@ -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(L>(bcH '1sqlH// locaihostH %%&E/6ibrar1J3JrootL3JreetaJ)5 i; (rs.last()) @ String "no K rs.getString(J'e'b noL)5 String "Na'e K rs.getString('e'b_na'eJ)5 String "A(( K rs.getString(L'e'b_a((J)5 String "Ph+ K rs.getString('e'b phone)5 String "Date K rs.getString(L'(ateJ)5 String "#Date K rs.getString(I'e(ateJ) String "8ee K rs.getString(I';eeJ)5 "Status K rs.getString(J'e'_statusJ)5 String "lssue K rs.getString(J'e'_issueJ)5 // Displa1ing the contents in respecti4e te=t bo=es. t=t" No. setTe=t( " no) t=t" Na 'e. setTe=t("Na'e) t=t"A(( . setTe=t( "A(()5 t=t"Ph.setTe=t("Ph +)5 t=t"Date.setTe=t( "Date)5 t=t"8ee.setTe=t("8ee)5 t=t"Status .setTe=t("Status)5 t=t"lssue.setTe=t("lssue)5 c'(8irst.set#nabie((true)5 c'(Ne=t.set#nable((;alse)5 c'(Pre4. set#nable( (true)3

c'(6ast.set#nable( (;alse)

B else @ N*ptionPane.sho?"essageDialog(this3 .ou are alrea(1 at last recor(J3 IStu(entJ3*)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B Ne;t Action#4ent Proce(ures pri4ate 4oi( c'(Ne=tActionPer;or'e((>a4a.a?t.e4entAction#4ent e4t) @ B tr1@ -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(L>(bcH '1sqlH// locaihostH %%&E/6ibrar1J3JrootL3JreetaJ)5 i; (rs.ne=t()) @ String "no K rs.getString(J'e'b noL)5 String "Na'e K rs.getString('e'b_na'eJ)5 String "A(( K rs.getString(L'e'b_a((J)5 String "Ph+ K rs.getString('e'b phone)5 String "Date K rs.getString(L'(ateJ)5 String "#Date K rs.getString(I'e(ateJ) String "8ee K rs.getString(I';eeJ)5 "Status K rs.getString(J'e'_statusJ)5 String "lssue K rs.getString(J'e'_issueJ)5 //Displa1ing the contents in respecti4e te=t bo=es. t=t" No. setTe=t( " no) t=t" Na 'e. setTe=t("Na'e) t=t"A(( . setTe=t( "A(()5 t=t"Ph.setTe=t("Ph +)5 t=t"Date.setTe=t( "Date)5 t=t"8ee.setTe=t("8ee)5 t=t"Status .setTe=t("Status)5

t=t"lssue.setTe=t("lssue)5 c'(8irst.set#nable((true)5 c'(Ne=t.set#nable((true)5 c'(Pre4.set#nable(( true)5 c'(6ast.set#nable((true)5 B else @ c'(Ne=t.set#nable((;alse)5 N*ptionPane.sho?"essageDialog(this3J .ou are at last recor( positionJ3 IStu(entJ3&)5 B Bcatch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 E;it Action#4ent Proce(ure pri4ate 4oi( c'(#=itActionPer;*rrne((>a4a.a?t.e4ent.Action#4ent.e4t)@ this. set$isible(;alse)5 B 0irst Action#4ent Proce(ures pri4ate 4oi( c'(8irstActio;lper;orrne( (>a4a.a?t.e4ent.Action#4ent.e4t)@ tr1 @ -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erL)5 -onnection con K (-onnection) Dri4er"anager.get-onnection(L>(bcH '1sqlH// locaihostH %%&E/6ibrar1J3JrootL3JreetaJ)5 i; (rs.ne=t()) @ String "no K rs.getString(J'e'b noL)5 String "Na'e K rs.getString('e'b_na'eJ)5 String "A(( K rs.getString(L'e'b_a((J)5 String "Ph+ K rs.getString('e'b phone)5 String "Date K rs.getString(L'(ateJ)5 String "#Date K rs.getString(I'e(ateJ) String "8ee K rs.getString(I';eeJ)5 "Status K rs.getString(J'e'_statusJ)5 String "lssue K rs.getString(J'e'_issueJ)5 //Displa1ing the contents in respecti4e te=t bo=es.

t=t" No. setTe=t( " no) t=t" Na 'e. setTe=t("Na'e) t=t"A(( . setTe=t( "A(()5 t=t"Ph.setTe=t("Ph +)5 t=t"Date.setTe=t( "Date)5 t=t"8ee.setTe=t("8ee)5 t=t"Status .setTe=t("Status)5 t=t"lssue.setTe=t("lssue)5 c'(8irst.set#nable((;alse)5 c'(Ne=t.set#nable((true)5 c'(Pre4.set#nable(( ;alse)5 c'(6ast.set#nable((true)5 B else @ c'( 8irst. set#na ble( (;alse) c'( Ne=t. set# na ble( (;alse) crn( pre4.set#;lable((;alse) c'( 6ast.set#na ble( (;alse) N*ptionPane.sho?"eSSageDial*g(this3 Rhere is no recor( in tableL3 IStu(entL3*)5 B B catch (#=ception e) @ N*ptionpane.sho?"essageDialog(this3e.get"essage*)5 B B 8or' loa( proce(ure pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a.a?t.e4ent<in(o?#4ent. e4t) @ (isable_te=t;iel(s()5 tr1 @ -lass 3;o rNa 'e( I corn. '1sql.>(bc. Dri4erJ) -onnection con K (-onnection) Dri4er"anager.get -onnection (J>(bcH '1sql H//localhostH %%&E/6ibrar1L3rootJ3LreetaL) st't K con.createState'ent()5 rs K st't.e=ecuteCuer1(SC6) String "no K rs.getString(J'e'b noL)5

String "Na'e K rs.getString('e'b_na'eJ)5 String "A(( K rs.getString(L'e'b_a((J)5 String "Ph+ K rs.getString('e'b phone)5 String "Date K rs.getString(L'(ateJ)5 String "#Date K rs.getString(I'e(ateJ) String "8ee K rs.getString(I';eeJ)5 "Status K rs.getString(J'e'_statusJ)5 String "lssue K rs.getString(J'e'_issueJ)5 //Displa1ing the contents in respecti4e te=t bo=es. t=t" No. setTe=t( " no) t=t" Na 'e. setTe=t("Na'e) t=t"A(( . setTe=t( "A(()5 t=t"Ph.setTe=t("Ph +)5 t=t"Date.setTe=t( "Date)5 t=t"8ee.setTe=t("8ee)5 t=t"Status .setTe=t("Status)5 t=t"lssue.setTe=t("lssue)5 c'(8irst.set#nable((;alse)5 c'(Ne=t.set#nable((true)5 c'(Pre4.set#nable(( ;alse)5 c'(6ast.set#nable((true)5 B else @ c'( 8irst. set#na ble( (;alse) c'( Ne=t. set# na ble( (;alse) crn( pre4.set#;lable((;alse) c'( 6ast.set#na ble( (;alse) N*ptionPane.sho?"eSSageDial*g(this3 Rhere is no recor( in tableL3 IStu(entL3*)5 B B catch (#=ception e) @ N*PtionPane.sho?"essageDialog(this3 e.get"essage())5 B B

A%aila'le (oo, 5ist *A(5istUl)!a%a+

So"rce Co e1 A(5istUl)!a%a Use( -lass/Pac2ages i'port >a4a=.s?ing.table.F5 i'port >a4a.sqi.F5 i'port >a4a=.s?ing.N*ptionPane5 8or' loa( proce(ure pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a.a?t.e4ent<in(o?#4ent. e4t) @ // Be;ore ?ritting the ;ollo?ng line3 1ou shoul( i'port the lineH //i'port >a4a=.s?ing.table.F5 at the top o; 1our application De;aultTable"o(el 'o(el K (De;aultTable"o(el) >Tablel .get"o(el()5 // -lear the e=isting table int ro?s K 'o(el.getRo?-ount()5 i; (ro?s R &) @ ;or ('t K &5 i Q ro?s5 iMM) @ 'o(el. re'o4e Ro?(&)5 B B B // SC6 Cuer1 char st K O.L5 // 6ib table String quer1 K IS#6#-T F 8R*" 6ib <)#R# status K I M St M I5I5 tr1@ // -onnect to "1SC6 (atabase -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erJ). ne? nstance()5 -onnection con K (-onnection) Dri4er"anager.get-onnection(J>(bcH '1sql // localhostH %%&E/6ibrar1J3JrootJ3JreetaJ)5

// -reate SC6 state'ent an( e=ecute quer1. State'ent st't K con createState'ent()5 ResultSet rs K st't.e=ecuteCuer1(quer1)5 // terate through the result an( (ispla1 on screen ?hile (rs.ne=t()) @ String Acno K rs.getString(Jacc_noJ)5 String bTitle rs.getString( IbtitleJ)5 String Auth + rs.getString(Jauthor+J)5 String Price K rs.getString(JpriceJ)5 String e(ition rs.getString(Je(itionJ)5 //S1ste'3out.println(Acno M I J M bTitle M I>J M Authi M I M Price M IiJ M e(ition)5 'o(el.a((Ro?(ne? *b>ect @Acno3 bTitle3 Authi3 Price3 e(itionB)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B E;it Action#4ent Proce(ureH pri4ate 4oi( c'(#=itActionPer;or'e((>a4a . a?t.e4ent.Action #4ent e4t) @ this.set$isibie(;alse)5 B pri4ate 4oi( c'(lssueActionPer;or'e((>a4aa?t.e4ent.Action#4ent e4t) @ "1Dialog .set$isible(true)5 B pri4ate 4oi( c'(Bac2ActionPer;or'e((>a4a a?t.e4ent.Action#4ent e4t) @ "1Dialog.(ispose()5 B Dialog ?in(o? loa( proce(ure H Pri4ate 4oi( "1Dialog<in(o? P:aine(8ocus(>a4a.a?t.e4ent.<in(o?#4ent e4t)@ De;aultTale"o(el D'o(el K (De;aultTable"o(el) >Table,.get"o(el()5 //-lear the e=isting table nt ro?s K D'o(el.getRo?-ount()5 ; (ro?R&)@ ;or(int iK &5 iQKro?s5iMM)@ D'o(el.re'o4eRo?(&)5

B B //SC6 Cuer1 char st K ON5 // 6ib table String quer1 KJ S#6#-TJF 8R*" 6ib <)#R# status K I M St MJ5J5 tr1@ // -onnect to "1SC6 (atabase -lass.;orNa'e(Jco'.'1sql.>(bc.Dri4erJ). ne? nstance()5 -onnection con K (-onnection) Dri4er"anager.get-onnection(J>(bcH '1sql // localhostH %%&E/6ibrar1J3JrootJ3JreetaJ)5 // -reate SC6 state'ent an( e=ecute quer1. State'ent st't K con createState'ent()5 ResultSet rs K st't.e=ecuteCuer1(quer1)5 // terate through the result an( (ispla1 on screen ?hile (rs.ne=t()) @ String Acno K rs.getString(Jacc_noJ)5 String bTitle rs.getString( IbtitleJ)5 String Auth + rs.getString(Jauthor+J)5 String Price K rs.getString(JpriceJ)5 String e(ition rs.getString(Je(itionJ)5 //S1ste'3out.println(Acno M I/J M bTitle M I/J M Authi M I M Price M I/J M e(ition)5 'o(el.a((Ro?(ne? *b>ect @Acno3 bTitle3 Authi3 Price3 e(itionB)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B

Iss"e (oo, 5ist *I(5IstUI)!a%a+

So"rce Co e1 I(5istUI)!a%a Use( -lass/Pac2ages i'port >a4a=.s?ing.table.F5 i'port >a4a.sql.F5 i'port >a4a=.s?ing.N*ptionPane5 E;it= Action#4ent Proce(ureH pri4ate 4oi( c'(#=itActionPer;or'e((>a4a.a?t.e4ent.i e4t) @ this.set$isible(;alse)5 B 8or' loa( proce(ure pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a.a?t.e4ent.<in(o?#4ent e4t) @ // Be;ore ?ritting the ;ollo?ng line3 1ou shoul( i'port the lineH // i'port Na4a=.s?ing.table.F5 at the top o; 1our application De;aultTable"o(el 'o(el K (De;aultTable"o(el) >Tablel.get"o(el()5 // -lear the e=isting table int ro?s K 'o(el.getRo?-ount ()5 i; (ro?s R &) @ ;or ('t K &5 Q ro?s5 iMM) @ 'o(el. re'o4eRo?( &)5 B B // SC6 Cuer1 char st K N5 // 6ib table String quer1 K IS#6#-T F 8R*" 6ib <)#R# status K I M St M I5I5 tr1 @ // -onnect to "1SC6 (atabase

-lass.;orNa'e(co'.'1sql.>(bc. Dri4erJ).ne?lnstance()5 -onnection con K (-onnection) Dri4er"anager.get-onnection(I>(bcH'1sqlH// localhostH %%&E/6ibrar1J3rootJ3JreetaJ)5 // -reate SC6 state'ent an( e=ecute quer1. State'ent st't K con.createState'ent()5 ResultSet rs K st't.e=ecuteCuer1(quer1)5 // terate through the result an( (ispla1 on screen ?hile (rs.ne=to) @ String Acno K rs.getString(Jacc_noJ)5 String bTitle rs.getString( IbtitleJ)5 String Auth + rs.getString(Jauthor+J)5 String Price K rs.getString(JpriceJ)5 String e(ition rs.getString(Je(itionJ)5 //S1ste'3out.println(Acno M I/J M bTitle M I/J M Authi M I M Price M I/J M e(ition)5 'o(el.a((Ro?(ne? *b>ect @Acno3 bTitle3 Authi3 Price3 e(itionB)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B Mem'er 5ist IM5istU5!a%a+

So"rce Co e1 M5>stUI)!a%a Use( -lass/Pac2ages i'port >a4a=.s?ing.table.F5 i'port >a4a.sql.F5 i'port >a4a=.s?ing. N*ptionPane5 E;it Action#4ent Proce(ure

pri4ate 4oi( c'(#=itActionPer;or'e((>a4a3a?t e4t) @ this.set$isible(;alse)5 B 8or' loa( proce(ure H pri4ate 4oi( ;or'<in(o?:aine(8ocus(>a4a.a?t e4t) @ // Be;ore ?ritting the ;ollo?ng line3 1ou shoul( i'port the lineH // i'port >a4a=.s?ing.table.F5 at the top o; 1our application De;aultTable"o(el 'o(el K (De;aultTable"o(el) >Table+.get"o(el()5 // -lear the e=isting table int ro?s K 'o(el.getRo?-ount()5 i; (ro?s R &) @ ;or (int i &5 i Q ro?s5 iMM) @ 'o(el. rerno4eRo?(&)5 B B // SC6 Cuer1 String quer1 K OS#6#-T F 8R*" "e'berL5 tr1 @ // -onnect to "1SC6 (atabase -lass.;orNa'e(co'.'1sql.>(bc. Dri4erJ).ne?lnstance()5 -onnection con K (-onnection) Dri4er"anager.get-onnection(I>(bcH'1sqlH// localhostH %%&E/6ibrar1J3rootJ3JreetaJ)5 // -reate SC6 state'ent an( e=ecute quer1. State'ent st't K con.createState'ent()5 ResultSet rs K st't.e=ecuteCuer1(quer1)5 // terate through the result an( (ispla1 on screen ?hile (rs.ne=t()) @

String "NoK rs.getString(I'e'b_noJ)5 String "Na'e K rs.getString(I'e'b_ na'eJ)5 String "Aa( K rs.getString(J'e'b_a((J)5 String "Ph K rsgetstring(I'e'b_phoneL)5 String "Date K rs.getString(I '(ateJ)5 //S1stern.out.println("no M I L M "Na'e M I J M ".A(( M I J M "Ph+ M II J M "Date)5 "o(el.a((Ro?(ne? *b>ect @"no3 " na'e3 "A((3 "Ph 3 "DateB)5 B B catch (#=ception e) @ N*ptionPane.sho?"essageDialog(this3 e.get"essage())5 B B

-onclusion

A;ter the success;ul co'plesion o; this pro>ect ha4e gaine( co'plete 2no?le(ge o; >a4a an( "1SC6 3 ?hile (oing this pro>ect ha4e use( all the 2no?le(ge an( s2ill ha4e acquire( in this past 1ears . ?oul( li2e to than2 '1 teacher "rs. Shabana Par4een ?ho helpe( 'e through out the session b1 e'po?ering '1 thoughts ?ith her precious a(4ice an( guience

N RUPA"A -lass0Aii Roll No _______

St" e#ts Data

Na'e -lass Di4 Roll No School

H H H H H

N RUPA"A A IDJ 7airali School Sector0 3 Dhur?a3Ranchi Nhar2han(

You might also like