![企業(yè)業(yè)務(wù)開(kāi)發(fā)實(shí)踐項(xiàng)目報(bào)告_第1頁(yè)](http://file4.renrendoc.com/view/a62cac8cbbd61f297fe2bdfd54e43b32/a62cac8cbbd61f297fe2bdfd54e43b321.gif)
![企業(yè)業(yè)務(wù)開(kāi)發(fā)實(shí)踐項(xiàng)目報(bào)告_第2頁(yè)](http://file4.renrendoc.com/view/a62cac8cbbd61f297fe2bdfd54e43b32/a62cac8cbbd61f297fe2bdfd54e43b322.gif)
![企業(yè)業(yè)務(wù)開(kāi)發(fā)實(shí)踐項(xiàng)目報(bào)告_第3頁(yè)](http://file4.renrendoc.com/view/a62cac8cbbd61f297fe2bdfd54e43b32/a62cac8cbbd61f297fe2bdfd54e43b323.gif)
![企業(yè)業(yè)務(wù)開(kāi)發(fā)實(shí)踐項(xiàng)目報(bào)告_第4頁(yè)](http://file4.renrendoc.com/view/a62cac8cbbd61f297fe2bdfd54e43b32/a62cac8cbbd61f297fe2bdfd54e43b324.gif)
![企業(yè)業(yè)務(wù)開(kāi)發(fā)實(shí)踐項(xiàng)目報(bào)告_第5頁(yè)](http://file4.renrendoc.com/view/a62cac8cbbd61f297fe2bdfd54e43b32/a62cac8cbbd61f297fe2bdfd54e43b325.gif)
版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、PAGE 大 連 東 軟軟 信 息 學(xué)學(xué) 院企業(yè)業(yè)務(wù)務(wù)開(kāi)發(fā)實(shí)實(shí)踐實(shí)驗(yàn)報(bào)告告系 別: 信信息管理理系 專(zhuān)業(yè)班級(jí)級(jí): 信息 學(xué) 號(hào): 1151 學(xué)生姓名名: 指導(dǎo)教師師: 張張奇松 20155年 8月 177 日 企業(yè)業(yè)務(wù)開(kāi)發(fā)實(shí)踐一、GUUI基礎(chǔ)礎(chǔ)知識(shí)習(xí)習(xí)題1.圖形形界面1.1實(shí)實(shí)驗(yàn)?zāi)康牡膶W(xué)習(xí)GUUI,主主要是SSwinng程序序設(shè)計(jì),包括常常用窗體體,標(biāo)簽簽組件和和圖表,常用布布局管理理器,常常用面板板,按鈕鈕組件,文本組組件以及及事件監(jiān)監(jiān)聽(tīng)器等等。1.2實(shí)實(shí)驗(yàn)代碼碼及運(yùn)行行結(jié)果(運(yùn)行結(jié)結(jié)果截圖圖)1.創(chuàng)建建一個(gè)窗窗體,布布局如圖圖所示,窗體大大小為3300,2000setBBounnds(10
2、00, 1100, 3000, 2000);coonteentPPanee = neww JPPaneel();coonteentPPanee.seetBoordeer(nnew EmpptyBBordder(5, 5, 5, 5);coonteentPPanee.seetLaayouut(nnew BorrderrLayyoutt(0, 0);seetCoonteentPPanee(coonteentPPanee);JLLabeel llblsswinng = neew JJLabbel(uu4F660uu5977DuuFF00CSwwingg);coonteentPPanee.addd(l
3、lblsswinng, BorrderrLayyoutt.WEEST);2.創(chuàng)建建一個(gè)窗窗體,布布局如圖圖所示,窗體大大小為2200,1200conttenttPanne = neew JJPannel();coonteentPPanee.seetBoordeer(nnew EmpptyBBordder(5, 5, 5, 5);seetCoonteentPPanee(coonteentPPanee);coonteentPPanee.seetLaayouut(nnulll);JBButtton btnnNewwButttonn = neww JBButtton(uu5DEE6);bttnNeew
4、Buuttoon.aaddAActiionLListteneer(nnew ActtionnLisstenner() ppubllic voiid aactiionPPerfformmed(ActtionnEveent e) bttnNeewBuuttoon.ssetBBounnds(31, 688, 771, 38);coonteentPPanee.addd(bbtnNNewBButtton);JBButtton btnnNewwButttonn_1 = nnew JBuuttoon(u44E2DDu995F44);bttnNeewBuuttoon_11.seetBooundds(1135,
5、 688, 884, 38);coonteentPPanee.addd(bbtnNNewBButtton_1);JBButtton btnnNewwButttonn_2 = nnew JBuuttoon(u553F33);bttnNeewBuuttoon_22.seetBooundds(2255, 688, 661, 38);coonteentPPanee.addd(bbtnNNewBButtton_2);JCChecckBoox cchecckBoox = neew JJCheeckBBox(uu5DEE6);chheckkBoxx.seetBooundds(331, 1611, 771,
6、23);coonteentPPanee.addd(cchecckBoox);JCChecckBoox cchecckBoox_11 = neww JCChecckBoox(u553F33);chheckkBoxx_1.settBouundss(1000, 1611, 880, 23);coonteentPPanee.addd(cchecckBoox_11);JRRadiioBuuttoon rradiioBuuttoon = neew JJRaddioBButtton(uu5DEE6);raadiooButttonn.seetBooundds(1182, 1661, 83, 233);coon
7、teentPPanee.addd(rradiioBuuttoon);JRRadiioBuuttoon rradiioBuuttoon_11 = neww JRRadiioBuuttoon(u553F33);raadiooButttonn_1.settBouundss(2667, 1611, 884, 23);conntenntPaane.addd(raadiooButttonn_1);3. 創(chuàng)創(chuàng)建一個(gè)個(gè)窗體,布局如圖圖所示,窗體大大小為3300,1200setTTitlle(u77EFCCu554088u44F8BBu77A0BB);seetDeefauultCClosseOpperaatio
8、on(JJFraame.EXIIT_OON_CCLOSSE);seetBooundds(1100, 1000, 3000, 1120);coonteentPPanee = neww JPPaneel();coonteentPPanee.settBorrderr(neew EEmpttyBoordeer(55, 55, 55, 55);seetCoonteentPPanee(coonteentPPanee);coonteentPPanee.seetLaayouut(nnulll);JLListt liist_1 = neew JLiist();liist_1.ssetBBounnds(2511,
9、 1114, 299, -17);coonteentPPanee.addd(llistt_1);JCCombboBoox ccombboBoox = neew JCoombooBoxx();coombooBoxx.seetMoodell(neew DDefaaulttCommboBBoxMModeel(nnew Strringg u90009u98879u4EE00, u90009u98879u4EE8C, u90009u98879u4EE09);coombooBoxx.seetBooundds(223, 22, 655, 228);coonteentPPanee.addd(ccombboBo
10、ox);JLListt liist = nnew JLiist();liist.settModdel(neww AbbstrracttLisstMoodell() SStriing vvaluues = nnew Strringg u90009u98879u4EE00, u90009u98879u4EE8C, u90009u98879u4EE09;ppubllic intt geetSiize() retturnn valluess.lenngthh;ppubllic Objjectt geetEllemeentAAt(iint inddex) retturnn valluessinndexx
11、;);liist.settBouundss(988, 110, 50, 611);coonteentPPanee.addd(llistt);JLListt liist_3 = neew JLiist();liist_3.ssetBBounnds(2799, 333, -9, 511);coonteentPPanee.addd(llistt_3);JLListt liist_2 = neew JLiist();liist_2.ssetBBounnds(3099, 1114, 1, 1);coonteentPPanee.addd(llistt_2);JSScroollPPanee sccrolll
12、Paane = nnew JSccrolllPaane();sccrolllPaane.settBouundss(1669, 6, 50, 611);coonteentPPanee.addd(sscroollPPanee);JTTexttAreea ttexttAreea = neew JJTexxtArrea();teextAAreaa.seetTeext(1rnn2rrn33rn4rnn5);sccrolllPaane.settVieewpoortVVieww(teextAAreaa);4. 創(chuàng)創(chuàng)建一個(gè)個(gè)登錄界面面,布局局如圖所所示,窗窗體大小小為300,2000setTTitlle(u7
13、767BBu55F555u7754CCu997622);seetDeefauultCClosseOpperaatioon(JJFraame.EXIIT_OON_CCLOSSE);seetBooundds(1100, 1000, 3000, 2200);coonteentPPanee = neww JPPaneel();coonteentPPanee.seetBoordeer(nnew EmpptyBBordder(5, 5, 5, 5);seetCoonteentPPanee(coonteentPPanee);coonteentPPanee.seetLaayouut(nnulll);JLLab
14、eel llabeel = neew JJLabbel(uu75228uu62337uu5400DuuFF11A);laabell.seetBooundds(221, 47, 544, 115);coonteentPPanee.addd(llabeel);JLLabeel llabeel_11 = neww JLLabeel(u55BC66u778011uFFF1AA);laabell_1.settBouundss(211, 772, 54, 155);coonteentPPanee.addd(llabeel_11);JTTexttAreea ttexttAreea = neew JJTexx
15、tArrea();teextAAreaa.seetBooundds(668, 43, 1004, 19);coonteentPPanee.addd(ttexttAreea);JTTexttAreea ttexttAreea_11 = neww JTTexttAreea();teextAAreaa_1.settBouundss(688, 772, 1044, 115);coonteentPPanee.addd(ttexttAreea_11);JBButtton butttonn = neww JBButtton(uu7677Buu5F555);buuttoon.ssetBBounnds(10,
16、1114, 93, 233);coonteentPPanee.addd(bbuttton);JBButtton butttonn_1 = nnew JBuuttoon(u991CDDu77F6EE);buuttoon_11.seetBooundds(1130, 1114, 93, 233);conttenttPanne.aadd(butttonn_1);5.創(chuàng)建建一個(gè)窗窗體,布布局如圖圖所示,窗體大大小為5500,3000setTTitlle(euu5FAAEuu8FDDBuu95000uu5B558uu7BAA1uu74006uu7CFFBuu7EDDF);seetDeefauultCClo
17、sseOpperaatioon(JJFraame.EXIIT_OON_CCLOSSE);seetBooundds(1100, 1000, 5000, 3300);JMMenuuBarr meenuBBar = nnew JMeenuBBar();seetJMMenuuBarr(meenuBBar);JMMenuu meenu = neew JJMennu(u665877u44EF66);meenuBBar.addd(meenu);JMMenuuIteem mmenuuIteem = neew JJMennuIttem(uu65BB0uu5EFFA);meenu.addd(meenuIItemm
18、);JMMenuuIteem mmenuuIteem_11 = neww JMMenuuIteem(u662533u55F000);meenu.addd(meenuIItemm_1);JMMenuuIteem mmenuuIteem_22 = neww JMMenuuIteem(u44FDDDu55B588);meenu.addd(meenuIItemm_2);JMMenuuIteem mmenuuIteem_33 = neww JMMenuuIteem(u990000u551FAA);meenu.addd(meenuIItemm_3);JMMenuu meenu_1 = neew JJMen
19、nu(u555466u554C11u77BA11u774066);meenuBBar.addd(meenu_1);JMMenuuIteem mmntmmNewwMennuIttem = nnew JMeenuIItemm(u55546u544C1u677E5u8BBE2);meenu_1.aadd(mnttmNeewMeenuIItemm);JMMenuuIteem mmenuuIteem_44 = neww JMMenuuIteem(u555466u554C11u66DFBBu552A00);meenu_1.aadd(mennuIttem_4);JMMenuuIteem mmntmmNeww
20、MennuIttem_1 = neew JJMennuIttem(uu55446uu54CC1uu4FEEEuu65339);meenu_1.aadd(mnttmNeewMeenuIItemm_1);JMMenuuIteem mmenuuIteem_55 = neww JMMenuuIteem(u555466u554C11u552200u996644);meenu_1.aadd(mennuIttem_5);JMMenuu meenu_2 = neew JJMennu(u44F9BBu55E944u555466);meenuBBar.addd(meenu_2);JMMenuuIteem mmen
21、uuIteem_66 = neww JMMenuuIteem(u77F166u88F911u44F9BBu55E944u555466);meenu_2.aadd(mennuIttem_6);JMMenuu meenu_3 = neew JJMennu(u775288u662377);meenuBBar.addd(meenu_3);JMMenuuIteem mmenuuIteem_77 = neww JMMenuuIteem(u77F166u88F911u775288u662377);meenu_3.aadd(mennuIttem_7);coonteentPPanee = neww JPPane
22、el();coonteentPPanee.seetBoordeer(nnew EmpptyBBordder(5, 5, 5, 5);coonteentPPanee.seetLaayouut(nnew BorrderrLayyoutt(0, 0);seetCoonteentPPanee(coonteentPPanee);2.Jaava基基礎(chǔ)知識(shí)識(shí)回顧2.1實(shí)實(shí)驗(yàn)?zāi)康牡幕仡橨aava基基礎(chǔ)知識(shí)識(shí),包括括基本數(shù)數(shù)據(jù)類(lèi)型型,流程程控制,字符串串,類(lèi)和和對(duì)象等等基礎(chǔ)知知識(shí)。2.2實(shí)實(shí)驗(yàn)代碼碼及運(yùn)行行結(jié)果(運(yùn)行結(jié)結(jié)果截圖圖)1.進(jìn)行行下列變變量說(shuō)明明:初始值值為0的的intt變量;初始值值為10000的的
23、lonng變量量;初始值值為3.4的ffloaat變量量;初始值值為344.455的dooublle變量量;初始值值為4的的chaar變量量;初始值值為trrue的的boooleaan變量量;pacckagge ffisttswiing;publlic claass helllowwordd pubblicc staaticc voiid mmainn(Sttrinng arrgs) / TOODO 自動(dòng)生生成的方方法存根根int a=0;longg b=10000;floaat c=3.4f;doubble d=344.455;charr e=4;boolleann f=truue;2.考慮
24、慮下面的的語(yǔ)句,這些語(yǔ)語(yǔ)句正確確嗎?bytte aa = 1000;lonng bb = a*33+4;douublee c = aa*3.1+bb/2;intt x = bb; lonng bb = x;byteea=1100;loongb=a*3+44;ddoubblec=a*3.11+b/2;inttx=bb;lonngbb=x;3.設(shè)有有以下分分段函數(shù)數(shù):編寫(xiě)一程程序,輸輸入自變變量x的值,輸出函函數(shù)y的值。利用多分分支iff語(yǔ)句的的方法編編寫(xiě)程序序。packkagee fiistsswinng;impoort javva.uutill.Sccannner;publlic claass
25、 a08816 pubblicc staaticc voiid mmainn(Sttrinng arrgs) / TOODO 自動(dòng)生生成的方方法存根根Scannnerr Nuumbeer=neww Sccannner(Sysstemm.inn);int a=NNumbber.nexxtInnt();int y;if(aa0)Sysstemm.ouut.pprinntlnn(y=1);if(aa=00)Sysstemm.ouut.pprinntlnn(y=0);if(aa0)Sysstemm.ouut.pprinntlnn(y=1);elsee if(aa=00)Sysstemm.ouut.pp
26、rinntlnn(y=0);elseeSysstemm.ouut.pprinntlnn(y=0);4.輸出出1000內(nèi)所有有的奇數(shù)數(shù)。注:奇數(shù)就就是不能能被2整除的的數(shù)packkagee fiistsswinng;publlic claass abcc pubblicc staaticc voiid mmainn(Sttrinng arrgs) / TOODO 自動(dòng)生生成的方方法存根根for(intt i=1;ii=1100;i+)if(i%22=11)Syysteem.oout.priint(i+ );5.在控控制臺(tái)打打印出1100以以?xún)?nèi)所有有質(zhì)數(shù)。packkagee fiistsswinn
27、g;publlic claass bbbb pubblicc staaticc voiid mmainn(Sttrinng arrgs) / TOODO 自動(dòng)生生成的方方法存根根innt jj;foor(intt i=2;ii=1100;i+)jj=2;wwhille(ii%j!=0)j+;iif(jj=ii)Sysstemm.ouut.pprinntlnn(i);6.求解解滿(mǎn)足112+22+32+i2=10000)bbreaak;Syysteem.oout.priint(i-11);7.請(qǐng)定定義一個(gè)個(gè)交通工工具(VVehiiclee)的類(lèi)類(lèi),其中中有:屬性:速速度 (speeed),體積積
28、(ssizee)等等等。方法:移移動(dòng) (movve(),設(shè)設(shè)置速度度(seetSppeedd(innt sspeeed)、設(shè)置置體積(settSizze(iint sizze),加速速speeedUUp(iint speeed),減速速speeedDDownn(innt sspeeed)等等等。最后在測(cè)測(cè)試類(lèi)VVehiiclee中的mmainn()中中實(shí)例化化一個(gè)交交通工具具對(duì)象,并通過(guò)過(guò)方法給給它設(shè)置置speeed,sizze的值值,并且且打印出出來(lái)。另另外,調(diào)調(diào)用加速速,減速速的方法法對(duì)速度度進(jìn)行改改變。packkagee fiistsswinng;publlic claass Vehhi
29、clle privvatee innt speeed;privvatee innt sizze;pubblicc intt geetSppeedd() retturnn speeed;publlic voiid ssetSSpeeed(iint speeed) thiis.speeed = sspeeed;publlic intt geetSiize() retturnn sizze;publlic voiid mmovee()Sysstemm.ouut.pprinntlnn(移移動(dòng)了);publlic voiid ssetSSizee(innt ssizee) thiis.sizze = s
30、iize;pubblicc staaticc voiid mmainn(Sttrinng arrgs) / TOODO 自動(dòng)生生成的方方法存根根Vehiiclee v=neww Veehiccle();v.seetSiize(20);v.seetSppeedd(600);v.moove();8.編寫(xiě)寫(xiě)一個(gè)抽抽象類(lèi)-圖形類(lèi)類(lèi)(Grraphhic),包含含一個(gè)求求圖形面面積的抽抽象方法法(arrea())。編寫(xiě)圖形形類(lèi)的子子類(lèi)三角形形類(lèi)(TTriaanglle),屬性包包括三角角形三條條邊長(zhǎng),使用構(gòu)構(gòu)造方法法初始化化三條邊邊,編寫(xiě)寫(xiě)能夠判判斷三角角形是何何種三角角形(等等腰、等等邊、直直角、普普通
31、)的的方法(kinnd())。編編寫(xiě)比較較三角形形大小的的方法(commparre()),利利用方法法重載,實(shí)現(xiàn)比比較2個(gè)個(gè)三角形形和3個(gè)個(gè)三角形形大小的的功能。重新實(shí)實(shí)現(xiàn)父類(lèi)類(lèi)的面積積方法。doubble p=(siddeA+siddeB+siddeC)/2.0; ddoubble areea=MMathh.sqqrt(p*(p-ssideeA)*(p-siddeB)*(pp-siideCC); SSysttem.outt.prrinttln(namme+面積是是:+areea);packkagee fiistsswinng;publlic absstraact claass Graaphi
32、ic publlic absstraact douublee arrea();packkagee fiistsswinng;publlic cllasss Trriannglee exxtennds Graaphiic douublee a,b,c; douublee areea; pubblicc Trriannglee(dooublle aa,dooublle bb, ddoubble c) thhis.a=a; thhis.b=b; thhis.c=c; pubblicc voiid kkindd()iff(a+bc&a+cb&b+ca)iif(a=b&b=c&c=a)Sysstemm.
33、ouut.pprinntlnn(該該三角形形為等邊邊三角形形) ;eelsee if(a=b|b=c|a=c)Sysstemm.ouut.pprinntlnn(該該三角形形為等腰腰三角形形) ; eelseeSSysttem.outt.prrinttln(不能能構(gòu)成三三角形); pubblicc voiid ccompparee(Trriannglee t11,Trriannglee t22) dooublle aareaa1=tt1.aareaa(); dooublle aareaa2=tt2.aareaa(); iff(arrea11arrea22)SSysttem.outt.prrint
34、tln(第一一個(gè)三角角形大); ellse if(aareaa1=areea2)Syysteem.oout.priintlln(兩兩個(gè)三角角形一樣樣大); ellseSysstemm.ouut.pprinntlnn(第第二個(gè)三三角形大大); pubblicc staaticc voiid mmainn(Sttrinngarggs) Trriannglee t11=neew TTriaanglle(33,4,5); Trriannglee t22=neew TTriaanglle(33,3,4); t11.coompaare(t1, t22); dooublle aareaa1=tt1.aare
35、aa(); Syysteem.oout.prrinttln(areea1); OOverrriddepuubliic douublee arrea() / TTODOO 自動(dòng)動(dòng)生成的的方法存存根ddoubble p=(a+b+c)/22.0;aareaa=Maath.sqrrt(pp*(pp-a)*(p-bb)*(p-cc);rretuurn areea;9.創(chuàng)建建一個(gè)名名稱(chēng)為VVehiiclee的接口口,在接接口中添添加兩個(gè)個(gè)方法sstarrt()和sttop()。在在兩個(gè)名名稱(chēng)分別別為Biike和和Buss的類(lèi)中中實(shí)現(xiàn)VVehiiclee接口。創(chuàng)建一一個(gè)名稱(chēng)稱(chēng)為innterrfacceTe
36、est的的類(lèi),在在intterffaceeTesst的mmainn()方方法中創(chuàng)創(chuàng)建Biike和和Buss對(duì)象,并訪(fǎng)問(wèn)問(wèn)staart()和sstopp()方方法。packkagee fiistsswinng;impoort javva.uutill.Sccannner;publlic claass ddddd pubblicc staaticc voiid mmainn(Sttrinng arrgs) / TOODO 自動(dòng)生生成的方方法存根根innt a=neww intt8;Sccannner Nummberr=neww Sccannner(Sysstemm.inn);foor(intt i
37、=0;ii=77;i+)ai=Nummberr.neextIInt();innt mmin=a00,mmax=a00,ssum=0,aavg=0;foor(intt i=0;iimaax)maxx=ai;iif(aaimiin)minn=ai;ssum=summ+ai;avvg=(summ-maax-mmin)/(aa.leengtth-22);Syysteem.oout.priint(avgg);10.共共有8個(gè)評(píng)審審打分,統(tǒng)計(jì)時(shí)時(shí),去掉掉一個(gè)最最高分和和一個(gè)最最低分,其余66個(gè)分?jǐn)?shù)數(shù)的平均均分為最最后得分分。編寫(xiě)寫(xiě)一個(gè)程程序顯示示這個(gè)分分?jǐn)?shù)。packkagee fiistsswinng;i
38、mpoort javva.uutill.Sccannner;publlic claass ddddd pubblicc staaticc voiid mmainn(Sttrinng arrgs) / TOODO 自動(dòng)生生成的方方法存根根innt a=neww intt8;Sccannner Nummberr=neww Sccannner(Sysstemm.inn);foor(int ii=0;i=7;ii+)ai=Nummberr.neextIInt();innt mmin=a00,mmax=a00,ssum=0,aavg=0;foor(intt i=0;iimaax)maxx=ai;iif(
39、aai=25000(66)查詢(xún)?cè)僂MPP表中薪薪水不等等于25500的的所有數(shù)數(shù)據(jù)SEELECCT*frromemppWHEEREsall!=225000(7)查查詢(xún)EMMP表中中雇員編編號(hào)在77600079900之之間的所所有數(shù)據(jù)據(jù)SEELECCT*frromemppWHEEREemppno=76600anddemmpnoo=779000(8)模模糊查詢(xún)?cè)僂MPP表中,員工名名中含有有“五”的員工工信息SSELEECT*ffrommemmpWHHEREEennameeLIIKE%五%(9)查詢(xún)EEMP表表中雇員員姓名中中第二個(gè)個(gè)字是“三”的的雇員的的所有信信息SEELECCT*frromem
40、ppWHEEREenaameLIKKE_三%DELLETEEfrromdepptwhhereedeeptnno=110DEELETTEffrommemmpwhhereedeeptnno=110SEELECCTeemp.*,ddeptt.*froomeemp,depptwwherreeemp.depptnoo=deept.depptnoo (100)使用兩表表連接,查詢(xún)EEMP表表和DEPPT表中中的所有有信息seleect * ffromm deept joiin eemp on deppt.ddepttno =emmp.ddepttno(11)使用兩表表連接,查詢(xún)EEMP表表中部門(mén)門(mén)名稱(chēng)為為
41、“市場(chǎng)場(chǎng)部”的的所有雇雇員信息息seleect * ffromm deept joiin eemp on deppt.ddepttno =emmp.ddepttno wherre ddnamme =市市場(chǎng)部 (122)使用兩表表連接,更新EEMP表表中所有有部門(mén)名名稱(chēng)為“市場(chǎng)部部”的員工工的工資資,在原原本的基基礎(chǔ)上增增加2000updaateempp,deeptsettemmp.ssal=empp.saal+2200wheeredeppt.ddepttno=empp.deeptnnoaanddeppt.ddnamme=市場(chǎng)部部(13)在DEEPT中中刪除部門(mén)門(mén)10,刪除EEMP表表中部門(mén)門(mén)號(hào)
42、為10的所有有員工deleete froom ddeptt whheree dnnamee=550deleete ffromm emmp wwherre ddepttno=5002.使用用JDBBC完成成對(duì)MyySqll數(shù)據(jù)庫(kù)庫(kù)的連接接。3.使用用JDBBC技術(shù)術(shù),完成成數(shù)據(jù)庫(kù)庫(kù)表Usser(id,namme,aage)的所有數(shù)數(shù)據(jù)查詢(xún)?cè)?,并在在控制臺(tái)臺(tái)進(jìn)行簡(jiǎn)單單的數(shù)據(jù)據(jù)顯示。5.綜合合實(shí)例練練習(xí)5.1實(shí)實(shí)驗(yàn)?zāi)康牡木C合使用用GUII圖形用用戶(hù)界面面、事件件處理、數(shù)據(jù)庫(kù)庫(kù)表操作作進(jìn)行程程序編寫(xiě)寫(xiě),完成成一個(gè)具體體功能的的數(shù)據(jù)庫(kù)庫(kù)表增刪刪改查的的操作。5.2實(shí)實(shí)驗(yàn)代碼碼及運(yùn)行行結(jié)果(運(yùn)行結(jié)結(jié)果截圖
43、圖)packkagee liiyaoo.evvbuyy;impoort javva.ssql.*;impoort javva.uutill.ArrrayyLisst;impoort javva.uutill.HaashMMap;impoort javva.uutill.Liist;impoort javva.uutill.Maap;publlic claass ConnnDBB priivatte sstattic Strringg dbbclaassnnamee=ccom.myssql.jdbbc.DDrivver; priivatte sstattic Strringg dbburll=j
44、jdbcc:myysqll:/loccalhhostt:33306/evbbuy; priivatte sstattic Strringg dbbuseer=rooot; priivatte sstattic Strringg dbbpwdd=11111111; pubblicc Coonneectiion gettConnnecctioon() tryy Claass.forrNamme(ddbcllasssnamme); Connnecctioon cconnn=DrriveerMaanagger.gettConnnecctioon(ddburrl, dbuuserr, ddbpwwd);
45、 reeturrn cconnn; caatchh(Exxcepptioon ee) Sysstemm.ouut.pprinntlnn(e); retturnn nuull; pubblicc ReesulltSeet ggetRResuult(Strringg sqql)trryCConnnecttionn coonn=thiis.ggetCConnnecttionn();SStattemeent stmmt=cconnn.crreatteSttateemennt();RResuultSSet re=stmmt.eexeccuteeQueery(sqll);rretuurn re;caatc
46、hh(Exxcepptioon ee)SSysttem.outt.prrinttln(geetReesullt+e.ttoSttrinng();rretuurn nulll;pubblicc boooleean exeecutteSqql(SStriing sqll)trryCConnnecttionn coonn=thiis.ggetCConnnecttionn();SStattemeent stmmt=cconnn.crreatteSttateemennt();sstmtt.exxecuuteUUpdaate(sqll);/mmitt();rretuurn truue;caatchh(Ex
47、xcepptioon ee)SSysttem.outt.prrinttln(exxecuuteSSql+ee.tooStrringg();rretuurn fallse;pubblicc sttatiic vvoidd maain(Strringg arggs) CoonnDDB cconnndb=neww CoonnDDB();/*RessulttSett rss=coonnddb.ggetRResuult(seelecct uuserr_idd,usser_pwdd,dppm_nnamee frrom useer,ddepaartmmentt whheree usser.useer_ddp
48、m=depparttmennt.ddpm_id);trry wwhille(rrs.nnextt()Sysstemm.ouut.pprinntlnn(rss.geetSttrinng(11); cattch (SQQLExxcepptioon ee) / TTODOO 自動(dòng)動(dòng)生成的的 caatchh 塊ee.prrinttStaackTTracce();*/iff(coonnddb.eexeccuteeSqll(ddeleete froom uuserr whheree usser_id = a)SSysttem.outt.prrintt(11);eelseeSSysttem.outt.prr
49、intt(22); packkagee liiyaoo.evvbuyy;impoort javva.aawt.BorrderrLayyoutt;impoort javva.aawt.EveentQQueuue;impoort javvax.swiing.JFrramee;impoort javvax.swiing.JPaanell;impoort javvax.swiing.borrderr.EmmptyyBorrderr;impoort javvax.swiing.JLaabell;impoort javvax.swiing.JOpptioonPaane;impoort javvax.swi
50、ing.JTeextFFielld;impoort javvax.swiing.JPaasswworddFieeld;impoort javvax.swiing.JBuuttoon;impoort javva.aawt.eveent.ActtionnLisstenner;impoort javva.aawt.eveent.ActtionnEveent;impoort javva.aawt.eveent.MouuseAAdappterr;impoort javva.aawt.eveent.MouuseEEvennt;impoort javva.aawt.eveent.KeyyAdaapteer;
51、impoort javva.aawt.eveent.KeyyEveent;impoort javva.ssql.RessulttSett;impoort javva.ssql.SQLLExccepttionn;publlic claass Loggin exttendds JJFraame priivatte JJPannel conntenntPaane;priivatte JJTexxtFiieldd txxtUsserNNamee;priivatte JJPassswoordFFielld ttxtPPasssworrd;/* * Lauunchh thhe aappllicaatioo
52、n. */pubblicc sttatiic vvoidd maain(Strringg arggs) EvventtQueeue.invvokeeLatter(neww Ruunnaablee() ppubllic voiid rrun() tryy Loggin fraame = nnew Loggin();fraame.settVissiblle(ttruee); ccatcch (Exccepttionn e) e.pprinntSttackkTraace(););/* * Creeatee thhe fframme. */pubblicc Looginn() seetTiitlee(
53、u7667Bu5FF55u7554Cu97762);seetDeefauultCClosseOpperaatioon(JJFraame.EXIIT_OON_CCLOSSE);seetBooundds(1100, 1000, 3000, 1189);coonteentPPanee = neww JPPaneel();coonteentPPanee.seetBoordeer(nnew EmpptyBBordder(5, 5, 5, 5);seetCoonteentPPanee(coonteentPPanee);coonteentPPanee.seetLaayouut(nnulll);JLLabee
54、l llabeel = neew JJLabbel(uu75228uu62337uu5400D);laabell.seetBooundds(557, 40, 544, 115);coonteentPPanee.addd(llabeel);JLLabeel llabeel_11 = neww JLLabeel(u55BC66u778011);laabell_1.settBouundss(577, 777, 54, 155);coonteentPPanee.addd(llabeel_11);txxtUsserNNamee = neww JTTexttFieeld();txxtUsserNNamee
55、.seetBooundds(1121, 377, 996, 21);coonteentPPanee.addd(ttxtUUserrNamme);txxtUsserNNamee.seetCoolummns(10);txxtPaasswwordd = neww JPPasssworrdFiieldd();txxtPaasswwordd.seetBooundds(1121, 744, 996, 21);coonteentPPanee.addd(ttxtPPasssworrd);JBButtton btnnLoggin = nnew JBuuttoon(u7767BBu55F555);bttnLoog
56、inn.adddMoouseeLisstenner(neww MoouseeAdaapteer() Oveerriideppubllic voiid mmousseCllickked(MouuseEEvennt aarg00) Strringg usserIId=ttxtUUserrNamme.ggetTTextt();Strringg usserPPwd=neww Sttrinng(ttxtPPasssworrd.ggetPPasssworrd();ConnnDBB coonn=neww CoonnDDB();Strringg sqql=sellectt usser_pwdd frrom u
57、seer wwherre uuserr_idd=+usserIId+;RessulttSett rss=coonn.gettRessultt(sqql);tryy whiile(rs.nexxt() Sttrinng uuserrPwddCheeck=rs.gettStrringg(uuserr_pwwd).tooStrringg(); iff(usserPPwdCChecck.eequaals(useerPwwd) JOOptiionPPanee.shhowMMesssageeDiaalogg(nuull, 登登錄成功功!); Looginn.thhis.dissposse(); Maain
58、FFramme mmf=nnew MaiinFrramee(); mff.seetViisibble(truue); eelsee JOOptiionPPanee.shhowMMesssageeDiaalogg(nuull, 登登錄失敗敗!); txxtUsserNNamee.seetTeext(); txxtPaasswwordd.seetTeext(); ccatcch (SQLLExccepttionn e) / TODDO 自自動(dòng)生成成的 ccatcch 塊塊Sysstemm.ouut.pprinntlnn(e.toSStriing(););bttnLooginn.seetBoound
59、ds(331, 1188, 993, 23);coonteentPPanee.addd(bbtnLLogiin);JBButtton btnnResset = nnew JBuuttoon(u991CDDu77F6EE);bttnReesett.adddAcctioonLiisteenerr(neew AActiionLListteneer() ppubllic voiid aactiionPPerfformmed(ActtionnEveent e) txttUseerNaame.settTexxt();txttPassswoord.settTexxt(););bttnReesett.seet
60、Booundds(1164, 1118, 93, 233);coonteentPPanee.addd(bbtnRReseet);packkagee liiyaoo.evvbuyy;impoort javva.aawt.BorrderrLayyoutt;impoort javva.aawt.EveentQQueuue;impoort javvax.swiing.JFrramee;impoort javvax.swiing.JPaanell;impoort javvax.swiing.borrderr.EmmptyyBorrderr;impoort javvax.swiing.tabble.Def
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025-2030全球工業(yè)彩色標(biāo)簽打印機(jī)行業(yè)調(diào)研及趨勢(shì)分析報(bào)告
- 2025-2030全球嵌入式格柵熒光燈行業(yè)調(diào)研及趨勢(shì)分析報(bào)告
- 2025年全球及中國(guó)電腦鎮(zhèn)痛泵行業(yè)頭部企業(yè)市場(chǎng)占有率及排名調(diào)研報(bào)告
- 2025年全球及中國(guó)可編程玩具行業(yè)頭部企業(yè)市場(chǎng)占有率及排名調(diào)研報(bào)告
- 四川省宜賓市高三“二診”測(cè)試語(yǔ)文試題(含答案)
- 2025商場(chǎng)地產(chǎn)景區(qū)蛇年元宵節(jié)情人節(jié)發(fā)財(cái)(好巳花生主題)活動(dòng)策劃方案
- 物流協(xié)議合同
- 智能環(huán)保設(shè)備研發(fā)生產(chǎn)合同
- 2025委托代銷(xiāo)合同樣本新范文
- 三方消防工程合同
- 《聚焦客戶(hù)創(chuàng)造價(jià)值》課件
- 公安校園安全工作培訓(xùn)課件
- PTW-UNIDOS-E-放射劑量?jī)x中文說(shuō)明書(shū)
- 保險(xiǎn)學(xué)(第五版)課件全套 魏華林 第0-18章 緒論、風(fēng)險(xiǎn)與保險(xiǎn)- 保險(xiǎn)市場(chǎng)監(jiān)管、附章:社會(huì)保險(xiǎn)
- 許小年:淺析日本失去的30年-兼評(píng)“資產(chǎn)負(fù)債表衰退”
- 典范英語(yǔ)2b課文電子書(shū)
- 17~18世紀(jì)意大利歌劇探析
- β內(nèi)酰胺類(lèi)抗生素與合理用藥
- 何以中國(guó):公元前2000年的中原圖景
- 第一章:公共政策理論模型
- GB/T 4513.7-2017不定形耐火材料第7部分:預(yù)制件的測(cè)定
評(píng)論
0/150
提交評(píng)論