|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
有了这样一个呼声:让java代替C语言成为基本语言。这些足以说明java简单易学的这个优点。其次,java的功能强大,前面我也提到了,EJB3.0的推出使java成为了大型项目的首选。
明天忧郁了一天,java程序在向mysql拔出数据前不是乱码,数据库安装时也选了编码为utf8(和我程序的编码格局分歧)。但是拔出数据就酿成乱码,相称忧郁。
缘故原由:mysql的设置文件中的编码并没有改成utf8,;
办理举措:在mysql的安装目次下找到my.ini文件,将内里两处触及编码的中央改成utf8,以下:- #MySQLServerInstanceConfigurationFile
- #----------------------------------------------------------------------
- #GeneratedbytheMySQLServerInstanceConfigurationWizard
- #
- #
- #InstallationInstructions
- #----------------------------------------------------------------------
- #
- #OnLinuxyoucancopythisfileto/etc/my.cnftosetglobaloptions,
- #mysql-data-dir/my.cnftosetserver-specificoptions
- #(forthisinstallation)orto
- #~/.my.cnftosetuser-specificoptions.
- #
- #OnWindowsyoushouldkeepthisfileintheinstallationdirectory
- #ofyourserver(e.g.C:ProgramFilesMySQLMySQLServerX.Y).To
- #makesuretheserverreadstheconfigfileusethestartupoption
- #"--defaults-file".
- #
- #Torunruntheserverfromthecommandline,executethisina
- #commandlineshell,e.g.
- #mysqld--defaults-file="C:ProgramFilesMySQLMySQLServerX.Ymy.ini"
- #
- #ToinstalltheserverasaWindowsservicemanually,executethisina
- #commandlineshell,e.g.
- #mysqld--installMySQLXY--defaults-file="C:ProgramFilesMySQLMySQLServerX.Ymy.ini"
- #
- #Andthenexecutethisinacommandlineshelltostarttheserver,e.g.
- #netstartMySQLXY
- #
- #
- #Guildlinesforeditingthisfile
- #----------------------------------------------------------------------
- #
- #Inthisfile,youcanusealllongoptionsthattheprogramsupports.
- #Ifyouwanttoknowtheoptionsaprogramsupports,starttheprogram
- #withthe"--help"option.
- #
- #Moredetailedinformationabouttheindividualoptionscanalsobe
- #foundinthemanual.
- #
- #
- #CLIENTSECTION
- #----------------------------------------------------------------------
- #
- #ThefollowingoptionswillbereadbyMySQLclientapplications.
- #NotethatonlyclientapplicationsshippedbyMySQLareguaranteed
- #toreadthissection.IfyouwantyourownMySQLclientprogramto
- #honorthesevalues,youneedtospecifyitasanoptionduringthe
- #MySQLclientlibraryinitialization.
- #
- [client]
- port=3306
- [mysql]
- <spanstyle="color:#ff0000;">default-character-set=utf8
- </span>
- #SERVERSECTION
- #----------------------------------------------------------------------
- #
- #ThefollowingoptionswillbereadbytheMySQLServer.Makesurethat
- #检察本栏目更多出色内容:http://www.bianceng.cn/Programming/Java/
- #youhaveinstalledtheservercorrectly(seeabove)soitreadsthis
- #file.
- #
- [mysqld]
- #TheTCP/IPPorttheMySQLServerwilllistenon
- port=3306
- #Pathtoinstallationdirectory.Allpathsareusuallyresolvedrelativetothis.
- basedir="C:/ProgramFiles/MySQL/MySQLServer5.5/"
- #Pathtothedatabaseroot
- datadir="C:/DocumentsandSettings/AllUsers/ApplicationData/MySQL/MySQLServer5.5/Data/"
- #Thedefaultcharactersetthatwillbeusedwhenanewschemaortableis
- #createdandnocharactersetisdefined
- <spanstyle="color:#ff0000;">character-set-server=utf8
- </span>#Thedefaultstorageenginethatwillbeusedwhencreatenewtableswhen
- default-storage-engine=INNODB
- #SettheSQLmodetostrict
- sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
- #ThemaximumamountofconcurrentsessionstheMySQLserverwill
- #allow.Oneoftheseconnectionswillbereservedforauserwith
- #SUPERprivilegestoallowtheadministratortologinevenifthe
- #connectionlimithasbeenreached.
- max_connections=100
- #QuerycacheisusedtocacheSELECTresultsandlaterreturnthem
- #withoutactualexecutingthesamequeryonceagain.Havingthequery
- #cacheenabledmayresultinsignificantspeedimprovements,ifyour
- #havealotofidenticalqueriesandrarelychangingtables.Seethe
- #"Qcache_lowmem_prunes"statusvariabletocheckifthecurrentvalue
- #ishighenoughforyourload.
- #Note:Incaseyourtableschangeveryoftenorifyourqueriesare
- #textuallydifferenteverytime,thequerycachemayresultina
- #slowdowninsteadofaperformanceimprovement.
- query_cache_size=0
- #Thenumberofopentablesforallthreads.Increasingthisvalue
- #increasesthenumberoffiledescriptorsthatmysqldrequires.
- #Thereforeyouhavetomakesuretosettheamountofopenfiles
- #allowedtoatleast4096inthevariable"open-files-limit"in
- #section[mysqld_safe]
- table_cache=256
- #Maximumsizeforinternal(in-memory)temporarytables.Ifatable
- #growslargerthanthisvalue,itisautomaticallyconvertedtodisk
- #basedtableThislimitationisforasingletable.Therecanbemany
- #ofthem.
- tmp_table_size=17M
- #Howmanythreadsweshouldkeepinacacheforreuse.Whenaclient
- #disconnects,theclientsthreadsareputinthecacheiftherearent
- #morethanthread_cache_sizethreadsfrombefore.Thisgreatlyreduces
- #theamountofthreadcreationsneededifyouhavealotofnew
- #connections.(Normallythisdoesntgiveanotableperformance
- #improvementifyouhaveagoodthreadimplementation.)
- thread_cache_size=8
- #***MyISAMSpecificoptions
- #ThemaximumsizeofthetemporaryfileMySQLisallowedtousewhile
- #recreatingtheindex(duringREPAIR,ALTERTABLEorLOADDATAINFILE.
- #Ifthefile-sizewouldbebiggerthanthis,theindexwillbecreated
- #throughthekeycache(whichisslower).
- myisam_max_sort_file_size=100G
- #Ifthetemporaryfileusedforfastindexcreationwouldbebigger
- #thanusingthekeycachebytheamountspecifiedhere,thenpreferthe
- #keycachemethod.Thisismainlyusedtoforcelongcharacterkeysin
- #largetablestousetheslowerkeycachemethodtocreatetheindex.
- myisam_sort_buffer_size=34M
- #SizeoftheKeyBuffer,usedtocacheindexblocksforMyISAMtables.
- #Donotsetitlargerthan30%ofyouravailablememory,assomememory
- #isalsorequiredbytheOStocacherows.Evenifyourenotusing
- #MyISAMtables,youshouldstillsetitto8-64Masitwillalsobe
- #usedforinternaltemporarydisktables.
- key_buffer_size=25M
- #SizeofthebufferusedfordoingfulltablescansofMyISAMtables.
- #Allocatedperthread,ifafullscanisneeded.
- read_buffer_size=64K
- read_rnd_buffer_size=256K
- #ThisbufferisallocatedwhenMySQLneedstorebuildtheindexin
- #REPAIR,OPTIMZE,ALTERtablestatementsaswellasinLOADDATAINFILE
- #intoanemptytable.Itisallocatedperthreadsobecarefulwith
- #largesettings.
- sort_buffer_size=256K
- #***INNODBSpecificoptions***
- #UsethisoptionifyouhaveaMySQLserverwithInnoDBsupportenabled
- #butyoudonotplantouseit.Thiswillsavememoryanddiskspace
- #andspeedupsomethings.
- #skip-innodb
- #AdditionalmemorypoolthatisusedbyInnoDBtostoremetadata
- #information.IfInnoDBrequiresmorememoryforthispurposeitwill
- #starttoallocateitfromtheOS.Asthisisfastenoughonmost
- #recentoperatingsystems,younormallydonotneedtochangethis
- #value.SHOWINNODBSTATUSwilldisplaythecurrentamountused.
- innodb_additional_mem_pool_size=2M
- #Ifsetto1,InnoDBwillflush(fsync)thetransactionlogstothe
- #diskateachcommit,whichoffersfullACIDbehavior.Ifyouare
- #willingtocompromisethissafety,andyouarerunningsmall
- #transactions,youmaysetthisto0or2toreducediskI/Otothe
- #logs.Value0meansthatthelogisonlywrittentothelogfileand
- #thelogfileflushedtodiskapproximatelyoncepersecond.Value2
- #meansthelogiswrittentothelogfileateachcommit,butthelog
- #fileisonlyflushedtodiskapproximatelyoncepersecond.
- innodb_flush_log_at_trx_commit=1
- #ThesizeofthebufferInnoDBusesforbufferinglogdata.Assoonas
- #itisfull,InnoDBwillhavetoflushittodisk.Asitisflushed
- #oncepersecondanyway,itdoesnotmakesensetohaveitverylarge
- #(evenwithlongtransactions).
- innodb_log_buffer_size=1M
- #InnoDB,unlikeMyISAM,usesabufferpooltocachebothindexesand
- #rowdata.ThebiggeryousetthisthelessdiskI/Oisneededto
- #accessdataintables.Onadedicateddatabaseserveryoumaysetthis
- #parameterupto80%ofthemachinephysicalmemorysize.Donotsetit
- #toolarge,though,becausecompetitionofthephysicalmemorymay
- #causepagingintheoperatingsystem.Notethaton32bitsystemsyou
- #mightbelimitedto2-3.5Gofuserlevelmemoryperprocess,sodonot
- #setittoohigh.
- innodb_buffer_pool_size=47M
- #Sizeofeachlogfileinaloggroup.Youshouldsetthecombinedsize
- #oflogfilestoabout25%-100%ofyourbufferpoolsizetoavoid
- #unneededbufferpoolflushactivityonlogfileoverwrite.However,
- #notethatalargerlogfilesizewillincreasethetimeneededforthe
- #recoveryprocess.
- innodb_log_file_size=24M
- #NumberofthreadsallowedinsidetheInnoDBkernel.Theoptimalvalue
- #dependshighlyontheapplication,hardwareaswellastheOS
- #schedulerproperties.Atoohighvaluemayleadtothreadthrashing.
- innodb_thread_concurrency=8
复制代码 首先第一点:jsp,servlet,javabean这些最基本的,嘿嘿,就算你是高手的话,在大行的企业级应用的话还是需要框架的,一个好的框架确实能构解决许多问题。 |
|