Monday, July 30, 2012
Command ေတြကို Bash History ကေဖ်ာက္ရေအာင္
Bash မွာ ေရွ႕က႐ိုက္သြားတဲ့ history ကိုသိမ္းထားပါတယ္။ ျပန္ၾကည့္ခ်င္ရင္ 'history' ဆိုတဲ့ command နဲ႕ ျပန္ေခၚၾကည့္လို႕ရပါတယ္။ System administrator ေတြ ၊ system engineer ေတြ တစ္ခုခုေမ့သြားရင္ ျပန္ၾကည့္ဖို႕လည္း လြယ္သလို၊ Team လိုက္ဆိုရင္ သူမ်ားဘာလုပ္ထားလည္းျပန္ၾကည့္လို႕ ရတယ္။
တစ္ခါတစ္ေလ ကိုယ္႐ိုက္ထားတဲ့ command ကို သူမ်ားကိုမၾကည့္ေစခ်င္ဘူး။ 'root' ေပးမသုံးတဲ့ locked down system မွာဆိုရင္ ကိုယ့္ bash history နဲ႕ကိုယ္ရွိေပမဲ့ 'root' ကို share ျပီးသုံးၾကရင္ bash history ကတစ္ခုထဲ။ကိုယ္ဘာလုပ္သြားလည္း ေနာက္လူက history မွာျပန္ၾကည့္လို႕ရတယ္ ။ တစ္ခါတစ္ေလ ကိုယ္ troubleshoot လုပ္ထားပံုကို ေနာက္လူကို မသိေစခ်င္ရင္ ဘယ္လိုလုပ္မလည္း ? ( Team ေတြ Department ေတြ ကြဲတဲ့ Company ေတြမွာ အခ်င္းခ်င္းျပိဳင္ဆိုင္မႈေတြ ရွိပါတယ္။ ဟိုဘက္ Team ကေကာင္ေတြ စသုံးမက်ဘူးလို႕ ေျပာဖို႕ ေစာင့္ေနၾကေတာ့ ကိုယ့္အလွည့္က်ရင္လည္း ကိုယ့္ knowledge ကို တျခား team ကိုမေပးခ်င္တာေတြ ရွိတတ္ပါတယ္။)
တစ္ခါတစ္ေလၾက audit ေပါ့။ Server မွာ ျပသနာ တစ္ခုခုျဖစ္သြားရင္ ၊ ဘယ္သူ႕ေၾကာင့္လည္း ျပန္ရွာတယ္။ ကိုယ္ကအမွားလုပ္လိုက္မိလို႕ ျပန္ fix လုပ္ျပီး ဖုံးထားခ်င္ရင္ေတာင္ bash history ကလိမ္ဖို႕ ခက္တယ္။bash_history file ကို edit လုပ္ရင္လည္း file integrity ပ်က္တယ္။ ေနာက္ျပီး edit လုပ္ထားမွန္းက ေဖ်ာက္ဖို႕မလြယ္ ။
ကဲ ကိုယ္႐ိုက္ထားတဲ့ command ေတြ ဘယ္လို ေဖ်ာက္ထားမလည္း ?
'history' command ရဲ့ output ကိုတစ္ခ်က္ၾကည့္ရေအာင္ ။
994 exit
995 cd /etc
996 ls
997 ls
998 vi rc.local
999 ps -ef|more
1000 exit
ဒီမွာ ဘယ္ဘက္က နံပါတ္ေတြကို offset လို႕ေခၚပါတယ္။ ညာဘက္ျခမ္းကေတာ့ command ေပါ့။ Offset number ကိုသိရင္ အဲ offset number ကို bash history ကေနဖ်က္ဖို႕ command ရွိပါတယ္။
'history' command မွာ '-d' ဆိုတဲ့ option ရွိပါတယ္ ။ ကိုယ္ဖ်က္ခ်င္တဲ့ command ကို history ကဖ်က္လို႕ရပါတယ္။ တစ္ခုပဲ ျပသနာက ။ 'history -d xx' ဆိုတဲ့ ဖ်က္လိုက္တယ္ဆိုတဲ့ line ၾကီးကေတာ့ history ထဲဝင္သြားတယ္။ ဥပမာ offset number 998 ( vi rc.local) ဆိုတာကို history ကဖ်က္ခ်င္တယ္ဆိုရင္ ' history -d 998' လို႕ ဖ်က္ရပါတယ္ ။ ဒါေပမဲ့ ေနာက္တစ္ခါ history ျပန္ၾကည့္ရင္ ဒီလိုၾကီး ေပၚလိမ့္မယ္။
994 exit
995 cd /etc
996 ls
997 ls
998 ps -ef|more
999 exit
1000 history -d 998
အဲေတာ့မွ ဘာဖ်က္ထားတာလည္းဆိုျပီး ရွုပ္ကုန္မွာ။ နည္းနည္း ပိုေကာင္းတဲ့ နည္းလမ္းေတြရွိပါတယ္ ။
Bash မွာ Shell Variable တစ္ခုရွိပါတယ္။ HISTCMD လို႕ေခၚတဲ့ Variable ပါ။ 'echo $HISTCMD' လို႕႐ိုက္ၾကည့္ရင္ နံပါတ္တစ္ခုကိုေပးပါလိမ့္မယ္။ အဲဒါက ေနာက္ command အတြက္ offset ပါ။ ခုနက 1000 အထိေရာက္ျပီးတဲ့ အခ်ိန္မွာ 'echo $HISTCMD' လို႕႐ိုက္ၾကည့္ရင္ 1002 ဆိုတဲ့ output ကိုေပးပါလိမ့္မယ္။ ဘာလို႕လည္းဆို 1000 က 'history -d 998' ဆိုတဲ့ command ျဖစ္ျပီး echo $HISTCMD က 1001 ပါ။ အဲေတာ့ output က ေနာက္ command အတြက္ ရမယ့္ offset 1002 လို႕ရတာပါ။ ဒီ Variable ကိုသုံးျပီး bash history ကိုလိမ္လို႕ရပါတယ္။
$HISTCMD က ေနာက္လာမဲ့ command ရဲ့ offset ကိုေပးတယ္လို႕ ခုနကေျပာထားတယ္ေနာ္။ $HISTCMD-1 ဆိုရင္ လက္ရွိ command ရဲ့ offset ေပါ့။ 'history -d (($HISTCMD-1)) ဆိုရင္ ဒီ command ကို bash history ကေန ျပန္ျပန္ဖ်က္ေနတာနဲ႕ အတူတူပဲ။
ေနာက္တစ္ခု သိရမွာက Bash ရဲ့ operator ေတြပါ ။ Bash ရဲ့ '&&' ဆိုတဲ့ operator က 'AND' ကို ကိုယ္စားျပဳပါတယ္။ Command ႏွစ္ခုကို တစ္ခုျပီး တစ္ခု ဆက္လုပ္သြားဖို႕ သုံးပါတယ္။ Package compilation အတြက္ 'make && make install' ဆိုတာမ်ိဳး႐ိုက္ျပီး ထမင္းသြားစာတာမ်ိဳးေပါ့။ ပထမ command က completed successful ျဖစ္ရင္ ဒုတိရ command ကို ဆက္အလုပ္လုပ္ပါတယ္။ Error ျဖစ္သြားရင္ေတာ့ ရပ္သြားတယ္။ Command ႏွစ္ခုျဖစ္ေပမဲ့ Bash History မွာေတာ့ offset တစ္ခုနဲ႕ entry တစ္ခုပဲ ဝင္ပါတယ္။
1003 ls -l && history
ကဲ ဒီေလာက္ဆို မွန္းမိေလာက္ပါျပီ ။ ႐ိုက္ခ်င္တဲ့ command ကို႐ိုက္ ၊ ျပီးရင္ေနာက္က && ခံျပီး 'history -d (($HISTCMD-1))' ထဲ့႐ိုက္ရင္ ကိုယ္႐ိုက္သမွ် bash history ထဲ မေရာက္ေတာ့ဘူး။ ဒါမ်ိဳးေပါ့ ..
# rm -rf /etc && history -d (($HISTCMD-1))
ဒါဆို /etc ကို ဖ်က္လိုက္တဲ့ command က history ထဲမေရာက္ေတာ့ဘူး။ 'history -d' ကို အေရွ႕မွာထားထား အေနာက္မွာထားထား တူတူပါပဲ။ တစ္ခါတစ္ေလ ေနာက္က ထဲ့႐ိုက္ဖို႕ေမ့သြားရင္လို႕ bash history ထဲေရာက္သြားရင္ေတာ့ ဒီလို ကြန္႕လိုက္ေပါ့။ ဒါဆို ေနာက္ဆုံး history ႏွစ္ခု ဖ်က္သြားလိမ့္မယ္။ ေရွ႕က ေမ့သြားတဲ့ command ေရာ ၊ ဒီဖ်က္တဲ့ဟာကိုေရာ။
# history -d $((HISTCMD-2)) && history -d $((HISTCMD-1))
Catch တစ္ခုေတာ့ ရွိပါတယ္။ ဒါက Bash Variable ပါ ။ ဒါေတာင္ Bash version အေဟာင္းေတြမွာ ဒီ Variable မရွိပါဘူး။ ksh တို႕ဘာတို႕မွာလည္း မရွိဘူး ထင္တယ္။ HISTCMD မရွိရင္ နည္းနည္း ေလး အလုပ္ပိုပါတယ္။
TMP=$(history | tail -1 | awk '{print $1}') && history -d $TMP
ဒါလည္း ေရွ႕ကထားထား ေနာက္ကထားထား ရပါတယ္ ။
႐ိုက္ရတာ ရွုပ္ရင္ ကိုယ့္ bashrc ထဲမွာ ကိုယ့္ဟာကို alias ေပးထားလိုက္ေပါ့ ။ ဒါေပမယ့္ trace မက်န္ေအာင္ဖ်က္ပါတယ္ဆို bashrc မွာ trace ၾကီးက်န္ေနမွာေတာ့ မမိုက္ပါဘူး ၊ ဒါေပမဲ့ က်ေနာ္လို lazy ေတြကေတာ့ ဝင္ဝင္ခ်င္း alias ေလးေပး ၊ ျပီး session close မလုပ္ခင္မွာ bashrc ကေန ျပန္ဖ်က္ျပီး အေပၚမွာေပးထားတဲ့အတိုင္း ေနာက္ဆုံး command ႏွစ္ခုဖ်က္ခဲ့လိုက္တယ္။
တစ္ခုေတာ့ Caution ေပးပါတယ္။ တစ္ခ်ိဳ႕ environment မွာ VPN နဲ႕မွ servers ေတြကို ဝင္လို႕ရျပီး VPN မွာ keystroke log လုပ္ထားတတ္ပါတယ္။ ဒါဆိုရင္ေတာ့ ဟဲဟဲ ။
ကဲ ကိုယ့္ trace ကိုယ္ ေဖ်ာက္ႏိုင္ပါေစ ။ က်ေနာ္ သိတဲ့ ၊ သုံးတဲ့ technique တစ္ခုကို share တာပါ ။ က်ေနာ္မသိတဲ့ catch ရွိေကာင္းရွိႏိုင္ပါတယ္ ။
Divinity
Tuesday, May 22, 2012
Jasper Reports
Jasper Reports
iReport Designer ေလးနဲ႕ Report ေလးတစ္ေခုေလာက္လုပ္ၾကည္႕ဖုိ႕ေကာင္းပါတယ္။ JasperSoft ကေန download လုပ္ႏုိင္ပါတယ္။
Java ရဲ႕ ျပႆနာက jdk version ေတြ တစ္ခုနဲ႕တစ္ခု အဆင္ေျပဖုိ႕ သတိထားရတာျဖစ္ပါတယ္။ iReport မွာ ဘယ္ Jre version သံုးသလဲသိခ်င္ရင္ About မွာၾကည္႕လုိက္လုိ႕ရပါတယ္။
jrxml ဆိုတဲ႔ template design ေလးကို compile လုပ္လုိက္ရင္ .jasper ဆုိတဲ႔ complied class file ထြက္လာပါတယ္။
iReport ရဲ႕ default jre ကို configure လုပ္ခ်င္ရင္ etc folder ေအာက္က config file မွာ jdk home ျပင္လုိ႕ရပါတယ္။
iReport မွာ Add parameter ထည္႕ျပီး အဲဒီ parameter ေတြကို text box မွာ ျပန္တြဲလုိက္ရင္ parameter ေပၚမူတည္ျပီး report ထုတ္လုိ႕ရပါျပီ။ preview ၾကည္႕လုိက္ရင္ parameter value ေတြ ေတာင္းတာကို ေတြ႕ရပါလိမ္႔မယ္။
အဲဒီလို report တစ္ခုလုပ္ျပီးရင္ java servlet တစ္ခုကေနျပီး အဲဒီ report ကို လွမ္းေခၚသံုးလုိ႕ရပါျပီ။
web server မွာ deploy လုပ္တဲ႔အခါမွာ groovy jar, iText jar နဲ႕ common collection jar ေတြလုိပါလိမ္႔မယ္။
Java ဘက္မွာေတာ႔ Report အတြက္ jasper အသံုးမ်ားပါတယ္။ Elixir လည္းသံုးပါတယ္။ .Net ဘက္မွာေတာ႔ Crystal Report ကို အသံုးမ်ားပါတယ္။ အားလံုးရဲ႕တူညီခ်က္ကေတာ႔ သပ္ရပ္လွပတဲ႔ output file ရႏိုင္တာျဖစ္မယ္ထင္ပါတယ္။ pdf , doc, xls စတဲ႔ output files ေတြ ထုတ္ဖုိ႕ အသံုးျပဳပါတယ္။ report ဟာ software development မွာ အင္မတန္ အေရးပါပါတယ္။
Report ကို Application မွာ တခါတည္း ထည္႕ေရးတာရိွသလို၊ Report Engine ကို Server တစ္လံုးမွာ run ထားျပီး url နဲ႕ Parameter List ပို႕ျပီးသံုးတာမ်ိဳးလည္းရိွပါတယ္။
ဒါကေတာ႔ ဗဟုသုတအျဖစ္ေျပာရံုျဖစ္တဲ႔အတြက္ ဘာ sample code မွမပါပါဘူး။ နားလည္လြယ္မယ္လုိ႕ေမွ်ာ္လင္႔ပါတယ္။ ကိုယ္တုိင္ လုပ္ၾကည္႕လုိက္တာပိုေကာင္းပါတယ္။ မ်ားမ်ားသိျပီး နမူနာတစ္ခုစီေလာက္ လုပ္ဖူးထားရင္ လြယ္ပါတယ္။
Regards,
Zero
Notes: ဒါကေတာ႔ အဆစ္ေပးတာပါ။
Recurrsion နဲ႕ Looping အေၾကာင္း။
Monday, May 21, 2012
Hibernate in Action
Hibernate in Action
Hibernate ကိ္ု အရင္အလုပ္မွာ သံုးခဲ႔ပါတယ္။
အခုမွ စာျပန္ဖတ္ရင္း ျပန္ျပီး ေလ႔လာေနပါတယ္။
http://www.manning.com/bauer2/chapter2.pdf
အဲဒါ manning က အျမည္းေပးတာပါ။
နမူနာ Hello world ကိုေတာ႔ လုပ္ၾကည္႕ျပီးပါျပီ။ :)
HSQLDB နဲ႕နမူနာလုပ္ျပထားပါတယ္။ အဲဒါကို tutorial ေလးေရးဖုိ႕စိတ္ကူးပါတယ္။ အင္တာဗ်ဴး အဆက္ေတြလည္း ေရးဖုိ႕စိတ္ကူးပါတယ္။ ခက္တာက အခ်ိန္သိပ္မရိွေတာ႔တာပါပဲ။ ခြင္႔ရက္ရွည္ယူတဲ႔အခါမွပဲ tutorial တစ္ခ်ိဳ႕ေရးပါမယ္။
Hibernate ကိုလည္း J2EE interview ေတြမွာေမးေလ႔ရိွပါတယ္။ ဗဟုသုတအေနနဲ႕ေျပာရရင္ေတာ႔ EJB 3.0 ရဲ႕ Specifications ကို Hibernate team က ထုတ္ေပးတဲ႔အတြက္ ေနာက္ပိုင္းမွာ EJB 3 ကိုေလ႔လာေလ႔လာ၊ Java Persistence နဲ႕ Hibernate ကိုေလ႔လာေလ႔လာ အတူတူလုိျဖစ္သြားပါျပီ။ အရင္ကေတာ႔ မတူပါဘူး။ အလုပ္အတြက္ EJB 2 လည္းျပန္ဖတ္ေနတဲ႔အတြက္ အေသးစိတ္ေရးျဖစ္ရင္ တင္လုိက္ပါမယ္။
Interview အတြက္ေလာက္ပဲဆုိရင္ Manning ရဲ႕ Java Persistence with Hibernate 2nd Edition ေရွ႕ႏွစ္ခန္းေလာက္ဖတ္ၾကည္႕လုိက္ရင္ စကားစျမည္ေလာက္ေျပာလုိ႕ရေလာက္ျပီထင္တယ္။
Hibernate ကလည္း တျခား J2EE branch ေတြလိုပါပဲ။ နည္းနည္းသိျပီး အဆင္ေျပေျပသံုးတတ္ဖုိ႕သိပ္မခက္ပါဘူး။ ေသခ်ာသိခ်င္ရင္ေတာ႔ အခ်ိန္ေပးရမယ္ထင္တယ္။ အခုမွ ဖတ္လက္စဆိုေတာ႔ သိပ္အမ်ားၾကီးေျပာစရာမရိွေသးပါဘူး။
အင္တာဗ်ဴးမွာေတာ႔ ORM ဆိုတာဘာလဲ။ ဆိုတာမ်ိဳးေလးေတြေတာ႔ အနည္းဆံုး ေျဖရတတ္ပါတယ္။ ေကာင္းက်ိဳးဆိုးျပစ္ေလးပါသိထားရင္လည္း အဆင္ေျပပါတယ္။ Paradigms mismatch ေလးကလည္းစိတ္ဝင္စားစရာေကာင္းပါတယ္။
Hibernate ဟာ Java ေလာကမွာေတာ႔ အခုေနာက္ပိုင္း အသံုးမ်ားသထက္မ်ားလာပါတယ္။ .Net ဘက္မွာဆိုရင္လည္း nHibernate အျဖစ္ေအာင္ပြဲခံေနပါတယ္။ ေလ႔လာသင္႔တယ္လုိ႕ယူဆပါတယ္။ Tutorial တစ္ခုတစ္ေလေလာက္ အျမည္းေရးျဖစ္ေအာင္ ေရးလုိက္ပါမယ္။
Regards,
0
Hibernate ကိ္ု အရင္အလုပ္မွာ သံုးခဲ႔ပါတယ္။
အခုမွ စာျပန္ဖတ္ရင္း ျပန္ျပီး ေလ႔လာေနပါတယ္။
http://www.manning.com/bauer2/chapter2.pdf
အဲဒါ manning က အျမည္းေပးတာပါ။
နမူနာ Hello world ကိုေတာ႔ လုပ္ၾကည္႕ျပီးပါျပီ။ :)
HSQLDB နဲ႕နမူနာလုပ္ျပထားပါတယ္။ အဲဒါကို tutorial ေလးေရးဖုိ႕စိတ္ကူးပါတယ္။ အင္တာဗ်ဴး အဆက္ေတြလည္း ေရးဖုိ႕စိတ္ကူးပါတယ္။ ခက္တာက အခ်ိန္သိပ္မရိွေတာ႔တာပါပဲ။ ခြင္႔ရက္ရွည္ယူတဲ႔အခါမွပဲ tutorial တစ္ခ်ိဳ႕ေရးပါမယ္။
Hibernate ကိုလည္း J2EE interview ေတြမွာေမးေလ႔ရိွပါတယ္။ ဗဟုသုတအေနနဲ႕ေျပာရရင္ေတာ႔ EJB 3.0 ရဲ႕ Specifications ကို Hibernate team က ထုတ္ေပးတဲ႔အတြက္ ေနာက္ပိုင္းမွာ EJB 3 ကိုေလ႔လာေလ႔လာ၊ Java Persistence နဲ႕ Hibernate ကိုေလ႔လာေလ႔လာ အတူတူလုိျဖစ္သြားပါျပီ။ အရင္ကေတာ႔ မတူပါဘူး။ အလုပ္အတြက္ EJB 2 လည္းျပန္ဖတ္ေနတဲ႔အတြက္ အေသးစိတ္ေရးျဖစ္ရင္ တင္လုိက္ပါမယ္။
Interview အတြက္ေလာက္ပဲဆုိရင္ Manning ရဲ႕ Java Persistence with Hibernate 2nd Edition ေရွ႕ႏွစ္ခန္းေလာက္ဖတ္ၾကည္႕လုိက္ရင္ စကားစျမည္ေလာက္ေျပာလုိ႕ရေလာက္ျပီထင္တယ္။
Hibernate ကလည္း တျခား J2EE branch ေတြလိုပါပဲ။ နည္းနည္းသိျပီး အဆင္ေျပေျပသံုးတတ္ဖုိ႕သိပ္မခက္ပါဘူး။ ေသခ်ာသိခ်င္ရင္ေတာ႔ အခ်ိန္ေပးရမယ္ထင္တယ္။ အခုမွ ဖတ္လက္စဆိုေတာ႔ သိပ္အမ်ားၾကီးေျပာစရာမရိွေသးပါဘူး။
အင္တာဗ်ဴးမွာေတာ႔ ORM ဆိုတာဘာလဲ။ ဆိုတာမ်ိဳးေလးေတြေတာ႔ အနည္းဆံုး ေျဖရတတ္ပါတယ္။ ေကာင္းက်ိဳးဆိုးျပစ္ေလးပါသိထားရင္လည္း အဆင္ေျပပါတယ္။ Paradigms mismatch ေလးကလည္းစိတ္ဝင္စားစရာေကာင္းပါတယ္။
Hibernate ဟာ Java ေလာကမွာေတာ႔ အခုေနာက္ပိုင္း အသံုးမ်ားသထက္မ်ားလာပါတယ္။ .Net ဘက္မွာဆိုရင္လည္း nHibernate အျဖစ္ေအာင္ပြဲခံေနပါတယ္။ ေလ႔လာသင္႔တယ္လုိ႕ယူဆပါတယ္။ Tutorial တစ္ခုတစ္ေလေလာက္ အျမည္းေရးျဖစ္ေအာင္ ေရးလုိက္ပါမယ္။
Regards,
0
Labels:
hibernate,
j2ee,
Java,
java persistence,
manning
Wednesday, May 16, 2012
ကဲ ဘာလဲေျပာ။
public class Person {
private String name;
private String age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
}
____________________________________________________
public class testObj {
public Person personA=new Person();
public static void chageStr (Person personB){
testObj tstObj=new testObj();
tstObj.personA.setName("I am Person B");
}
public static void main(String[] args) {
System.out.println("What does I hold now?");
testObj tstObj=new testObj();
chageStr (tstObj.personA);
System.out.println(""+tstObj.personA.getName());
}
}
_________________________________________
highlight လုပ္ထားတဲ႔ System out ကေနဘာထြက္မလဲေမးပါတယ္။
Ans: null
_________________________________________
ဒုတိယတစ္ခု နည္းနည္းျပင္ေရးလုိက္ပါတယ္။
public class testObj {
static Person personA=new Person();
public static void chageStr (Person personB){
personA.setName("I am Person B");
}
public static void main(String[] args) {
System.out.println("What does I hold now?");
chageStr (personA);
System.out.println(""+personA.getName());
}
}
_________________________________________
highlight လုပ္ထားတဲ႔ System out ကေနဘာထြက္မလဲေမးပါတယ္။
Ans: I am Person B
_________________________________________
static Bean Obj ေတြသံုးၾကသလားမသိပါဘူး။ အျပင္မွာသံုးေနၾကမဟုတ္ရင္ မသိဘဲမွားေျဖမိဖို႕မ်ားပါတယ္။
Labels:
Interview question,
Java,
static Bean,
tutorial
Monday, May 14, 2012
အင္တာဗ်ဴး အလြဲမ်ား ၁။
အင္တာဗ်ဴး အလြဲမ်ား ၁။
ကိုယ္ေတြ႕အင္တာဗ်ဴးအေတြ႕အၾကံဳမ်ားကို မွ်ေဝသြားပါမယ္။ ဒီတစ္ပတ္လံုး အင္တာဗ်ဴးေျဖဖုိ႕ေလ႔က်င္႔၊ သြားေျဖပါပဲ။ အခုေျဖခဲ႔တဲ႔အေတြ႕အၾကံဳေတြ ေဝငွပါမယ္။
အေမရိကန္အေျခစိုက္ လူမ်ားပြဲမစည္ ဆိုတဲ႔ ကုမ္ပနီပဲထားပါေတာ႔ ။ နာမည္ေတြေရးရင္ မေကာင္းလုိ႕ပါ။
PM(Project Manager) နဲ႕ Team lead လာပါတယ္။ PM က စျပီးေမးပါတယ္။ အရင္အလုပ္အေတြ႕အၾကံဳေတြ ဘလာဘလာေတြပါ။ အဲဒါေတြကေတာ႔ ေျပာတတ္ရင္ရပါတယ္။ နည္းနည္းေတာ႔ျပင္ဆင္ထားပါ။ ဘယ္ေလာက္ပဲ ဘိုလိုေျပာတတ္ေျပာတတ္၊ ကိုယ္တစ္ႏွစ္၊ႏွစ္ႏွစ္လုပ္လာတာကို နာရီဝက္ေလးဆယ္႔ငါးမိနစ္နဲ႕ အျပီးေျပာႏုိင္ဖုိ႕မလြယ္ဘူး။ အေရးၾကီးျပီး နားေထာင္ေကာင္းမယ္ထင္တာေတြကို အရင္ေရြးေျပာပါ။ ေျပာေနရင္းနဲ႕ ကိုယ္ရဲ႕ အလုပ္ေပၚထားတဲ႔ သေဘာထားနဲ႕ စိတ္ဆႏၵျပင္းျပမႈကို ထည္႕ေျပာပါ။ attitude နဲ႕ passion က သိပ္အေရးၾကီးပါတယ္။ အလုပ္ကေတာ႔ သူသူကိုယ္ကိုယ္ လုပ္ႏုိင္တဲ႔သူေတြမ်ားပါတယ္။
Business Scenerio တစ္ခုမွာ ဒါဆို ဘယ္လုိ လုပ္မလဲဆိုတာမ်ိဳးေမးပါတယ္။ ေသခ်ာစဥ္းစားျပီး ကိုေမာင္ဆင္႔( common sense) နဲ႕ေျဖရင္ အိုေကေလာက္တယ္။
ေနာက္ေတာ႔ issue tracking ကို ဘယ္လိုလုပ္သလဲေမးတယ္။ အဲဒါေတြကလည္း အလုပ္လုပ္ေနရင္သိပါတယ္။
ေနာက္ေတာ႔ project planning , impact analysis, requirement gathering စတာေတြမွာ ပါခဲ႔လားဘာညာေမးတယ္။ Users Meeting ေတြမွာတက္သလား။ code ခ်ည္းပဲ ထုိင္ေရးေနသလားစတာေတြေမးတယ္။
အဲဒါေတြကိုေကာင္းေကာင္းမြန္မြန္ေျဖလိုက္ပါ။
ျပီးေတာ႔ ပါးစပ္နဲ႕ oracle select,update,insert, delete ေျပာရပါေသးတယ္။ ရယ္မိမလိုေတာင္ျဖစ္သြားတယ္။
ျပီးေတာ႔ team lead အလွည္႕ျဖစ္ပါတယ္။ framework နဲ႕ပတ္သက္တာေတြေမးပါတယ္။
ၾကားထဲမွာျဖတ္ျပီး sql က exists နဲ႕ in ဘာကြာလဲေမးပါတယ္။
exist ကေတာ႔ ရွာေနတာ ေတြ႕တာနဲ႔ရပ္တယ္။ ထပ္ရွာမေနဘူး။ အခ်ိန္ကုန္သက္သာတယ္။ count လုပ္ရင္ေတာ႔သိသာတယ္ထင္တယ္။ ထင္တယ္လုိ႕ေျပာရတာ အဲဒီေမးခြန္းကို တစ္ျခမ္းပဲသိတယ္။ exist ကို အရင္ကေတာ႔ တခါတေလသံုးတယ္။ ေန႕စဥ္သံုးထဲမွာမပါေတာ႔ ေမ႔ေနျပီ။ exists တစ္ေယာက္ exist ေနေသးပါလားေတာင္ေမ႔ျပီ။
IN ကေတာ႔ရွင္းပါတယ္ဗ်ာ။ in ဆုိျပီး set တစ္ခုထည္႕ျပီးရွာလုိ႕ရတာေပါ႔။ or ေတြကို ဆက္လုိက္တာကို မေရးခ်င္လုိ႕ in လုပ္လုိက္တာပါပဲ။ အဲဒါေလးလည္းၾကည္႕ထားရင္ေတာ႔မမွားဘူးေပါ႔။ ဒီမွာ ျပန္ေရးတာက အမွန္ေတာ႔ ethic နဲ႕ မညီလွဘူး။ ျမန္မာအခ်င္းခ်င္း ကူညီရာေရာက္ေပမယ္႔ ကုမ္ပနီအတြက္ေတာ႔ မေကာင္းလွဘူး။ ျဖစ္ေစခ်င္တာကေတာ႔ အရည္အခ်င္းရိွျပီး အလုပ္ေကာင္းေကာင္းရတဲ႕ ျမန္မာ ေတြျဖစ္ေစခ်င္တာပါ။ အင္တာဗ်ဴးေျဖႏိုင္ျပီး ဘာမွမလုပ္တတ္တဲ႔သူေတြျဖစ္ေနရင္လည္း အဆင္ေျပမယ္မထင္ပါဘူး။ အရည္အခ်င္းရိွျပီးသားသူေတြ အင္တာဗ်ဴးေတြမွာ ေခ်ာေခ်ာေမြ႕ေမြ႕ျဖစ္ေစဖုိ႕ပဲရည္ရြယ္ပါတယ္။
အခုေခၚတဲ႔ အလုပ္က Strut သံုးတယ္ဆိုေတာ႔ Strut အေၾကာင္းေမးပါတယ္။ ဘယ္ေလာက္ပဲေရးေန ေရးေန၊ code ေတြကို အလြတ္မွတ္မိဖို႕မလြယ္ပါဘူး။ ဒါေပမယ္႔ တကယ္ေရးတဲ႔သူက flow ကိုေတာ႔မွတ္မိပါတယ္။ navigation flow ကိုေျပာဆုိရင္ jsp--->tag-->strut-config.xml--->ActionForm-->Action-->web.xml စတာေတြမွာ ဘာေတြ ဘယ္လိုေရးတယ္၊ျပင္တယ္ေျပာျပလုိက္ရံုပါပဲ။ အဲဒါကိုေတာ႔ေျဖႏုိင္ပါတယ္။
ေနာက္ေတာ႔ scope ေတြအေၾကာင္းထဲက တစ္ခုေမးပါတယ္။ page scope နဲ႕ session scope ဘာကြာလဲတဲ႔။ တကယ္ေတာ႔ အဲဒါေတြကို ေမးေမးေနတာကို မၾကိဳက္ပါဘူး။ web မွာ အခုရွာ အခုေတြ႕ႏုိင္တာကို မရွာဘဲသိတယ္ဆုိတာဟာ အရည္အခ်င္းလို႕ကို မထင္ေတာ႔ပါဘူး။ ဒါေပမယ္႔ အင္တာဗ်ဴးမွာ ေမးရင္ေတာ႔ မရမက ေျဖၾကရတာပါပဲ။ တကယ္ဆိုရင္ scwcd ေျဖတုန္းက ဒါေတြကို အလြတ္ရေနတာေတြပါပဲ။ အခုေတာ႔ မမွတ္မိသေလာက္ျဖစ္ေနျပီ။ ေရးမွမေရးရေတာ႔တာကိုး။ တစ္ေန႕တစ္ေန႕ စာဖတ္လုိက္၊ အိပ္ငိုက္လုိက္ဆိုေတာ႔ စာေတြလည္းပ်ံကုန္ျပီ။ ဒါေပမယ္႔ နာမည္အရစဥ္းစားလုိက္တယ္။ session ဆိုကတည္းက သယ္မွာပဲ။ shopping cart က sesssion လုိပဲ မွတ္ထားသိမ္းထားရမယ္။ အဲဒီေတာ႔ Multiple pages ကေန sesssion ထဲမွာသိမ္းထားတာေတြကို ယူသံုးႏိုင္မယ္။ Page ကေတာ႔ နာမည္ကိုက ဒီ Page တစ္ခုထဲလိုပဲဆိုေတာ႔ အဲဒီေပ႔ခ်္မွာပဲသံုးမယ္။ အဲဒီေပ႔ခ်္ကို include လုပ္ထားတဲ႔ page မွာသံုးမယ္လုိ႕ထင္တယ္။
နီးေတာ႔နီးစပ္သြားပါတယ္။ အေျဖမွန္ကိုလည္း web မွာရွာၾကည္႕ထားပါ။ scope ေတြအေၾကာင္းသိရတာေပါ႔။
ေနာက္တစ္ခုက session ပါ။ ဒီမွာေလ႔လာႏုိင္ပါတယ္။ http://www.easywayserver.com/jsp/JSP-session.htm
session တစ္ခု expired ျဖစ္ျပီလား ဘာMethod နဲ႕ check သလဲတဲ႔။ seesion obj ထဲက Method တစ္ခုနဲ႕ check တာေပါ႔။ Method name ကေတာ႔ မ်က္လံုးနဲ႕ျမင္ရင္သိတယ္။ အလြတ္ေတာ႔မရဘူး။ အမွန္က inNew ပါ။ မေရးတာၾကာလုိ႕ ေမ႔ကုန္ေပမယ္႔ code အလြတ္ရတာကို ဂုဏ္မယူပါဘူး။ java doc ၾကည္႕လုိက္လည္းသိႏုိင္တာပါပဲ။ လိဒ္ဂစ္တာ တီးတာကိုၾကည္႕ပါ။ notes ကိုၾကည္႕ျပီး တီးတဲ႔သူကမွ ဆရာက်ပါတယ္။ International notes ေကာင္းေကာင္းမၾကည္႕တတ္တဲ႔ ဂစ္တာသမားၾကေတာ႔ တီးရင္းနဲ႕ မၾကည္႕ႏုိင္တာနဲ႕ အလြတ္က်က္တီးရတာပါ။ အလြတ္က်က္တယ္ဆိုကတည္းက အေသမွတ္လုိက္တဲ႔သေဘာပဲ။ အေသမွတ္တာေတြကို အားမေပးပါဘူး။ သိသင္႔တာသိရင္ က်န္တာေတြကို အရွင္မွတ္ထားပါ။ ဒီ Method name ဟာ တစ္သက္လံုး isNew ျဖစ္ေနမယ္လုိ႕ အာမခံထားရင္ေတာ႔ ေကာင္းပါတယ္။ မဟုတ္ရင္ တစ္ေန႕မွာ oracle က isNew ထက္ပိုျပီးအဓိပၸာယ္ရိွတာေလးေတြ႕ျပီး ျပင္လုိက္ရင္ ဘယ္လိုလုပ္မလဲ။ IDE ရဲ႕ IntelliSense နဲ႕ Java Doc ကိုၾကည္႕ျပီးေရးတတ္ဖုိ႕ပဲလုိပါတယ္။ အဲဒီ Method ေတြ အလြတ္ရလုိ႕ အထင္ၾကီးတာမ်ိဳးကိုလည္း သိပ္ျပီး လက္မခံပါဘူး။
ေနာက္ေတာ႔ Database Connection အတြက္ ဘာ Design Pattern သံုးခဲ႔လဲဆိုတာပါ။ မွတ္မိတဲ႔ facade pattern ကို နည္းနည္းျပင္ေျပာခဲ႔ပါတယ္။ ဒါကလည္း တစ္ရံုးနဲ႕တစ္ရံုး ဘယ္ Design Pattern သံုးမယ္ဆိုတာက ၾကိဳက္ရာသံုးမွာပါပဲ။ Design Pattern ေလးဘာေလးဖတ္ထားရင္ေတာ႔ အဆင္ေျပေလာက္တယ္။
ေနာက္တစ္ခုကေတာ႔ Spring Transactions ေတြအေၾကာင္းပါ။
ဟိုတေလာကပဲ Java Developer's Notebook မွာ အဲဒီအခန္းဖတ္ခဲ႔ပါေသးတယ္။ ခက္တာကမမွတ္မိေတာ႔တာပါ။ ဒီမွာၾကည္႕လုိ႕ရပါတယ္။
http://static.springsource.org/spring/docs/2.0.x/reference/transaction.html
EJB ကိုနည္းနည္းေမးပါတယ္။ အရင္ကတည္းက EJB မလုပ္ခဲ႔ဖူးဘူးေျပာထားေတာ႔ သက္သက္ညွာညွာေမးပါတယ္။ Head First ေရွ႕သံုးခန္းဖတ္လာတဲ႔ အသိနဲ႕ထင္တာေတြေျဖခဲ႔ပါတယ္။ က်န္တာေတြ နည္းနည္းပါးပါးရိွႏိုင္ပါတယ္။ ဒါေပမယ္႔ ေလာေလာဆယ္ interview trends ေလးကို သိႏုိင္ေလာက္၊ ခန္႕မွန္းႏိုင္ေလာက္မယ္ထင္ပါတယ္။
ref:
http://stackoverflow.com/questions/24929/difference-between-exists-and-in-in-sql
http://www.easywayserver.com/jsp/JSP-session.htm
ကိုယ္ေတြ႕အင္တာဗ်ဴးအေတြ႕အၾကံဳမ်ားကို မွ်ေဝသြားပါမယ္။ ဒီတစ္ပတ္လံုး အင္တာဗ်ဴးေျဖဖုိ႕ေလ႔က်င္႔၊ သြားေျဖပါပဲ။ အခုေျဖခဲ႔တဲ႔အေတြ႕အၾကံဳေတြ ေဝငွပါမယ္။
အေမရိကန္အေျခစိုက္ လူမ်ားပြဲမစည္ ဆိုတဲ႔ ကုမ္ပနီပဲထားပါေတာ႔ ။ နာမည္ေတြေရးရင္ မေကာင္းလုိ႕ပါ။
PM(Project Manager) နဲ႕ Team lead လာပါတယ္။ PM က စျပီးေမးပါတယ္။ အရင္အလုပ္အေတြ႕အၾကံဳေတြ ဘလာဘလာေတြပါ။ အဲဒါေတြကေတာ႔ ေျပာတတ္ရင္ရပါတယ္။ နည္းနည္းေတာ႔ျပင္ဆင္ထားပါ။ ဘယ္ေလာက္ပဲ ဘိုလိုေျပာတတ္ေျပာတတ္၊ ကိုယ္တစ္ႏွစ္၊ႏွစ္ႏွစ္လုပ္လာတာကို နာရီဝက္ေလးဆယ္႔ငါးမိနစ္နဲ႕ အျပီးေျပာႏုိင္ဖုိ႕မလြယ္ဘူး။ အေရးၾကီးျပီး နားေထာင္ေကာင္းမယ္ထင္တာေတြကို အရင္ေရြးေျပာပါ။ ေျပာေနရင္းနဲ႕ ကိုယ္ရဲ႕ အလုပ္ေပၚထားတဲ႔ သေဘာထားနဲ႕ စိတ္ဆႏၵျပင္းျပမႈကို ထည္႕ေျပာပါ။ attitude နဲ႕ passion က သိပ္အေရးၾကီးပါတယ္။ အလုပ္ကေတာ႔ သူသူကိုယ္ကိုယ္ လုပ္ႏုိင္တဲ႔သူေတြမ်ားပါတယ္။
Business Scenerio တစ္ခုမွာ ဒါဆို ဘယ္လုိ လုပ္မလဲဆိုတာမ်ိဳးေမးပါတယ္။ ေသခ်ာစဥ္းစားျပီး ကိုေမာင္ဆင္႔( common sense) နဲ႕ေျဖရင္ အိုေကေလာက္တယ္။
ေနာက္ေတာ႔ issue tracking ကို ဘယ္လိုလုပ္သလဲေမးတယ္။ အဲဒါေတြကလည္း အလုပ္လုပ္ေနရင္သိပါတယ္။
ေနာက္ေတာ႔ project planning , impact analysis, requirement gathering စတာေတြမွာ ပါခဲ႔လားဘာညာေမးတယ္။ Users Meeting ေတြမွာတက္သလား။ code ခ်ည္းပဲ ထုိင္ေရးေနသလားစတာေတြေမးတယ္။
အဲဒါေတြကိုေကာင္းေကာင္းမြန္မြန္ေျဖလိုက္ပါ။
ျပီးေတာ႔ ပါးစပ္နဲ႕ oracle select,update,insert, delete ေျပာရပါေသးတယ္။ ရယ္မိမလိုေတာင္ျဖစ္သြားတယ္။
ျပီးေတာ႔ team lead အလွည္႕ျဖစ္ပါတယ္။ framework နဲ႕ပတ္သက္တာေတြေမးပါတယ္။
ၾကားထဲမွာျဖတ္ျပီး sql က exists နဲ႕ in ဘာကြာလဲေမးပါတယ္။
--this statement needs to check the entire table
select count(*) from [table] where ...
--this statement is true as soon as one match is found
exists ( select * from [table] where ... )
exist ကေတာ႔ ရွာေနတာ ေတြ႕တာနဲ႔ရပ္တယ္။ ထပ္ရွာမေနဘူး။ အခ်ိန္ကုန္သက္သာတယ္။ count လုပ္ရင္ေတာ႔သိသာတယ္ထင္တယ္။ ထင္တယ္လုိ႕ေျပာရတာ အဲဒီေမးခြန္းကို တစ္ျခမ္းပဲသိတယ္။ exist ကို အရင္ကေတာ႔ တခါတေလသံုးတယ္။ ေန႕စဥ္သံုးထဲမွာမပါေတာ႔ ေမ႔ေနျပီ။ exists တစ္ေယာက္ exist ေနေသးပါလားေတာင္ေမ႔ျပီ။
IN ကေတာ႔ရွင္းပါတယ္ဗ်ာ။ in ဆုိျပီး set တစ္ခုထည္႕ျပီးရွာလုိ႕ရတာေပါ႔။ or ေတြကို ဆက္လုိက္တာကို မေရးခ်င္လုိ႕ in လုပ္လုိက္တာပါပဲ။ အဲဒါေလးလည္းၾကည္႕ထားရင္ေတာ႔မမွားဘူးေပါ႔။ ဒီမွာ ျပန္ေရးတာက အမွန္ေတာ႔ ethic နဲ႕ မညီလွဘူး။ ျမန္မာအခ်င္းခ်င္း ကူညီရာေရာက္ေပမယ္႔ ကုမ္ပနီအတြက္ေတာ႔ မေကာင္းလွဘူး။ ျဖစ္ေစခ်င္တာကေတာ႔ အရည္အခ်င္းရိွျပီး အလုပ္ေကာင္းေကာင္းရတဲ႕ ျမန္မာ ေတြျဖစ္ေစခ်င္တာပါ။ အင္တာဗ်ဴးေျဖႏိုင္ျပီး ဘာမွမလုပ္တတ္တဲ႔သူေတြျဖစ္ေနရင္လည္း အဆင္ေျပမယ္မထင္ပါဘူး။ အရည္အခ်င္းရိွျပီးသားသူေတြ အင္တာဗ်ဴးေတြမွာ ေခ်ာေခ်ာေမြ႕ေမြ႕ျဖစ္ေစဖုိ႕ပဲရည္ရြယ္ပါတယ္။
SELECT * FROM Orders o WHERE EXISTS (
SELECT * FROM Products p where p.ProductNumber = o.ProductNumber)
IN is used to compare one value to several, and can use literal values, like this:
SELECT * FROM Orders WHERE ProductNumber IN (1, 10, 100)
အခုေခၚတဲ႔ အလုပ္က Strut သံုးတယ္ဆိုေတာ႔ Strut အေၾကာင္းေမးပါတယ္။ ဘယ္ေလာက္ပဲေရးေန ေရးေန၊ code ေတြကို အလြတ္မွတ္မိဖို႕မလြယ္ပါဘူး။ ဒါေပမယ္႔ တကယ္ေရးတဲ႔သူက flow ကိုေတာ႔မွတ္မိပါတယ္။ navigation flow ကိုေျပာဆုိရင္ jsp--->tag-->strut-config.xml--->ActionForm-->Action-->web.xml စတာေတြမွာ ဘာေတြ ဘယ္လိုေရးတယ္၊ျပင္တယ္ေျပာျပလုိက္ရံုပါပဲ။ အဲဒါကိုေတာ႔ေျဖႏုိင္ပါတယ္။
ေနာက္ေတာ႔ scope ေတြအေၾကာင္းထဲက တစ္ခုေမးပါတယ္။ page scope နဲ႕ session scope ဘာကြာလဲတဲ႔။ တကယ္ေတာ႔ အဲဒါေတြကို ေမးေမးေနတာကို မၾကိဳက္ပါဘူး။ web မွာ အခုရွာ အခုေတြ႕ႏုိင္တာကို မရွာဘဲသိတယ္ဆုိတာဟာ အရည္အခ်င္းလို႕ကို မထင္ေတာ႔ပါဘူး။ ဒါေပမယ္႔ အင္တာဗ်ဴးမွာ ေမးရင္ေတာ႔ မရမက ေျဖၾကရတာပါပဲ။ တကယ္ဆိုရင္ scwcd ေျဖတုန္းက ဒါေတြကို အလြတ္ရေနတာေတြပါပဲ။ အခုေတာ႔ မမွတ္မိသေလာက္ျဖစ္ေနျပီ။ ေရးမွမေရးရေတာ႔တာကိုး။ တစ္ေန႕တစ္ေန႕ စာဖတ္လုိက္၊ အိပ္ငိုက္လုိက္ဆိုေတာ႔ စာေတြလည္းပ်ံကုန္ျပီ။ ဒါေပမယ္႔ နာမည္အရစဥ္းစားလုိက္တယ္။ session ဆိုကတည္းက သယ္မွာပဲ။ shopping cart က sesssion လုိပဲ မွတ္ထားသိမ္းထားရမယ္။ အဲဒီေတာ႔ Multiple pages ကေန sesssion ထဲမွာသိမ္းထားတာေတြကို ယူသံုးႏိုင္မယ္။ Page ကေတာ႔ နာမည္ကိုက ဒီ Page တစ္ခုထဲလိုပဲဆိုေတာ႔ အဲဒီေပ႔ခ်္မွာပဲသံုးမယ္။ အဲဒီေပ႔ခ်္ကို include လုပ္ထားတဲ႔ page မွာသံုးမယ္လုိ႕ထင္တယ္။
နီးေတာ႔နီးစပ္သြားပါတယ္။ အေျဖမွန္ကိုလည္း web မွာရွာၾကည္႕ထားပါ။ scope ေတြအေၾကာင္းသိရတာေပါ႔။
ေနာက္တစ္ခုက session ပါ။ ဒီမွာေလ႔လာႏုိင္ပါတယ္။ http://www.easywayserver.com/jsp/JSP-session.htm
HttpSession session = request.getSession(false);
if (!session.isNew()) {
// Session is valid
}
else {
//Session has expired - redirect to login.jsp
}
session တစ္ခု expired ျဖစ္ျပီလား ဘာMethod နဲ႕ check သလဲတဲ႔။ seesion obj ထဲက Method တစ္ခုနဲ႕ check တာေပါ႔။ Method name ကေတာ႔ မ်က္လံုးနဲ႕ျမင္ရင္သိတယ္။ အလြတ္ေတာ႔မရဘူး။ အမွန္က inNew ပါ။ မေရးတာၾကာလုိ႕ ေမ႔ကုန္ေပမယ္႔ code အလြတ္ရတာကို ဂုဏ္မယူပါဘူး။ java doc ၾကည္႕လုိက္လည္းသိႏုိင္တာပါပဲ။ လိဒ္ဂစ္တာ တီးတာကိုၾကည္႕ပါ။ notes ကိုၾကည္႕ျပီး တီးတဲ႔သူကမွ ဆရာက်ပါတယ္။ International notes ေကာင္းေကာင္းမၾကည္႕တတ္တဲ႔ ဂစ္တာသမားၾကေတာ႔ တီးရင္းနဲ႕ မၾကည္႕ႏုိင္တာနဲ႕ အလြတ္က်က္တီးရတာပါ။ အလြတ္က်က္တယ္ဆိုကတည္းက အေသမွတ္လုိက္တဲ႔သေဘာပဲ။ အေသမွတ္တာေတြကို အားမေပးပါဘူး။ သိသင္႔တာသိရင္ က်န္တာေတြကို အရွင္မွတ္ထားပါ။ ဒီ Method name ဟာ တစ္သက္လံုး isNew ျဖစ္ေနမယ္လုိ႕ အာမခံထားရင္ေတာ႔ ေကာင္းပါတယ္။ မဟုတ္ရင္ တစ္ေန႕မွာ oracle က isNew ထက္ပိုျပီးအဓိပၸာယ္ရိွတာေလးေတြ႕ျပီး ျပင္လုိက္ရင္ ဘယ္လိုလုပ္မလဲ။ IDE ရဲ႕ IntelliSense နဲ႕ Java Doc ကိုၾကည္႕ျပီးေရးတတ္ဖုိ႕ပဲလုိပါတယ္။ အဲဒီ Method ေတြ အလြတ္ရလုိ႕ အထင္ၾကီးတာမ်ိဳးကိုလည္း သိပ္ျပီး လက္မခံပါဘူး။
ေနာက္ေတာ႔ Database Connection အတြက္ ဘာ Design Pattern သံုးခဲ႔လဲဆိုတာပါ။ မွတ္မိတဲ႔ facade pattern ကို နည္းနည္းျပင္ေျပာခဲ႔ပါတယ္။ ဒါကလည္း တစ္ရံုးနဲ႕တစ္ရံုး ဘယ္ Design Pattern သံုးမယ္ဆိုတာက ၾကိဳက္ရာသံုးမွာပါပဲ။ Design Pattern ေလးဘာေလးဖတ္ထားရင္ေတာ႔ အဆင္ေျပေလာက္တယ္။
ေနာက္တစ္ခုကေတာ႔ Spring Transactions ေတြအေၾကာင္းပါ။
ဟိုတေလာကပဲ Java Developer's Notebook မွာ အဲဒီအခန္းဖတ္ခဲ႔ပါေသးတယ္။ ခက္တာကမမွတ္မိေတာ႔တာပါ။ ဒီမွာၾကည္႕လုိ႕ရပါတယ္။
http://static.springsource.org/spring/docs/2.0.x/reference/transaction.html
EJB ကိုနည္းနည္းေမးပါတယ္။ အရင္ကတည္းက EJB မလုပ္ခဲ႔ဖူးဘူးေျပာထားေတာ႔ သက္သက္ညွာညွာေမးပါတယ္။ Head First ေရွ႕သံုးခန္းဖတ္လာတဲ႔ အသိနဲ႕ထင္တာေတြေျဖခဲ႔ပါတယ္။ က်န္တာေတြ နည္းနည္းပါးပါးရိွႏိုင္ပါတယ္။ ဒါေပမယ္႔ ေလာေလာဆယ္ interview trends ေလးကို သိႏုိင္ေလာက္၊ ခန္႕မွန္းႏိုင္ေလာက္မယ္ထင္ပါတယ္။
ref:
http://stackoverflow.com/questions/24929/difference-between-exists-and-in-in-sql
http://www.easywayserver.com/jsp/JSP-session.htm
Sunday, May 13, 2012
Some J2EE questions you should know
အတိအက်ၾကီးမွတ္မိဖုိ႕မလုိပါဘူး။ အေရးၾကီးတာေလးေတြမွတ္မိရင္မဆိုးလွဘူး။ highlight လုပ္ထားတာေတြကေတာ႔ က်က္ထားတုန္းက ေမ႔ေနတာေတြထင္တယ္။ အခုေတာ႔မမွတ္မိေတာ႔ဘူး။
Question: What
do you understand by a J2EE module?
Answer: A J2EE module is a software unit that consists of one or more J2EE components of the same container type along with one deployment descriptor of that type. J2EE specification defines four types of modules:
Web
application client and
resource adapter
Answer: A J2EE module is a software unit that consists of one or more J2EE components of the same container type along with one deployment descriptor of that type. J2EE specification defines four types of modules:
Web
application client and
resource adapter
EJB
//
a) Client-tier components run on the client machine.
b) Web-tier components run on the J2EE server.
c) Business-tier components run on the J2EE server and the
d) Enterprise information system (EIS)-tier software runs on the EIS servers
b) Web-tier components run on the J2EE server.
c) Business-tier components run on the J2EE server and the
d) Enterprise information system (EIS)-tier software runs on the EIS servers
//
Question: Why do understand by a container?
Answer: Normally, thin-client multi-tiered applications are hard to write because they involve many lines of intricate code to handle transaction and state management, multithreading, resource pooling, and other complex low-level details. The component-based and platform-independent J2EE architecture makes J2EE applications easy to write because business logic is organized into reusable components. In addition, the J2EE server provides underlying services in the form of a container for every component type. Because you do not have to develop these services yourself, you are free to concentrate on solving the business problem at hand (Source:http://java.sun.com/j2ee/1.3/docs/tutorial/doc/Overview4.html ).
In short containers are the interface between a component and the low-level platform specific functionality that supports the component. The application like Web, enterprise bean, or application client component must be assembled and deployed on the J2EE container before executing.
Answer: Normally, thin-client multi-tiered applications are hard to write because they involve many lines of intricate code to handle transaction and state management, multithreading, resource pooling, and other complex low-level details. The component-based and platform-independent J2EE architecture makes J2EE applications easy to write because business logic is organized into reusable components. In addition, the J2EE server provides underlying services in the form of a container for every component type. Because you do not have to develop these services yourself, you are free to concentrate on solving the business problem at hand (Source:http://java.sun.com/j2ee/1.3/docs/tutorial/doc/Overview4.html ).
In short containers are the interface between a component and the low-level platform specific functionality that supports the component. The application like Web, enterprise bean, or application client component must be assembled and deployed on the J2EE container before executing.
// Question: What are the services provided by a
container?
Answer: The services provided by container are as follows:
a) Transaction management for the bean
b) Security for the bean
c) Persistence of the bean
d) Remote access to the bean
e) Lifecycle management of the bean
f) Database-connection pooling
g) Instance pooling for the bean
Answer: The services provided by container are as follows:
a) Transaction management for the bean
b) Security for the bean
c) Persistence of the bean
d) Remote access to the bean
e) Lifecycle management of the bean
f) Database-connection pooling
g) Instance pooling for the bean
// Question: What are types of J2EE clients?
Answer: J2EE clients are the software that access the services components installed on the J2EE container. Following are the J2EE clients:
a) Applets
b) Java-Web Start clients
c) Wireless clients
d) Web applications
Answer: J2EE clients are the software that access the services components installed on the J2EE container. Following are the J2EE clients:
a) Applets
b) Java-Web Start clients
c) Wireless clients
d) Web applications
// What is Java Naming and Directory Service? - The JNDI provides naming and directory functionality. It provides
applications with methods for performing standard directory operations, such as associating
attributes with objects and searching for objects using their attributes. Using JNDI, a J2EE application can
store and retrieve any type of named Java object. Because JNDI is independent
of any specific implementations, applications can use JNDI to access multiple naming and directory services, including existing
naming and
directory services such as LDAP, NDS, DNS, and NIS.
directory services such as LDAP, NDS, DNS, and NIS.
What is Struts? - A Web page development framework, a MVC
framework. Struts combines Java Servlets, Java Server Pages, custom tags, and message resources into a unified framework. It is
a cooperative, synergistic platform, suitable for
development teams, independent developers, and everyone between.
What is JAAS? - The Java Authentication and Authorization Service (JAAS) provides a
way for a J2EE application to authenticate and authorize a specific user or group of
users to run it. It is a standard Pluggable Authentication Module (PAM)
framework that extends the Java 2 platform security architecture to support user-based
authorization.
What is J2EE Connector? - The J2EE Connector API is used by J2EE tools vendors and system integrators to
create resource adapters that support access to enterprise information systems
that can be plugged into any J2EE product. Each type of database or EIS has a
different resource adapter.
Subscribe to:
Posts (Atom)