鐩綍
鏈弬鑰冮傜敤浜嶮yODBC 3.51銆傚浜庣浉搴旂殑鐗堟湰锛屼綘鍙互鎵惧埌鏃х殑浜岃繘鍒剁増鎴栨簮鐮佺増MyODBC鎵嬪唽銆
杩欐槸鍏充簬MySQL ODBC椹卞姩绋嬪簭鐨勫弬鑰冩墜鍐岋紝鑰屼笉鏄氱敤ODBC鍙傝冦傚叧浜嶰DBC鐨勬洿澶氫俊鎭紝璇峰弬闃http://www.microsoft.com/data/銆
瀵逛簬鏈弬鑰冪殑搴旂敤绋嬪簭寮鍙戦儴鍒嗭紝鍋囧畾鐢ㄦ埛鍦–璇█鏂归潰鏈夌潃鑹ソ鐨勫疄璺电煡璇嗭紝瀵笵BMS鏈変竴鑸簡瑙o紝鏈鍚庯紝杩樺簲鐔熸倝MySQL銆傚叧浜嶮ySQL鍔熻兘鍙婂叾璇硶鐨勬洿澶氫俊鎭紝璇峰弬闃http://dev.mysql.com/doc/銆
濡傛灉浣犵殑闂鏈兘鍦ㄦ湰鏂囨。涓緱鍒拌В绛旓紝璇峰彂閫佺數瀛愰偖浠惰嚦myodbc@lists.mysql.com銆
鍏充簬ODBC鐨勬洿澶氫俊鎭紝璇峰弬闃http://www.microsoft.com/data/銆
鍏充簬MyODBC鐨勬洿澶氫俊鎭紝璇疯闂http://www.mysql.com/products/myodbc/銆
鍏充簬璁稿彲鐨勬洿澶氫俊鎭紝璇疯闂http://www.mysql.com/company/legal/licensing/銆
路 Windows 95, 98, Me, NT, 2000, XP鍜2003
路 鎵鏈塙nix鎿嶄綔绯荤粺
o AIX
o Amiga
o BSDI
o DEC
o FreeBSD
o HP-UX 10, 11
o Linux
o Mac OS X Server
o Mac OS X
o NetBSD
o OpenBSD
o OS/2
o SGI Irix
o Solaris
o SunOS
o SCO OpenServer
o SCO UnixWare
o Tru64 Unix
瀵逛簬鐗瑰畾骞冲彴锛屽鏋滄棤娉曚笅杞戒簩杩涘埗鐗堟湰锛屽彲閫氳繃涓嬭浇椹卞姩绋嬪簭婧愮爜鑷鍒涘缓椹卞姩绋嬪簭銆備綘涔熷彲浠ヤ负MySQL璐$尞浜岃繘鍒朵唬鐮侊紝鏂瑰紡鏄彂閫侀偖浠惰嚦myodbc@lists.mysql.com锛岃繖鏍峰叾浠栫敤鎴峰氨鑳戒娇鐢ㄤ綘璐$尞鐨勫唴瀹广
鍏充簬璁㈤槄MySQL閭欢鍒楄〃鎴栨祻瑙堝垪琛ㄦ。妗堢殑鏇村淇℃伅锛岃璁块棶http://lists.mysql.com/銆
鍏朵腑锛屽叧娉ㄧ▼搴︽渶楂樼殑鏄鍧汳ySQL杩炴帴鍣ㄩ儴鍒嗙殑ODBC璁哄潧銆
濡傛灉閬囧埌涓嶮yODBC鏈夊叧鐨勫洶闅炬垨闂锛岄鍏堝簲浣跨敤ODBC绠$悊鍣ㄥ拰MyODBC鐢熸垚涓浠芥棩蹇楁枃浠锛堣姹傛潵鑷狾DBC ADMIN鐨勬棩蹇楁椂鑾峰緱鐨勬棩蹇楁枃浠讹級銆鍏充簬瀹屾垚璇ユ楠ょ殑鏂瑰紡锛岃鍙傝26.1.9.7鑺傦紝鈥滆幏鍙朞DBC璺熻釜鏂囦欢鈥銆
妫鏌yODBC璺熻釜鏂囦欢锛屾壘鍑哄彲鑳藉嚭閿欑殑鍦版柟銆傞氳繃鍦myodbc.log鏂囦欢涓悳绱㈠瓧绗︿覆鈥>mysql_real_query鈥锛屽彲纭畾宸叉墽琛岀殑璇彞銆
姝ゅ锛屼綘杩樺簲灏濊瘯浠mysql瀹㈡埛绔▼搴忔垨admndemo鎵ц璇彞銆傝繖鏍凤紝灏辫兘甯姪浣犵‘瀹氶敊璇殑鍑哄锛孧yODBC鎴朚ySQL銆
濡傛灉浣犲彂鐜颁簡涓嶆纭殑浜嬮」锛岃灏嗙浉鍏宠锛堟渶澶40琛岋級鍙戦佺粰MyODBC閭欢鍒楄〃銆傝鍙傝1.7.1.1鑺傦紝鈥淢ySQL閭欢鍒楄〃鈥銆傝鍕垮彂閫佹暣涓狹yODBC鎴朞DBC鏃ュ織鏂囦欢锛
濡傛灉浣犳棤娉曟壘鍑洪敊璇箣鎵鍦紝鏈鍚庣殑閫夋嫨鏄紝浠ar鎴杬ip鏍煎紡鍒涘缓鍖呭惈MyODBC璺熻釜鏂囦欢銆丱DBC鏃ュ織鏂囦欢鍜孯EADME鏂囦欢锛堥槓鏄庨棶棰橈級鐨勬。妗堛備綘鍙互灏嗚妗f鏂囦欢鍙戦佽嚦ftp://ftp.mysql.com/pub/mysql/upload/銆傚彧鏈変綅浜嶮ySQL AB鐨勬垜浠墠鑳借闂綘涓婁紶鐨勬枃浠讹紝鑰屼笖鎴戜滑浼氬崄鍒嗚皑鎱庡湴瀵瑰緟杩欑被鏁版嵁銆
濡傛灉浣犲垱寤轰簡浠嶅嚭鐜伴棶棰樼殑绋嬪簭锛岃灏嗚绋嬪簭涔熷寘鍚湪妗f鏂囦欢涓
濡傛灉绋嬪簭鑳藉涓庢煇浜涘叾浠朣QL鏈嶅姟鍣ㄤ竴璧峰伐浣滐紝妗f涓繕搴斿寘鍚湪杩欑被鍏朵粬SQL鏈嶅姟鍣ㄤ笅宸ヤ綔鐨凮DBC鏃ュ織鏂囦欢銆
璇疯浣忥紝浣犳彁渚涚粰鎴戜滑鐨勪俊鎭秺澶氾紝鎴戜滑鏇存闂鐨勬満浼氬氨瓒婂ぇ銆
寮鏀惧紡鏁版嵁搴撹繛鎺ユэ紙ODBC锛夋槸骞挎硾鎺ュ彈鐨勭敤浜庢暟鎹簱璁块棶鐨勫簲鐢ㄧ▼搴忕紪绋嬫帴鍙o紙API锛夈傚畠鍩轰簬閽堝鏁版嵁搴揂PI鐨凜LI锛堣皟鐢ㄥ眰鎺ュ彛锛夎鑼冿紙鏉ヨ嚜X/Open鍜孖SO/IEC锛夛紝骞堕噰鐢ㄤ簡缁撴瀯鍖栨煡璇㈣瑷锛圫QL锛変綔涓哄叾鏁版嵁搴撹闂瑷銆
鍦26.1.16鑺傦紝鈥淢yODBC API寮曠敤鈥涓紝姒傝浠嬬粛浜哅yODBC鏀寔鐨凮DBC鍔熻兘銆傚叧浜嶰DBC鐨勬洿澶氫俊鎭紝璇峰弬闃http://www.microsoft.com/data/銆
路 搴旂敤绋嬪簭锛
搴旂敤绋嬪簭鎸囩殑鏄氳繃璋冪敤ODBC API鏉ヨ闂甅ySQL鏈嶅姟鍣ㄤ笂鏁版嵁鐨勭▼搴忋傚簲鐢ㄧ▼搴忎娇鐢ㄦ爣鍑嗙殑ODBC璋冪敤涓庨┍鍔ㄧ鐞嗗櫒杩涜閫氫俊銆傚簲鐢ㄧ▼搴忎笉鍏冲績鏁版嵁鐨勫瓨鍌ㄤ綅缃紝瀛樺偍鏂瑰紡锛岀敋鑷充笉鍏冲績涓鸿闂暟鎹岃繘琛岀殑绯荤粺閰嶇疆鏂瑰紡銆傚畠浠呴渶瑕佺煡閬撴暟鎹簮鍚嶏紙DSN锛夈
瀵逛簬鎵鏈夌殑搴旂敤绋嬪簭锛屾棤璁哄畠浠娇鐢∣BDC鐨勬柟寮忔槸浠涔堬紝寰堝浠诲姟鏄叡鍚岀殑銆傝繖浜涗换鍔″寘鎷細
o 閫夋嫨MySQL鏈嶅姟鍣紝骞朵笌涔嬭繛鎺ャ
o 鎻愪氦灏嗚鎵ц鐨凷QL璇彞銆
o 妫绱㈢粨鏋滐紙濡傛灉鏈夌殑璇濓級銆
o 澶勭悊閿欒銆
o 鎻愪氦鎴栧洖婊氬寘鍚玈QL璇彞鐨勪簨鍔°
o 鏂紑涓嶮ySQL鏈嶅姟鍣ㄧ殑杩炴帴銆
鐢变簬澶у鏁版暟鎹闂伐浣滄槸浣跨敤SQL瀹屾垚锛屽浜庝娇鐢∣BDC鐨勫簲鐢ㄧ▼搴忔潵璇达紝鍏朵富瑕佷换鍔℃槸鎻愪氦SQL璇彞锛屽苟妫绱㈢敱杩欎簺璇彞鐢熸垚鐨勭粨鏋溿
路 椹卞姩绠$悊鍣細
椹卞姩绠$悊鍣ㄦ槸鐢ㄤ簬绠$悊搴旂敤绋嬪簭鍜岄┍鍔ㄧ▼搴忛棿閫氫俊鐨勫簱銆傚畠璐熻矗鎵ц涓嬭堪浠诲姟锛
o 瑙f瀽鏁版嵁婧愬悕锛圖SN锛夈
o 鍔犺浇鍜屽嵏杞介┍鍔ㄧ▼搴忋
o 澶勭悊ODBC璋冪敤锛屾垨灏嗗叾浼犻掔粰椹卞姩绋嬪簭銆
路 MyODBC椹卞姩绋嬪簭锛
MyODBC椹卞姩绋嬪簭鏄敤浜庡疄鏂絆DBC API鎵鎻愪緵鍔熻兘鐨勫簱銆傚畠璐熻矗澶勭悊ODBC鍑芥暟璋冪敤锛屽皢SQL璇锋眰鎻愪氦缁橫ySQL鏈嶅姟鍣紝骞跺皢缁撴灉杩斿洖缁欏簲鐢ㄧ▼搴忋傚鏈夊繀瑕侊紝椹卞姩绋嬪簭浼氭洿鏀瑰簲鐢ㄧ▼搴忕殑璇锋眰锛屼互渚胯璇锋眰绗﹀悎MySQL鏀寔鐨勮娉曘
路 ODBC.INI锛
ODBC.INI鏄疧DBC閰嶇疆鏂囦欢锛屽叾涓繚瀛樹簡杩炴帴鍒版湇鍔″櫒鎵闇鐨勯┍鍔ㄤ俊鎭拰鏁版嵁搴撲俊鎭傞┍鍔ㄧ鐞嗗櫒灏嗕娇鐢ㄥ畠鏉ョ‘瀹氬姞杞藉摢涓┍鍔ㄧ▼搴忥紙浣跨敤鏁版嵁婧愬悕锛夈傞┍鍔ㄧ▼搴忓皢鏍规嵁鎸囧畾鐨凞SN浣跨敤瀹冩潵璇诲彇杩炴帴鍙傛暟銆傛洿澶氫俊鎭紝璇峰弬瑙26.1.9鑺傦紝鈥淢yODBC閰嶇疆鈥銆
路 MySQL鏈嶅姟鍣細
MySQL鏈嶅姟鍣ㄦ槸鏁版嵁婧愩侻ySQL鏄細
o 涓绉嶆暟鎹簱绠$悊绯荤粺锛圖BMS锛
o 涓绉嶅叧鑱旀暟鎹簱绠$悊绯荤粺锛圧DBMS锛
o 寮鏀炬簮鐮佽蒋浠
路 瑙f瀽鏁版嵁婧愬悕锛圖SN锛夈
路 鍔犺浇鍜屽嵏杞介┍鍔ㄧ▼搴忋
路 澶勭悊ODBC鍑芥暟璋冪敤锛屾垨灏嗗叾浼犻掔粰椹卞姩绋嬪簭銆
涓嬮潰缁欏嚭浜嗕竴浜涘父鐢ㄧ殑椹卞姩绋嬪簭锛
路 Microsoft Windows ODBC椹卞姩绠$悊鍣紙odbc32.dll锛夛紝http://www.microsoft.com/data/
路 unixODBC Unix椹卞姩绠$悊鍣紙libodbc.so锛夛紝http://www.unixodbc.org銆
路 iODBC ODBC Unix椹卞姩绠$悊鍣紙libiodbc.so锛夛紝http://www.iodbc.org銆
浠2.1.2鐗堝紑濮嬶紝UnixODBC涔熸彁渚汳yODBC 3.51銆
MyODBC鑳藉宸ヤ綔鍦╓indows 9x, Me, NT, 2000, XP鍜2003锛屼互鍙婂ぇ澶氭暟Unix骞冲彴涓娿
MyODBC鏄紑鏀炬簮鐮佽蒋浠躲備綘鍙互鍦ㄧ綉绔http://dev.mysql.com/downloads/connector/odbc/涓婃壘鍒板畠鐨勬渶鏂扮増鏈傝娉ㄦ剰锛2.50.x鐗堥噰鐢ㄧ殑鏄疞GPL璁稿彲锛岃3.51.x鐗堥噰鐢ㄧ殑鏄疓PL璁稿彲銆
濡傛灉浣跨敤MyODBC鏃跺嚭鐜颁簡闂锛岃屼笖浣犵殑绋嬪簭杩樿兘涓嶰LEDB涓璧峰伐浣滐紝搴斿皾璇曚娇鐢∣LEDB椹卞姩绋嬪簭銆
姝e父鎯呭喌涓嬶紝鍦╓indows鏈哄櫒涓婁粎闇瀹夎MyODBC銆備粎褰撲綘鎷ユ湁杩愯鍦║nix鏈哄櫒涓婄殑绋嬪簭锛堝ColdFusion锛夛紝鑰屼笖璇ョ▼搴忓皢浣跨敤ODBC鏉ヨ闂暟鎹簱鏃讹紝鎵嶉渶瀹夎鐢ㄤ簬Unix鐨凪yODBC銆
濡傛灉浣犳墦绠楀湪Unix鏈哄櫒涓婂畨瑁匨yODBC锛岃繕闇瑕1涓狾DBC绠$悊鍣ㄣ侻yODBC鑳藉涓庡ぇ澶氭暟Unix ODBC绠$悊鍣ㄤ竴璧峰伐浣溿
路 瑕佹兂浣跨敤ODBC搴旂敤绋嬪簭锛堜笉鏀寔MySQL鐨勫簲鐢ㄧ▼搴忥級锛屽缓绔嬩粠Windows骞冲彴鍒癠nix骞冲彴鐨勮繛鎺ワ紝棣栧厛蹇呴』鍦╓indows鏈哄櫒涓婂畨瑁匨yODBC銆
路 鐢ㄦ埛鍜學indows鏈哄櫒蹇呴』鍏锋湁璁块棶浣嶄簬Unix鏈哄櫒涓婄殑MySQL鏈嶅姟鍣ㄧ殑鏉冮檺銆傝繖鍙氳繃GRANT鍛戒护璁剧疆銆傝鍙傝13.5.1.3鑺傦紝鈥淕RANT鍜孯EVOKE璇硶鈥銆
路 蹇呴』鍒涘缓ODBC DSN鏉$洰锛屾柟寮忓涓嬶細
1. 鎵撳紑Windows鏈哄櫒涓婄殑鎺у埗闈㈡澘銆
2. 鍙屽嚮ODBC鏁版嵁婧32浣嶅浘鏍囥
3. 鐐瑰嚮閫夐」鍗♀滅敤鎴稤SN鈥濄
4. 鐐瑰嚮鈥滄坊鍔犫濇寜閽
5. 鍦ㄢ滃垱寤烘柊鏁版嵁婧愨濆睆骞曚笂閫夋嫨MySQL锛屽苟鐐瑰嚮鈥滃畬鎴愨濇寜閽
6. 鏄剧ずMySQL椹卞姩绋嬪簭鐨勯粯璁ら厤缃睆骞曘傝鍙傝26.1.9.2鑺傦紝鈥滃湪Windows涓婇厤缃甅yODBC DSN鈥銆
路 鍚姩搴旂敤绋嬪簭锛屽苟浣跨敤鍦∣DBC绠$悊鍣ㄤ腑鎸囧畾鐨凞SN閫夋嫨ODBC椹卞姩绋嬪簭銆
娉ㄦ剰锛屽湪MySQL灞忓箷涓婅繕鏄剧ず浜嗗叾浠栭夐」锛屽鏋滈亣鍒伴棶棰橈紝鍙皾璇曡繖浜涢夐」锛堝璺熻釜銆佽繛鎺ユ椂涓嶆彁绀虹瓑锛夈
鍦╓indows骞冲彴涓婏紝瀹夎杈冩棫鐨凪yODBC 2.50椹卞姩鏃讹紝鍙兘浼氶亣鍒颁笅杩伴敊璇細
鎷疯礉C:\WINDOWS\SYSTEM\MFC30.DLL鏃跺嚭鐜伴敊璇
閲嶅惎Windows锛屽苟鍐嶆瀹夎锛堝湪杩愯浠讳綍浣跨敤ODBC鐨勫簲鐢ㄧ▼搴忎箣鍓嶏級銆
闂鍦ㄤ簬鍏朵粬绋嬪簭姝d娇鐢∣DBC銆傜敱浜嶹indows鐨勮璁℃柟寮忥紝鍦ㄨ繖绉嶆儏鍐典笅锛屼綘鍙兘鏃犳硶浣跨敤Microsoft鐨凮DBC璁剧疆绋嬪簭瀹夎鏂扮殑ODBC椹卞姩銆傚湪澶у鏁版儏鍐典笅锛屽彲浠ラ氳繃杩炵画鎸夆滃拷鐣モ濋敭鎷疯礉鍓╀綑鐨凪yODBC鏂囦欢锛屾渶缁堝畨瑁呭簲浠嶈兘宸ヤ綔銆傚涓嶇劧锛岃В鍐虫柟妗堟槸鍦ㄢ滃畨鍏ㄦā寮忊濅笅閲嶆柊鍚姩璁$畻鏈恒傚湪閲嶅惎鐨勮繃绋嬩腑锛屽湪鏈哄櫒鍚姩Windows鍓嶆寜F8锛岄夋嫨鈥滃畨鍏ㄦā寮忊濓紝瀹夎MyODBC锛岀劧鍚庡湪姝e父妯″紡涓嬮噸鏂板惎鍔ㄨ绠楁満銆
瑕佹兂浣跨敤RPM鍒嗗彂鐗堝湪Linux骞冲彴涓婂畨瑁呮垨鍗囩骇MyODBC锛屽彲绠鍗曞湴涓嬭浇鏈鏂癕yODBC鐨凴PM鍒嗗彂鐗堬紝骞舵寜鐓т笅闈粙缁嶇殑鏂瑰紡鎿嶄綔銆備娇鐢su root鎴愪负鏍圭敤鎴凤紝鐒跺悗瀹夎RPM鏂囦欢銆
濡傛灉鏄娆″畨瑁咃細
shell> su root
shell> rpm -ivh MyODBC-3.51.01.i386-1.rpm
濡傛灉椹卞姩绋嬪簭宸插瓨鍦紝鍙寜鐓т笅杩版柟寮忓崌绾у畠锛
shell> su root
shell> rpm -Uvh MyODBC-3.51.01.i386-1.rpm
濡傛灉瀛樺湪鍏充簬MySQL瀹㈡埛绔簱libmysqlclient鐨勪换浣曚緷瀛橀敊璇紝鍙娇鐢鈥-nodeps鈥閫夐」绠鍗曞湴蹇界暐瀹冿紝鐒跺悗纭繚MySQL瀹㈡埛绔叡浜簱浣嶄簬璺緞涓垨閫氳繃LD_LIBRARY_PATH杩涜浜嗚缃
杩欐牱锛屽氨浼氬皢椹卞姩绋嬪簭搴撳拰鐩稿叧鏂囦欢鍒嗗埆瀹夎鍒/usr/local/lib鍜/usr/share/doc/MyODBC鐩綍涓嬨傝杞嚦26.1.9.3鑺傦紝鈥滃湪Unix骞冲彴涓婇厤缃甅yODBC DSN鈥銆
瑕佹兂鍗歌浇椹卞姩绋嬪簭锛岃棣栧厛鎴愪负鏍圭敤鎴凤紝鐒跺悗鎵цrpm鍛戒护锛
shell> su root
shell> rpm -e MyODBC
瑕佹兂浠巘arball鍒嗗彂鐗堬紙.tar.gz鏂囦欢锛夊畨瑁呴┍鍔ㄧ▼搴忥紝璇蜂笅杞介拡瀵逛綘鎵浣跨敤鎿嶄綔绯荤粺鐨勬渶鏂扮増椹卞姩绋嬪簭锛岀劧鍚庢寜鐓т笅杩版楠ゆ搷浣滐細
shell> su root
shell> gunzip MyODBC-3.51.01-i686-pc-linux.tar.gz
shell> tar xvf MyODBC-3.51.01-i686-pc-linux.tar
shell> cd MyODBC-3.51.01-i686-pc-linux
璇烽槄璇INSTALL-BINARY鏂囦欢涓殑瀹夎璇存槑锛屽苟鎵ц涓嬭堪鍛戒护锛
shell> cp libmyodbc* /usr/local/lib
shell> cp odbc.ini /usr/local/etc
shell> export ODBCINI=/usr/local/etc/odbc.ini
鐒跺悗锛岃璺宠嚦26.1.9.3鑺傦紝鈥滃湪Unix骞冲彴涓婇厤缃甅yODBC DSN鈥涓篗yODBC閰嶇疆DSN銆傛洿澶氫俊鎭紝璇峰弬瑙佷笌鍙戝竷鐗堜竴璧锋彁渚涚殑INSTALL-BINARY鏂囦欢銆
路 MDAC, Microsoft Data Access SDK锛http://www.microsoft.com/data/銆
路 MySQL瀹㈡埛绔簱浠ュ強MySQL 4.0.0鎴栨洿楂樼増鏈殑鍖呭惈鏂囦欢銆傦紙鏈濂芥槸MySQL 4.0.16鎴栨洿楂樼増鏈級銆傚簲婊¤冻涓婅堪瑕佹眰锛岃繖鏄洜涓篗yODBC闇瑕佺敤鍒拌鐗堟湰浠ヤ笂鐨勫簱鎵嶆彁渚涚殑鏂拌皟鐢ㄥ拰缁撴瀯銆傝鎯宠幏寰楀鎴风搴撳拰鍖呭惈鏂囦欢锛岃璁块棶http://dev.mysql.com/downloads/銆
瑕佹兂鍒涘缓椹卞姩绋嬪簭锛岃閲囧彇涓嬭堪姝ラ锛
1. 涓嬭浇骞跺皢婧愮爜灞曞紑鍒版枃浠跺す锛岀劧鍚庡皢浣嶇疆鍒囨崲鍒拌鏂囦欢澶广傚湪涓嬭堪鍛戒护涓紝鍋囧畾鏂囦欢澶逛负myodbc3-src锛
2. C:\> cd myodbc3-src
3. 缂栬緫Makefile锛屼负MySQL瀹㈡埛绔簱鍜屽ご鏂囦欢鎸囧畾姝g‘鐨勮矾寰勩傜劧鍚庝娇鐢ㄤ笅杩板懡浠ゅ垱寤哄苟瀹夎鍙戝竷鐗堛
4. C:\> nmake -f Makefile
5. C:\> nmake -f Makefile install
nmake -f Makefile鐢ㄤ簬鍒涘缓椹卞姩绋嬪簭鐨勫彂甯冪増骞跺皢浜岃繘鍒剁爜鏀惧叆鍚嶄负Release鐨勫瓙鐩綍涓嬨
nmake -f Makefile install鐢ㄤ簬灏嗛┍鍔ㄧ▼搴廌LL鍜屽簱锛myodbc3.dll, myodbc3.lib锛夊畨瑁咃紙鎷疯礉锛夊埌绯荤粺鐩綍涓嬨
6. 瑕佹兂鍒涘缓璋冭瘯鐗堬紝璇蜂娇鐢Makefile_Debug鑰屼笉鏄疢akefile锛屽涓嬫墍绀猴細
7. C:\> nmake -f Makefile_debug
8. C:\> nmake -f Makefile_debug install
9. 浣跨敤涓嬭堪鍛戒护锛屽彲娓呴櫎骞堕噸鏂板垱寤洪┍鍔ㄧ▼搴忥細
10. C:\> nmake -f Makefile clean
11. C:\> nmake -f Makefile install
娉ㄩ噴锛
路 纭繚鍦∕akefiles涓寚瀹氫簡姝g‘鐨凪ySQL瀹㈡埛绔簱鍜屽ご鏂囦欢璺緞锛堣缃MYSQL_LIB_PATH鍜MYSQL_INCLUDE_PATH鍙橀噺锛夈傞粯璁ょ殑澶存枃浠惰矾寰勬槸C:\mysql\include銆傚浜庡彂甯冪増DLL锛岄粯璁ょ殑搴撹矾寰勬槸C:\mysql\lib\opt锛屽浜庤皟璇曠増锛岄粯璁よ矾寰勬槸C:\mysql\lib\debug銆
路 鍏充簬nmake鐨勫畬鏁寸敤娉曪紝璇峰弬瑙http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vcce4/html/evgrfRunningNMAKE.asp銆
路 濡傛灉浣犳鍦ㄤ娇鐢˙itKeeper鏍戞潵杩涜缂栬瘧锛屾墍鏈夌殑閽堝Windows鐨Makefiles鍧囧皢琚懡鍚嶄负Win_Makefile*銆
路 MySQL瀹㈡埛绔簱浠ュ強MySQL 4.0.0鎴栨洿楂樼増鏈殑鍖呭惈鏂囦欢銆傦紙鏈濂芥槸MySQL 4.0.16鎴栨洿楂樼増鏈級銆傚簲婊¤冻涓婅堪瑕佹眰锛岃繖鏄洜涓篗yODBC闇瑕佺敤鍒拌鐗堟湰浠ヤ笂鐨勫簱鎵嶆彁渚涚殑鏂拌皟鐢ㄥ拰缁撴瀯銆傝鎯宠幏寰楀鎴风搴撳拰鍖呭惈鏂囦欢锛岃璁块棶http://dev.mysql.com/downloads/銆
路 蹇呴』浣跨敤鈥--enable-thread-safe-client鈥濋夐」閰嶇疆MySQL搴撱侺ibmysqlclient鏄綔涓哄叡浜簱瀹夎鐨勩
路 蹇呴』瀹夎涓嬭堪Unix ODBC椹卞姩绠$悊鍣ㄤ箣涓锛
o iodbc 3.0鎴栨洿楂樼増鏈紙http://www.iodbc.org锛
o unixodbc Alpha 3鎴栨洿楂樼増鏈紙http://www.unixodbc.org锛
路 濡傛灉浣跨敤浜嗘湭缂栬瘧鍦∕ySQL瀹㈡埛绔簱涓殑瀛楃闆嗭紙榛樿瀛楃闆嗕负锛 latin1 big5 czech euc_kr gb2312 gbk sjis tis620 ujis锛夛紝灏遍渶瑕佷粠瀛楃闆嗙洰褰曚笅灏唌ysql瀛楃瀹氫箟瀹夎鍒SHAREDIR涓紙榛樿鎯呭喌涓嬩綅浜/usr/local/mysql/share/mysql/charsets锛夈傚鏋滃湪鐩稿悓鏈哄櫒涓婂畨瑁呬簡MySQL锛屽畠浠簲浣嶄簬鎭板綋浣嶇疆銆
涓鏃﹀畬鎴愪簡鎵鏈夋墍闇鏂囦欢鐨勫畨瑁咃紝灏嗘簮鐮佹枃浠惰В鍖呭埌鍗曠嫭鐩綍涓嬶紝骞舵寜鐓т笅闈㈢粰鍑虹殑璇存槑杩涜鎿嶄綔銆
shell> ./configure --help
涓嬮潰浠嬬粛浜嗕竴浜涘父鐢ㄧ殑鈥configure鈥濋夐」銆
1. 瑕佹兂缂栬瘧MyODBC锛岄』浣跨敤鈥--with-mysql-path=DIR鈥濋夐」鏉ユ彁渚汳ySQL瀹㈡埛绔簱鏂囦欢鍜屽寘鍚枃浠惰矾寰勶紝鍏朵腑锛屸DIR鈥濇槸MySQL鐨勫畨瑁呯洰褰曘
鍙氳繃杩愯鈥DIR/bin/mysql_config鈥濇潵纭畾MySQL缂栬瘧閫夐」銆
2. 涓篛DBC椹卞姩绠$悊鍣紙iodbc鎴unixobc锛夋彁渚涙爣鍑嗙殑澶存枃浠跺拰搴撴枃浠惰矾寰勩
路 濡傛灉浣犳鍦ㄤ娇鐢iodbc锛岃屼笖iodbc鏈畨瑁呭湪鍏堕粯璁や綅缃锛/usr/local锛夛紝鍙兘闇瑕佷娇鐢鈥--with-iodbc=DIR鈥濋夐」锛屽叾涓紝鈥DIR鈥濇槸iodbc鐨勫畨瑁呯洰褰曘
濡傛灉iodbc澶存枃浠舵湭浣嶄簬DIR/include鐩綍涓嬶紝鍙娇鐢鈥--with-iodbc-includes=INCDIR鈥閫夐」鎸囧畾瀹冧滑鐨勪綅缃
涓婇潰鎵杩颁篃閫傜敤浜庡簱鏂囦欢銆傚鏋滃簱鏂囦欢鏈綅浜DIR/lib鐩綍涓嬶紝鍙娇鐢ㄢ--with-iodbc-libs=LIBDIR鈥濋夐」銆
路 濡傛灉浣犳鍦ㄤ娇鐢unixODBC锛屽彲浣跨敤鈥--with-unixODBC=DIR鈥濋夐」锛堝尯鍒嗗ぇ灏忓啓锛夛紝璁configure瀵绘壘unixODBC鑰屼笉鏄粯璁ょ殑iodbc锛屽叾涓紝鈥DIR鈥濇槸unixODBC鐨勫畨瑁呯洰褰曘
濡傛灉unixODBC澶存枃浠跺拰搴撴枃浠舵湭浣嶄簬鐩綍DIR/include鍜DIR/lib涓嬶紝鍙娇鐢鈥--with-unixODBC-includes=INCDIR鈥濆拰鈥--with-unixODBC-libs=LIBDIR鈥濋夐」銆
3. 鎴栬浣犱篃甯屾湜鎸囧畾涓嶅悓浜庘/usr/local鈥濈殑瀹夎鍓嶇紑銆備緥濡傦紝瑕佹兂灏哅yODBC椹卞姩瀹夎鍒扳/usr/local/odbc/lib鈥濈洰褰曚笅锛屽彲浣跨敤鈥--prefix=/usr/local/odbc鈥濋夐」銆
鏈缁堢殑閰嶇疆鍛戒护搴斾笌涓嬮潰缁欏嚭鐨勭浉浼硷細
shell> ./configure --prefix=/usr/local \
--with-iodbc=/usr/local \
--with-mysql-path=/usr/local/mysql
--enable-thread-safe
涔熷彲浠ヤ娇鐢ㄤ笅杩伴夐」绂佹瀹冿細
--disable-thread-safe
浣跨敤璇ラ夐」锛岃兘澶熼氳繃mysql绾跨▼瀹夊叏瀹㈡埛绔簱libmysqlclient_r.so锛堟墿灞曞悕涓庢搷浣滅郴缁熸湁鍏筹級鐨勯摼鎺ワ紝鍒涘缓椹卞姩绋嬪簭绾跨▼瀹夊叏搴搇ibmyodbc3_r.so銆
鍦ㄩ厤缃嚎绋嬪畨鍏ㄩ夐」鏃讹紝濡傛灉鍑虹幇浜嗛厤缃敊璇紝搴旀鏌config.log锛屾鏌ラ敊璇槸鍚︽槸鍥犵郴缁熶腑缂哄皯绾跨▼搴撹屽鑷寸殑锛屽鏋滄槸锛屼娇鐢↙IBS閫夐」鎻愪緵涓涓紝鍗
LIBS="-lpthread" ./configure ..
鍙互浣跨敤涓嬭堪閫夐」鍚敤鎴栫姝㈠叡浜拰闈欐侀夐」锛
--enable-shared[=yes/no] --disable-shared --enable-static[=yes/no] --disable-static
shell> make
濡傛灉鍑虹幇閿欒锛屾洿姝e悗锛岀户缁墽琛屽垱寤鸿繘绋嬨傚鏋滄棤娉曞垱寤猴紝璇峰彂閫佽缁嗙殑鐢靛瓙閭欢鑷myodbc@lists.mysql.com锛屼互鑾峰彇杩涗竴姝ュ府鍔┿
鍦ㄥぇ澶氭暟骞冲彴涓婏紝榛樿鎯呭喌涓嬶紝MySQL涓嶄細鍒涘缓鎴栨敮鎸佲.so鈥锛堝叡浜級瀹㈡埛绔簱锛岃繖鏄洜涓猴紝鍒涘缓鍏变韩搴撳湪杩囧幓閫犳垚杩囧緢澶氶棶棰樸
鍦ㄨ繖绉嶆儏鍐典笅锛屼綘鍙互涓嬭浇MySQL鍒嗗彂鐗堬紝骞朵娇鐢ㄤ互涓嬮夐」杩涜閰嶇疆锛
--without-server --enable-shared
瑕佹兂鍒涘缓鍏变韩椹卞姩绋嬪簭搴擄紝蹇呴』涓衡configure鈥濇寚瀹氣--enable-shared鈥閫夐」銆榛樿鎯呭喌涓嬶紝鈥configure鈥濅笉鍚敤璇ラ夐」銆
濡傛灉浣跨敤鈥--disable-shared鈥濋夐」杩涜浜嗛厤缃搷浣滐紝鍙娇鐢ㄤ笅杩板懡浠わ紝浠庨潤鎬佸簱鍒涘缓鈥.so鈥濇枃浠躲
shell> cd MyODBC-3.51.01 shell> make shell> cd driver shell> CC=/usr/bin/gcc \ $CC -bundle -flat_namespace -undefined error \ -o .libs/libmyodbc3-3.51.01.so \ catalog.o connect.o cursor.o dll.o error.o execute.o \ handle.o info.o misc.o myodbc3.o options.o prepare.o \ results.o transact.o utility.o \ -L/usr/local/mysql/lib/mysql/ \ -L/usr/local/iodbc/lib/ \ -lz -lc -lmysqlclient -liodbcinst
濡傛灉浣犳鍦ㄤ娇鐢╱nixODBC鑰屼笉鏄痠ODBC锛屽姟蹇呭皢鈥-liodbcinst鈥鏇存敼涓鈥-lodbcinst鈥锛屽苟鐩稿簲鍦伴厤缃簱璺緞銆
杩欐牱锛屽氨鍒涘缓浜libmyodbc3-3.51.01.so鏂囦欢锛屽苟灏嗗叾鏀惧湪鈥.libs鈥鐩綍涓嬨灏嗚鏂囦欢鎷疯礉鍒癕yODBC搴撶洰褰曚笅锛/usr/local/lib锛屾垨浣跨敤鈥--prefix鈥鎻愪緵鐨勫畨瑁呯洰褰曚笅鐨鈥lib鈥鐩綍锛夈
shell> cd .libs
shell> cp libmyodbc3-3.51.01.so /usr/local/lib
shell> cd /usr/local/lib
shell> ln -s libmyodbc3-3.51.01.so libmyodbc3.so
瑕佹兂鍒涘缓绾跨▼瀹夊叏椹卞姩绋嬪簭搴擄細
shell> CC=/usr/bin/gcc \ $CC -bundle -flat_namespace -undefined error -o .libs/libmyodbc3_r-3.51.01.so catalog.o connect.o cursor.o dll.o error.o execute.o handle.o info.o misc.o myodbc3.o options.o prepare.o results.o transact.o utility.o -L/usr/local/mysql/lib/mysql/ -L/usr/local/iodbc/lib/ -lz -lc -lmysqlclient_r -liodbcinst
shell> make install
璇ュ懡浠ゅ皢瀹夎涓嬭堪搴撻泦鍚堜箣涓锛
瀵逛簬MyODBC 3.51锛
路 libmyodbc3.so
路 libmyodbc3-3.51.01.so锛屽叾涓紝3.51.01鏄┍鍔ㄧ▼搴忕殑鐗堟湰
路 libmyodbc3.a
瀵逛簬绾跨▼瀹夊叏MyODBC 3.51锛
路 libmyodbc3_r.so
路 libmyodbc3-3_r.51.01.so
路 libmyodbc3_r.a
瀵逛簬MyODBC 2.5.0锛
路 libmyodbc.so
路 libmyodbc-2.50.39.so锛屽叾涓紝2.50.39鏄┍鍔ㄧ▼搴忕殑鐗堟湰
路 libmyodbc.a
鍏充簬鍒涘缓杩涚▼鐨勬洿澶氫俊鎭紝璇峰弬闃呬笌婧愮爜鍒嗗彂鐗堜竴璧锋彁渚涚殑INSTALL鏂囦欢銆娉ㄦ剰锛屽鏋滀綘璇曞浘浣跨敤Sun鐨勨渕ake鈥濓紝鍙兘浼氫互閿欒缁撴潫銆備粠鍙︿竴鏂归潰鏉ヨ锛孏NU gmake鍦ㄦ墍鏈夊钩鍙颁笂鍧囪兘鑹ソ宸ヤ綔銆
shell> ./configure --prefix=/usr/local
--with-unixODBC=/usr/local
--with-mysql-path=/usr/local/mysql
--disable-shared
--enable-gui=no
--host=powerpc-apple
璇ュ懡浠ゅ亣瀹歶nixODBC鍜孧ySQL鍧囧畨瑁呭湪榛樿浣嶇疆銆傚涓嶇劧锛岃杩涜鐩稿簲閰嶇疆銆
鍦 Mac OS X鐜涓嬶紝鈥--enable-shared鈥閫夐」灏嗛粯璁ゅ垱寤鈥.dylib鈥鏂囦欢銆浣犱篃鍙互閲囩敤涓嬭堪鏂瑰紡鍒涘缓鈥.so鈥濇枃浠讹細
shell> make
shell> cd driver
shell> CC=/usr/bin/gcc \
$CC -bundle -flat_namespace -undefined error
-o .libs/libmyodbc3-3.51.01.so *.o
-L/usr/local/mysql/lib/
-L/usr/local/iodbc/lib
-liodbcinst -lmysqlclient -lz -lc
瑕佹兂鍒涘缓绾跨▼瀹夊叏椹卞姩绋嬪簭搴擄細
shell> CC=/usr/bin/gcc \
$CC -bundle -flat_namespace -undefined error
-o .libs/libmyodbc3-3.51.01.so *.o
-L/usr/local/mysql/lib/
-L/usr/local/iodbc/lib
-liodbcinst -lmysqlclienti_r -lz -lc -lpthread
濡傛灉浣犳鍦ㄤ娇鐢╱nixODBC鑰屼笉鏄痠ODBC锛屽姟蹇呭皢鈥-liodbcinst鈥鏇存敼涓鈥-lodbcinst鈥锛屽苟鐩稿簲鍦伴厤缃簱璺緞銆
鍦ˋpple鐨凣CC鐗堟湰涓紝cc鍜gcc瀹為檯涓婂潎鏄gcc3鐨勭鍙烽摼鎺ャ
灏嗚搴撴嫹璐濆埌$prefix/lib鐩綍涓嬶紝骞跺皢symlink鎷疯礉鍒libmyodbc3.so銆
鍙互浣跨敤涓嬭堪鍛戒护浜ゅ弶妫楠岃緭鍑虹殑鍏变韩搴撳睘鎬э細
shell> otool -LD .libs/libmyodbc3-3.51.01.so
濡傛灉浣跨敤cc锛
shell> CC="cc" \
CFLAGS="+z" \
LDFLAGS="-Wl,+b:-Wl,+s" \
./configure --prefix=/usr/local
--with-unixodbc=/usr/local
--with-mysql-path=/usr/local/mysql/lib/mysql
--enable-shared
--enable-thread-safe
濡傛灉浣跨敤gcc锛
shell> CC="gcc" \
LDFLAGS="-Wl,+b:-Wl,+s" \
./configure --prefix=/usr/local
--with-unixodbc=/usr/local
--with-mysql-path=/usr/local/mysql
--enable-shared
--enable-thread-safe
涓鏃﹀垱寤轰簡椹卞姩绋嬪簭锛屼娇鐢ㄢchatr .libs/libmyodbc3.sl鈥濅氦鍙夋鏌ュ叾灞炴э紝鏌ョ湅鏄惁闇瑕佷娇鐢SHLIB_PATH鐜鍙橀噺鐨凪ySQL瀹㈡埛绔簱銆瀵逛簬闈欐佺増锛屽拷鐣ユ墍鏈夌殑鍏变韩搴撻夐」锛屽苟浣跨敤鈥--disable-shared鈥濋夐」杩愯鈥configure鈥濄
瑕佹兂鍦ˋIX鐜涓嬪垱寤洪┍鍔ㄧ▼搴忥紝鍙娇鐢ㄤ笅杩configure绀轰緥锛
shell> ./configure --prefix=/usr/local
--with-unixodbc=/usr/local
--with-mysql-path=/usr/local/mysql
--disable-shared
--enable-thread-safe
娉ㄩ噴锛 鍏充簬鍦ㄤ笉鍚屽钩鍙颁笂鍒涘缓鍜岃缃潤鎬佸拰鍏变韩搴撴柟寮忕殑鏇村淇℃伅锛岃鍙傝璺ㄥ钩鍙颁娇鐢ㄩ潤鎬佸拰鍏变韩搴銆娉ㄩ噴锛 濡傛灉浣犲鍗忓姪鎴戜滑娴嬭瘯鏂扮殑浠g爜鎰熷叴瓒o紝搴旈槄璇绘湰鑺傜殑鍐呭銆
瑕佹兂鑾峰緱鎴戞柟鐨勬渶鏂板紑鍙戞簮鐮佹爲锛岃锛
1. 鍙傝2.8.3鑺傦紝鈥滀粠寮鍙戞簮鐮佹爲瀹夎鈥锛屽叧浜庡浣曚笅杞藉拰瀹夎BitKeeper鐨勮鏄庛
2. 瀹夎瀹孊itKeeper鍚庯紝棣栧厛杩涘叆鎵撶畻鍦ㄥ叾涓伐浣滅殑鐩綍锛岀劧鍚庯紝濡傛灉鎵撶畻鍏嬮殕MyODBC 3.51鍒嗘敮锛岃浣跨敤璇ュ懡浠わ細
3. shell> bk clone bk://mysql.bkbits.net/myodbc3 myodbc-3.51
鍦ㄥ墠闈㈢殑绀轰緥涓紝婧愮爜鏍戞槸鍦myodbc-3.51/涓缃殑锛屾垨鍦ㄥ綋鍓嶇洰褰曠殑myodbc3/瀛愮洰褰曚笅璁剧疆鐨勶紙榛樿锛夈濡傛灉浣犱綅浜庨槻鐏鍚庯紝鑰屼笖浠呰兘鍚姩HTTP杩炴帴锛屼篃鍙互閫氳繃HTTP浣跨敤BitKeeper銆傚鏋滆姹備娇鐢ㄤ唬鐞嗘湇鍔″櫒锛屽彲绠鍗曞湴璁剧疆鐜鍙橀噺http_proxy锛屼娇涔嬫寚鍚戜唬鐞嗘湇鍔″櫒锛
shell> export http_proxy="http://your.proxy.server:8080/"
鎵ц鍏嬮殕鎿嶄綔鏃讹紝鐢http://鏇挎崲bk://銆渚嬪锛
shell> bk clone http://mysql.bkbits.net/myodbc3 myodbc-3.51
棣栨涓嬭浇婧愮爜鏍戞椂闇瑕佷竴娈垫椂闂达紝鍏蜂綋鎯呭喌鍙栧喅浜庤繛鎺ラ熷害锛岃鑰愬績绛夊欍
4. 瑕佹兂杩愯涓嬩竴缁勫懡浠わ紝闇瑕丟NU autoconf 2.52锛堟垨鏇存柊鐗堟湰锛锛automake 1.4锛libtool 1.4锛屼互鍙m4銆
5. shell> cd myodbc-3.51
6. shell> bk -r edit
7. shell> aclocal; autoheader; autoconf; automake;
8. shell> ./configure # Add your favorite options here
9. shell> make
鍏充簬濡備綍鍒涘缓鐨勬洿澶氫俊鎭紝璇峰弬闃呬綅浜庣浉鍚岀洰褰曚笅鐨INSTALL鏂囦欢銆鍦╓indows骞冲彴涓嬶紝鍒涘缓椹卞姩绋嬪簭鏃讹紝璇蜂娇鐢╓indows Makefiles WIN-Makefile鍜WIN-Makefile_debug锛屾洿澶氫俊鎭紝璇峰弬瑙26.1.6鑺傦紝鈥滃湪Windows骞冲彴涓婁粠婧愮爜鐗堟湰瀹夎MyODBC鈥銆
10.瀹屾垚鍒涘缓鍚庯紝杩愯make install锛屽皢MyODBC 3.51椹卞姩绋嬪簭瀹夎鍒颁綘鐨勭郴缁熶笂銆
11.濡傛灉杩涘叆浜make闃舵锛屼絾骞舵湭缂栬瘧鍒嗗彂鐗堟湰锛岃灏嗗叾閫氭姤缁myodbc@lists.mysql.com銆
12.鍚姩浜bk clone鎿嶄綔鑾峰緱婧愮爜鏍戝悗锛屽簲瀹氭湡杩愯bk pull杩涜鏇存柊銆
13.鍙互浣跨敤鈥bk sccstool鈥濇鏌ユ爲鐨勫彉鏇村彶銆傚鏋滀綘鍙戠幇浜嗘湁瓒g殑宸紓锛屽苟瀵逛唬鐮佸瓨鍦ㄤ竴闂紝璇风珛鍒诲彂閫佺數瀛愰偖浠惰嚦myodbc@lists.mysql.com銆
姝ゅ锛屽鏋滀綘璁や负鏈夋洿濂界殑涓绘剰锛岃鍙戦佺數瀛愰偖浠惰嚦鐩稿悓鐨勫湴鍧骞堕檮涓婅ˉ涓併傛洿鏀逛簡婧愮爜鍚庯紝浣跨敤鈥bk diffs鈥濆彲鐢熸垚琛ヤ竵銆傚鏋滀綘娌℃湁鏃堕棿灏变綘鐨勮鐐圭紪鍐欎唬鐮侊紝鍙彂閫佹弿杩版т俊鎭
14.BitKeeper鍏锋湁涓涓彲閫氳繃bk helptool璁块棶鐨勫府鍔╁伐鍏枫
閫氳繃娴忚http://mysql.bkbits.net:8080/myodbc3锛屼篃鑳藉湪绾挎祻瑙堝彉鍖栭泦銆佹敞閲婂拰婧愪唬鐮併
浜嬪疄涓婏紝鏁版嵁婧愬氨鏄暟鎹殑璺緞銆傚湪涓嶅悓鐨勬儏鍐典笅锛屽畠鍙兘鏈夌潃涓嶅悓鐨勫唴瀹癸紝浣嗘槸鍦ㄥ吀鍨嬫儏鍐典笅锛屽畠鎸囨槑浜嗘鍦ㄨ繍琛岀殑MySQL鏈嶅姟鍣紙渚嬪锛岄氳繃缃戠粶鍦板潃鎴栨湇鍔″櫒鍚嶏級锛岃繛鎺ユ椂璇ユ湇鍔″櫒鐨勯粯璁ゆ暟鎹簱锛屼互鍙婂繀瑕佺殑杩炴帴淇℃伅锛堝绔彛锛夈侻ySQL椹卞姩绋嬪簭锛堜互鍙奧indows绯荤粺涓婄殑ODBC椹卞姩绠$悊鍣級灏嗕娇鐢ㄦ暟鎹簮杩涜杩炴帴銆傚浜庤鐩殑锛屽悕涓篗icrosoft ODBC鏁版嵁婧愮鐞嗗櫒鐨勭鐞嗗伐鍏峰彲鑳藉崄鍒嗘湁鐢ㄣ
鏈変袱澶勫彲鑳戒繚瀛樺垵濮嬪寲淇℃伅鐨勪綅缃細 Windows娉ㄥ唽琛紙Windows绯荤粺锛夛紝鎴朌SN鏂囦欢锛堜换浣曠郴缁燂級銆
濡傛灉淇℃伅浣嶄簬Windows娉ㄥ唽琛ㄤ腑锛屽畠绉颁负鈥滄満鍣ㄦ暟鎹簮鈥濄傚畠鍙互鏄滅敤鎴锋暟鎹簮鈥濓紝鍦ㄨ繖绉嶆儏鍐典笅锛屽彧鏈変竴浣嶇敤鎴疯兘鐪嬪埌瀹冦傚畠涔熷彲浠ユ槸鈥滅郴缁熸暟鎹簮鈥濓紝鍦ㄨ繖绉嶆儏鍐典笅锛岃绠楁満涓婄殑鎵鏈夌敤鎴峰潎鑳借闂畠锛屽鏋滅敤鎴锋槸閫氳繃Microsoft Windows NT鏈嶅姟杩炴帴鍦ㄤ竴璧风殑璇濓紝涓庤璁$畻鏈虹浉杩炵殑鎵鏈夌敤鎴峰潎鑳借闂畠銆傝繍琛孫DBC鏁版嵁绠$悊绋嬪簭鏃讹紝鍙互閫夋嫨鏄惁浣跨敤鈥滅敤鎴封濇垨鈥滅郴缁熲濓紝瀹冧滑浣嶄簬涓嶅悓鐨勯夐」鍗′笂銆
濡傛灉淇℃伅浣嶄簬DSN鏂囦欢涓紝瀹冪О涓衡滄枃浠舵暟鎹簮鈥濄傝繖鏄竴绉嶆枃鏈枃浠躲傚叾浼樼偣鍦ㄤ簬锛 锛坅锛夊畠閫傚悎浜庝换浣曠被鍨嬬殑璁$畻鏈猴紝鑰屼笉浠呬粎鏄娇鐢╓indows鎿嶄綔绯荤粺鐨勮绠楁満锛涳紙b锛夊叾鍐呭鐨勬嫹璐濇垨浼犺緭鐩稿瀹规槗銆
瑕佹兂鍦╓indows骞冲彴涓婃坊鍔犲拰閰嶇疆鏂扮殑MyODBC鏁版嵁婧愶紝璇蜂娇鐢ODBC鏁版嵁婧愮鐞嗗櫒銆侽DBC绠$悊鍣ㄨ兘澶熸洿鏂版暟鎹簮杩炴帴淇℃伅銆娣诲姞浜嗘暟鎹簮鏃讹紝ODBC绠$悊鍣ㄨ兘澶熸洿鏂版敞鍐屼俊鎭
瑕佹兂浠庢帶鍒堕潰鏉挎墦寮ODBC绠$悊鍣細
1. 鐐瑰嚮鈥滃紑濮嬧濓紝灏嗘寚閽堟寚鍚戔滆缃濓紝鐒跺悗鐐瑰嚮鈥滄帶鍒堕潰鏉库濄
2. 鍦ㄨ繍琛孧icrosoft Windows 2000鎴栨洿鏂扮増鏈殑璁$畻鏈轰笂锛屽弻鍑烩滅鐞嗗伐鍏封濓紝鐒跺悗鍙屽嚮鈥滄暟鎹簮鈥濓紙ODBC锛夈傚湪杩愯鏃х増鏈琖indows鐨勮绠楁満涓婏紝鍙屽嚮32浣峅DBC鎴ODBC銆
鎵撳紑ODBC鏁版嵁婧愮鐞嗗櫒瀵硅瘽妗嗭紝濡備笅鍥炬墍绀猴細
鐐瑰嚮鈥滃府鍔┾濅互浜嗚ВODBC鏁版嵁婧愮鐞嗗櫒瀵硅瘽妗嗗悇閫夐」鍗$殑璇︾粏淇℃伅銆
瑕佹兂鍦╓indows骞冲彴涓婃坊鍔犳暟鎹簮锛
1. 鎵撳紑ODBC鏁版嵁婧愮鐞嗗櫒銆
2. 鍦∣DBC鏁版嵁婧愮鐞嗗櫒瀵硅瘽妗嗕腑锛岀偣鍑烩滄坊鍔犫濄傛墦寮鈥滃垱寤烘柊鏁版嵁婧愨濆璇濇銆
3. 閫夋嫨MySQL ODBC 3.51椹卞姩绋嬪簭锛岀劧鍚庣偣鍑鈥瀹屾垚鈥銆鎵撳紑鈥MySQL ODBC 3.51椹卞姩绋嬪簭-DSN閰嶇疆鈥瀵硅瘽妗嗭紝濡備笅鍥炬墍绀猴細
4. 鍦ㄢ滄暟鎹簮鍚嶁濇涓紝杈撳叆鎵撶畻璁块棶鐨勬暟鎹簮鐨勫悕绉般傚畠鍙互鏄綘閫夋嫨鐨勪换浣曟湁鏁堝悕绉般
5. 鍦ㄢ滄弿杩扳濇涓紝杈撳叆DSn鎵闇鐨勬弿杩颁俊鎭
6. 鍦ㄢ滀富鏈衡濇垨鈥滄湇鍔″櫒鍚嶁濓紙鎴朓P锛夋涓紝杈撳叆鍑嗗璁块棶鐨凪ySQL鏈嶅姟鍣ㄤ富鏈虹殑鍚嶇О銆傞粯璁ゆ儏鍐典笅涓localhost锛堟湰鍦颁富鏈猴級銆
7. 鍦ㄢ滄暟鎹簱鍚嶁濇涓紝杈撳叆鍑嗗鐢ㄤ綔榛樿鏁版嵁搴撶殑MySQL鏁版嵁搴撳悕绉般
8. 鍦ㄢ滅敤鎴封濇涓紝杈撳叆浣犵殑MySQL鐢ㄦ埛鍚嶏紙鏁版嵁搴撶敤鎴稩D锛夈
9. 鍦ㄢ滃瘑鐮佲濇涓緭鍏ュ瘑鐮併
10.鍦ㄢ滅鍙b濇涓紝濡傛灉绔彛涓嶆槸榛樿绔彛锛岃緭鍏ョ鍙e彿銆
11.鍦ㄢ淪QL鍛戒护鈥濇涓紝鍙緭鍏ュ缓绔嬭繛鎺ュ悗鑷姩鎵ц鐨凷QL璇彞銆
鏈鍚庯紝瀵硅瘽妗嗕笌涓嬪浘鏄剧ず鐨勭被浼硷細
鐐瑰嚮鈥淥K鈥濇坊鍔犺鏁版嵁婧愩
娉ㄩ噴锛 鐐瑰嚮鈥淥K鈥濆悗锛屽皢鎵撳紑鈥滄暟鎹簮鈥濆璇濇锛孫DBC绠$悊鍣ㄥ皢鏇存柊娉ㄥ唽淇℃伅銆傝繛鎺ュ埌璇ユ暟鎹簮鏃讹紝浣犳墍杈撳叆鐨勭敤鎴峰悕鍜岃繛鎺ュ瓧绗︿覆灏嗘垚涓鸿鏁版嵁婧愮殑榛樿杩炴帴鍊笺
浣犱篃鍙互浣跨敤鈥滄祴璇曟暟鎹簮鈥濇寜閽紝娴嬭瘯浣犵殑璁剧疆鏄惁閫傚悎浜庤繛鎺ュ埌鏈嶅姟鍣ㄣ傝鐗规т粎瀵筂yODBC 3.51椹卞姩绋嬪簭鏈夋晥銆傛垚鍔熷畬鎴愭祴璇曞悗锛屽皢鏄剧ず涓嬭堪绐楀彛锛
濡傛灉娴嬭瘯澶辫触锛屽皢鏄剧ず閿欒娑堟伅銆
DNS閰嶇疆瀵硅瘽妗嗕篃鏈変竴涓滈夐」鈥濇寜閽傚鏋滈夋嫨浜嗗畠锛屽皢鎵撳紑涓嬭堪閫夐」瀵硅瘽妗嗭紝鏄剧ず鎺у埗椹卞姩绋嬪簭鐨勮涓恒傚叧浜庤繖浜涢夐」鐨勫惈涔夛紝璇峰弬瑙26.1.9.4鑺傦紝鈥滆繛鎺ュ弬鏁扳銆
娉ㄩ噴锛 鍦ㄢ滈┍鍔ㄧ▼搴忚窡韪濋夐」涓嬪垪鍑虹殑閫夐」宸茶绂佹锛堢伆鑹诧級锛岄櫎闈炰綘浣跨敤鐨勬槸椹卞姩DLL鐨勮皟璇曠増鏈
瑕佹兂鍦╓indows骞冲彴涓婃洿鏀规暟鎹簮锛
1. 鎵撳紑ODBC鏁版嵁婧愮鐞嗗櫒銆傜偣鍑绘伆褰撶殑閫夐」鍗♀淒SN鈥濄
2. 閫夋嫨鎵撶畻鏇存敼鐨凪ySQL鏁版嵁婧愶紝鐒跺悗鐐瑰嚮鈥滈厤缃濄傛墦寮鈥MySQL ODBC 3.51椹卞姩绋嬪簭-DSN閰嶇疆鈥瀵硅瘽妗嗐
3. 鏇存敼閫傜敤鐨勬暟鎹簮瀛楁锛岀劧鍚庣偣鍑烩淥K鈥濄
鏇存敼瀹岃瀵硅瘽妗嗕腑鐨勪俊鎭悗锛孫DBC绠$悊鍣ㄥ皢鏇存柊娉ㄥ唽淇℃伅銆
鍦Unix骞冲彴涓婏紝鍙互鐩存帴鍦╫dbc.ini鏂囦欢涓厤缃瓺SN鏉$洰銆杩欓噷缁欏嚭浜1涓吀鍨嬬殑odbc.ini鏂囦欢锛屽湪璇ユ枃浠朵腑锛屽垎鍒皢myodbc鍜宮yodbc3閰嶇疆涓MyODBC 2.50鍜孧yODBC 3.51鐨凞SN鍚嶇О锛
;
; odbc.ini瀵筂yODBC鍜孧yODBC 3.51椹卞姩绋嬪簭鐨勯厤缃
; [ODBC Data Sources] myodbc = MyODBC 2.50 Driver DSN myodbc3 = MyODBC 3.51 Driver DSN [myodbc] Driver = /usr/local/lib/libmyodbc.so Description = MyODBC 2.50 Driver DSN SERVER = localhost PORT = USER = root Password = Database = test OPTION = 3 SOCKET = [myodbc3] Driver = /usr/local/lib/libmyodbc3.so Description = MyODBC 3.51 Driver DSN SERVER = localhost PORT = USER = root Password = Database = test OPTION = 3 SOCKET = [Default] Driver = /usr/local/lib/libmyodbc3.so Description = MyODBC 3.51 Driver DSN SERVER = localhost PORT = USER = root Password = Database = test OPTION = 3 SOCKET =
鍏充簬鍙彁渚涜繛鎺ュ弬鏁扮殑娓呭崟锛岃鍙傝26.1.9.4鑺傦紝鈥滆繛鎺ュ弬鏁扳銆
娉ㄩ噴锛 濡傛灉浣犳鍦ㄤ娇鐢╱nixODBC锛屽彲浣跨敤涓嬭堪宸ュ叿璁剧疆DSN锛
路 ODBCConfig GUI tool(HOWTO: ODBCConfig)
路 odbcinst
鍦ㄦ煇浜涙儏鍐典笅浣跨敤unixODBC锛屽彲鑳戒細鍑虹幇涓嬭堪閿欒锛
Data source name not found and no default driver specified锛堟暟鎹簮鍚嶄笉瀛樺湪锛屾湭鎸囧畾榛樿椹卞姩绋嬪簭锛
濡傛灉鍑虹幇璇ユ儏鍐碉紝璇风‘璁ODBCINI鍜ODBCSYSINI鐜鍙橀噺鎸囧悜姝g‘鐨刼dbc.ini鏂囦欢銆備緥濡傦紝濡傛灉浣犵殑odbc.ini鏂囦欢浣嶄簬鐩綍鈥/usr/local/etc鈥涓嬶紝鍙皢鐜鍙橀噺璁句负锛
export ODBCINI=/usr/local/etc/odbc.ini
export ODBCSYSINI=/usr/local/etc
浣犲彲浠ュ湪ODBC.INI鏂囦欢鐨刐Data Source Name]锛堟暟鎹簮鍚嶏級閮ㄥ垎銆佹垨閫氳繃SQLDriverConnect() call鐨InConnectionString鍙傞噺涓篗yODBC鎸囧畾涓嬭堪鍙傛暟銆
鍙傛暟 |
榛樿鍊 |
娉ㄩ噴 |
user |
ODBC (on Windows) |
鐢ㄤ簬閾炬帴鑷矼ySQL鐨勭敤鎴峰悕銆 |
server |
localhost |
MySQL鏈嶅姟鍣ㄧ殑涓绘満鍚嶃 |
database |
|
榛樿鏁版嵁搴撱 |
option |
0 |
鎸囧畾MyODBC宸ヤ綔鏂瑰紡鐨勯夐」銆傚弬瑙佷笅闈€ |
port |
3306 |
濡傛灉鏈嶅姟鍣ㄤ笉鏄湰鍦颁富鏈哄皢瑕佷娇鐢ㄧ殑TCP/IP绔彛銆 |
stmt |
|
杩炴帴鑷矼ySQL鏃跺皢瑕佹墽琛岀殑璇彞銆 |
password |
|
鏈嶅姟鍣ㄤ笂鐢ㄦ埛璐︽埛鐨勫瘑鐮併 |
socket |
|
褰撴湇鍔″櫒鏄湰鍦颁富鏈烘槸灏嗚杩炴帴鐨刄nix濂楁帴瀛楁枃浠舵垨Windows鍛藉悕绠¢亾銆 |
閫夐」鍙傞噺鐢ㄤ簬閫氱煡MyODBC锛氬鎴风涓嶆槸100% ODBC鍏煎鐨勩傚湪Windows骞冲彴涓嬶紝姝e父鎯呭喌涓嬶紝搴旈氳繃鍒囨崲杩炴帴灞忓箷涓婄殑澶嶉夋閫夋嫨閫夐」锛屼絾涔熻兘鍦ㄩ夐」鍙傞噺涓夋嫨瀹冧滑銆備笅杩伴夐」鏄寜鐓у畠浠湪MyODBC杩炴帴灞忓箷涓婃樉绀虹殑椤哄簭鎺掑垪鐨勶細
鍊 |
鎻忚堪 |
1 |
瀹㈡埛绔棤娉曞鐞嗭紝MyODBC杩斿洖鍒楃殑瀹為檯瀹藉害銆 |
2 |
瀹㈡埛绔棤娉曞鐞嗭紝MyODBC杩斿洖鍙楀奖鍝嶈鐨勭湡鍊笺傚鏋滆缃簡璇ユ爣蹇楋紝MySQL灏嗚繑鍥炩滃彂鐜扮殑琛屸濆彇鑰屼唬涔嬨侻ySQL鐨勭増鏈繀椤绘槸3.21.14鎴栨洿楂樼増鏈紝璇ュ姛鑳芥墠鑳界敓鏁堛 |
4 |
鍦c:\myodbc.log涓敓鎴愯皟璇曟棩蹇椼傚畠涓庡皢MYSQL_DEBUG=d:t:O,c::\myodbc.log鏀惧埌AUTOEXEC.BAT涓殑鏁堟灉鐩稿悓锛堝湪Unix骞冲彴涓嬶紝璇ユ枃浠舵槸/tmp/myodbc.log锛夈 |
8 |
涓嶄负缁撴灉鍜屽弬鏁拌缃换浣曚俊鎭姤闄愬埗銆 |
16 |
鍗充娇椹卞姩绋嬪簭鍙兘浼氱粰鍑烘彁绀猴紝瀵瑰嚭鐜扮殑闂涓嶄簣鎻愮ず銆 |
32 |
鍏佽鎴栫姝㈠姩鎬佸厜鏍囨敮鎸併傦紙鍦∕yODBC 2.50涓笉鍏佽锛夈 |
64 |
鍦db_name.tbl_name.col_name涓拷鐣ユ暟鎹簱鍚嶇殑浣跨敤銆 |
128 |
寮哄埗浣跨敤ODBC绠$悊鍣ㄥ厜鏍囷紙瀹為獙鎬э級銆 |
256 |
绂佹浣跨敤鎵╁睍鍙栨暟鎹紙瀹為獙鎬э級銆 |
512 |
灏CHAR鍒楀~鍏呬负鍏ㄥ垪瀹姐 |
1024 |
SQLDescribeCol()杩斿洖瀹屽叏鍚堟牸鐨勫垪鍚嶃 |
2048 |
浣跨敤鍘嬬缉瀹㈡埛绔紡鏈嶅姟鍣ㄥ崗璁 |
4096 |
閫氱煡鏈嶅姟鍣ㄥ拷鐣ュ嚱鏁板悕涔嬪悗鍜屸(鈥濅箣鍓嶇殑绌烘牸锛圥owerBuilder瑕佹眰杩欐牱锛夈傝繖浼氫娇鎵鏈夌殑鍑芥暟鍚嶆垚涓哄叧閿瓧銆 |
8192 |
鐢ㄥ懡鍚嶇閬撻摼鎺ヨ嚦杩愯鍦∟T鐜涓嬬殑mysqld鏈嶅姟鍣ㄣ |
16384 |
灏LONGLONG鍒楁洿鏀逛负INT鍒楋紙鏌愪簺搴旂敤绋嬪簭涓嶈兘澶勭悊LONGLONG鍒楋級銆 |
32768 |
浠SQLTables杩斿洖浣滀负Table_qualifier鍜Table_owner鐨勭敤鎴锛堝疄楠屾э級銆 |
65536 |
浠my.cnf鐨刐client]鍜[odbc]缁勮鍙栧弬鏁般 |
131072 |
澧炲姞涓浜涢澶栨鏌ワ紙涓嶅簲闇瑕佷箣锛屼絾鈥锛夈 |
262144 |
绂佹浜嬪姟銆 |
524288 |
鍏佽灏嗘煡璇㈣褰曞埌c:\myodbc.sql(/tmp/myodbc.sql)鏂囦欢銆傦紙浠呭湪璋冭瘯妯″紡涓嬫墠鑳藉惎鐢級銆 |
1048576 |
涓嶈椹卞姩涓殑缁撴灉杩涜缂撳啿澶勭悊锛岃屽簲浠庢湇鍔″櫒璇诲彇鈥mysql_use_result()鈥濄備粎瀵规鍚戝厜鏍囨墠鑳借捣浣滅敤銆傚綋浣犱笉甯屾湜缂撳啿澶勭悊鏁翠釜缁撴灉闆嗘椂锛屽浜庡ぇ琛ㄥ鐞嗭紝璇ラ夐」鍗佸垎閲嶈銆 |
2097152 |
寮哄埗浣跨敤姝e悜鍏夋爣绫诲瀷銆傚湪搴旂敤绋嬪簭璁剧疆浜嗛粯璁ら潤鎬侊紡鍔ㄦ佸厜鏍囩被鍨嬬殑鎯呭喌涓嬶紝濡傛灉甯屾湜椹卞姩绋嬪簭浣跨敤闈炵紦鍐茬粨鏋滈泦锛岄偅涔堣閫夐」鑳藉淇濊瘉姝e悜鍏夋爣鐨勮涓恒 |
瑕佹兂閫夋嫨澶氫釜閫夐」锛屽彲灏嗗畠浠殑鍊煎姞鍦ㄤ竴璧枫備緥濡傦紝灏嗛夐」璁剧疆涓12锛4锛8锛夛紝灏辫兘鑾峰緱璋冭瘯鍔熻兘锛屼絾娌℃湁淇℃伅鍖呴檺鍒躲
榛樿鐨myodbc3.dll鏄负浼樺寲鎬ц兘鑰岀紪璇戠殑銆濡傛灉甯屾湜璋冭瘯MyODBC 3.51锛堜緥濡傦紝鍚敤璺熻釜鍔熻兘锛夛紝搴斾娇鐢myodbc3d.dll銆傝鎯冲畨瑁呰鏂囦欢锛岃鎷疯礉myodbc3d.dll锛屼娇涔嬭鐩栧凡瀹夎鐨刴yodbc3.dll鏂囦欢銆涓鏃﹀畬鎴愪簡璋冭瘯鎿嶄綔锛屽姟蹇呮仮澶嶈嚦椹卞姩DLL鐨勫彂甯冪増鏈紝杩欐槸鍥犱负璋冭瘯鐗堟湰鍙兘浼氬鑷存ц兘闂銆傛敞鎰忥紝鍦∕yODBC 3.51.07鑷3.51.11涓湭鍖呭惈myodbc3d.dll銆濡傛灉浣犳鍦ㄤ娇鐢ㄨ繖浜涚増鏈腑鐨勪竴涓紝搴斾粠涔嬪墠鐨勭増鏈紙渚嬪3.51.06锛夋嫹璐濊DLL鏂囦欢銆
瀵逛簬MyODBC 2.50锛岄噰鐢ㄤ簡myodbc.dll鍜宮yodbcd.dll鍙栬屼唬涔嬨
鍦ㄤ笅闈㈢殑琛ㄥ悇涓紝缁欏嚭浜嗛拡瀵瑰悇绉嶉厤缃殑鎺ㄨ崘閫夐」鍊硷細
閰嶇疆 |
閫夐」鍊 |
Microsoft Access |
3 |
Microsoft Visual Basic |
3 |
鍏锋湁寰堝琛岀殑澶ц〃 |
2049 |
椹卞姩璺熻釜鐢熸垚锛堣皟璇曟ā寮忥級 |
4 |
鏌ヨ鏃ュ織鐢熸垚锛堣皟璇曟ā寮忥級 |
524288 |
鐢熸垚椹卞姩璺熻釜鍜屾煡璇㈡棩蹇楋紙璋冭瘯妯″紡锛 |
524292 |
鍏锋湁闈炵紦鍐茬粨鏋滅殑澶ц〃 |
3145731 |
鏄傞氳繃鎸囧畾DRIVER鍚嶇О瀛楁锛屽彲浣跨敤SQLDriverConnect杩炴帴鍒癕ySQL鏈嶅姟鍣ㄣ備笅闈㈢粰鍑轰簡浣跨敤DSN-Less杩炴帴鐨凪yODBC杩炴帴瀛楃涓诧細
瀵逛簬MyODBC 2.50锛
ConnectionString = "DRIVER={MySQL};\
SERVER=localhost;\
DATABASE=test;\
USER=venu;\
PASSWORD=venu;\
OPTION=3;"
瀵逛簬MyODBC 3.51锛
ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};\
SERVER=localhost;\
DATABASE=test;\
USER=venu;\
PASSWORD=venu;\
OPTION=3;"
濡傛灉浣犱娇鐢ㄧ殑缂栫▼璇█浼氬皢鍚庤窡绌烘牸鐨勫弽鏂滄潬杞崲涓虹┖鏍硷紝鏈濂藉皢杩炴帴瀛楃涓叉寚瀹氫负鍗曚釜闀垮瓧绗︿覆锛屾垨浣跨敤涓嶄細鍦ㄥ叾涓坊鍔犵┖鏍肩殑澶氫釜瀛楃涓蹭覆鎺ャ備緥濡傦細
ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};"
"SERVER=localhost;"
"DATABASE=test;"
"USER=venu;"
"PASSWORD=venu;"
"OPTION=3;"
鍏充簬鍙彁渚涜繛鎺ュ弬鏁扮殑娓呭崟锛岃鍙傝26.1.9.4鑺傦紝鈥滆繛鎺ュ弬鏁扳銆
濡傛灉浣犳墦绠椾娇鐢myuser鍜mypassword浣滀负鐢ㄦ埛鍚嶅拰瀵嗙爜浠庣郴缁烞杩炴帴鍒扮郴缁烝锛屽彲鍙傝冧笅闈㈢粰鍑虹殑绠鍗曟楠ゃ
鍦ㄧ郴缁烝涓婏紝鎵ц涓嬭堪姝ラ锛
1. 鍚姩MySQL鏈嶅姟鍣ㄣ
2. 浣跨敤GRANT寤虹珛鐢ㄦ埛鍚嶄负myuser鐨勮处鎴凤紝璇ヨ处鎴峰彲浣跨敤瀵嗙爜myuser浠庣郴缁烞寤虹珛杩炴帴銆
3. GRANT ALL ON *.* to 'myuser'@'B' IDENTIFIED BY 'mypassword';
4. GRANT璇彞涓虹敤鎴穖yuser鎺堜簣浜嗕娇鐢ㄥ瘑鐮乵ypassword浠庣郴缁烞杩涜杩炴帴鐨勬墍鏈夋潈闄愩瑕佹兂鎵ц璇ヨ鍙ワ紝蹇呴』鍦ㄧ郴缁烝涓婃嫢鏈夋牴鐢ㄦ埛鏉冮檺锛屾垨鏄叿鏈夋伆褰撴潈闄愮殑鍙︿竴鐢ㄦ埛銆傚叧浜嶮ySQL鏉冮檺鐨勬洿澶氫俊鎭紝璇峰弬瑙5.8鑺傦紝鈥淢ySQL鐢ㄦ埛璐︽埛绠$悊鈥銆
鍦ㄧ郴缁烞涓婏紝鎵ц涓嬭堪姝ラ锛
1. 浣跨敤涓嬭堪杩炴帴鍙傛暟閰嶇疆MyODBC DSN锛
2. DSN = remote_test
3. SERVER or HOST = A (or IP address of system A)
4. DATABASE = test (The default database or an appropriate one)
5. USER = myuser
6. PASSWORD = mypassword
鍏充簬寤虹珛DSN-less杩炴帴鐨勬洿澶氫俊鎭紝璇峰弬瑙26.1.9.5鑺傦紝鈥滄病鏈夐瀹氫箟DSN涓嬬殑杩炴帴鈥銆
7. 浣跨敤Ping鍛戒护鎴栧叾瀹冩柟寮忔鏌ユ槸鍚﹁兘浠庣郴缁烞璁块棶绯荤粺A銆傚鏋滄棤娉曡闂郴缁烝锛岃妫鏌ョ綉缁滄垨Internet杩炴帴锛屾垨涓庝綘鐨勭郴缁熺鐞嗗憳鑱旂郴銆
8. 灏濊瘯浣跨敤DSN=remote_test杩涜杩炴帴銆傚鏋滃け璐ワ紝璇疯窡韪煡璇yODBC鏃ュ織锛屽苟鏍规嵁鏃ュ織缁欏嚭鐨勯敊璇俊鎭噰鍙栬繘涓姝ョ殑姝ラ銆傚鏋滈渶瑕佽繘涓姝ュ府鍔╋紝璇峰彂閫佽缁嗙殑鐢靛瓙閭欢鑷myodbc@lists.mysql.com銆
鍦ㄤ笅杩扮珯鐐癸紝浣犲彲浠ユ壘鍒板叧浜庡浣曞畬鎴愯鎿嶄綔鐨勭畝鍗曠ず渚嬶細http://www.phphelp.com/tutorial/using-myodbc-to-connect-to-a-remote-database.html.
濡傛灉閬囧埌涓嶮yODBC鏈夊叧鐨勫洶闅炬垨闂锛岄鍏堝簲浣跨敤ODBC绠$悊鍣ㄥ拰MyODBC鐢熸垚涓浠芥棩蹇楁枃浠锛堣姹傛潵鑷狾DBC ADMIN鐨勬棩蹇楁椂鑾峰緱鐨勬棩蹇楁枃浠讹級銆
瑕佹兂閫氳繃椹卞姩绠$悊鍣ㄨ幏寰桹DBC璺熻釜鏂囦欢锛屽彲閲囧彇涓嬭堪姝ラ锛
路 鎵撳紑ODBC鏁版嵁婧愮鐞嗗櫒锛
1. 鐐瑰嚮鈥滃紑濮嬧濓紝灏嗘寚閽堟寚鍚戔滆缃濓紝鐒跺悗鐐瑰嚮鈥滄帶鍒堕潰鏉库濄
2. 鍦ㄨ繍琛孧icrosoft Windows 2000銆乆P鎴2003鐨勮绠楁満涓婏紝鍙屽嚮鈥滅鐞嗗伐鍏封濓紝鐒跺悗鍙屽嚮鈥滄暟鎹簮鈥濓紙ODBC锛夛紝濡備笅鍥炬墍绀恒
鍦ㄨ繍琛屾棭鏈烳icrosoft Windows鐗堟湰鐨勮绠楁満涓婏紝鍙屽嚮鈥滄帶鍒堕潰鏉库濅腑鐨32浣ODBC鎴朞DBC銆
3. 鎵撳紑ODBC鏁版嵁婧愮鐞嗗櫒瀵硅瘽妗嗭紝濡備笅鍥炬墍绀猴細
4. 鐐瑰嚮鈥滃府鍔┾濅互浜嗚ВODBC鏁版嵁婧愮鐞嗗櫒瀵硅瘽妗嗗悇閫夐」鍗$殑璇︾粏淇℃伅銆
路 鍚敤璺熻釜閫夐」 瀵逛簬Windows鍜孶nix骞冲彴锛岃姝ラ涓嶅悓銆
瑕佹兂鍦╓indows骞冲彴涓婂惎鐢ㄨ窡韪夐」锛
1. 閫氳繃鈥淥DBC鏁版嵁婧愮鐞嗗櫒鈥濆璇濇鐨勨滆窡韪濋夐」鍗★紝鍙璺熻釜ODBC鍑芥暟鐨勬柟寮忚繘琛岄厤缃
2. 浠庘滆窡韪濋夐」鍗℃縺娲讳簡璺熻釜鍔熻兘鍚庯紝椹卞姩绠$悊鍣ㄤ細瀵瑰悗缁繍琛岀殑鎵鏈夊簲鐢ㄧ▼搴忕殑ODBC鍑芥暟璋冪敤杩涜璺熻釜銆
3. 婵娲昏窡韪姛鑳藉墠鎵杩愯搴旂敤绋嬪簭鐨凮DBC鍑芥暟璋冪敤涓嶄細琚褰曘侽DBC鍑芥暟璋冪敤灏嗚璁板綍鍦ㄤ綘鎸囧畾鐨勬棩蹇楁枃浠朵腑銆
4. 鐐瑰嚮鈥滅幇鍦ㄥ仠姝㈣窡韪濆悗锛岃窡韪姛鑳藉皢鍋滄銆傝璁颁綇锛屽惎鍔ㄨ窡韪姛鑳藉悗锛屾棩蹇楁枃浠跺皢涓嶆柇澧炲ぇ锛岃屼笖璺熻釜鍔熻兘浼氬奖鍝嶆墍鏈塐DBC搴旂敤绋嬪簭鐨勬ц兘銆
瑕佹兂鍦║nix骞冲彴涓婂惎鐢ㄨ窡韪夐」锛
5. 鍦║nix骞冲彴涓婏紝闇瑕佸湪ODBC.INI鏂囦欢涓槑纭缃窡韪夐」銆
浣跨敤TraceFile鍜宱dbc.ini涓殑Trace锛堣窡韪級鍙傛暟鎵撳紑鎴栧叧闂窡韪姛鑳斤紝濡備笅鎵绀猴細
TraceFile = /tmp/odbc.trace
Trace = 1
TraceFile鎸囨槑浜嗚窡韪枃浠剁殑鍚嶇О鍜屽畬鏁磋矾寰勶紝灏Trace锛堣窡韪級璁句负ON鎴OFF銆備篃鍙互浣跨敤鈥1鈥濇垨鈥淵es鈥濊〃绀篛N锛屼互鍙娾0鈥濇垨鈥淣o鈥濊〃绀篛FF銆傚鏋滄鍦ㄤ娇鐢unixODBC鐨ODBCConfig锛岀劧鍚庨伒鐓HOWTO-ODBCConfig涓粙缁嶇殑鍏充簬璺熻釜unixODBC璋冪敤鐨勬寚绀鸿鏄庛
瑕佹兂鐢熸垚MyODBC鏃ュ織锛屽彲閲囧彇涓嬭堪姝ラ锛
6. 纭繚浣犳墍浣跨敤鐨勬槸椹卞姩绋嬪簭璋冭瘯DLL锛堝浜嶮yODBC 3.51锛屽畠鏄myodbc3d.dll鑰屼笉鏄痬yodbc3.dll锛屽浜MyODBC 2.50锛屽畠鏄myodbcd.dll锛夈
鏈绠鍗曠殑鏂规硶鏄粠MyODBC 3.51鍒嗗彂鐗堟壘鍒myodbc3d.dll锛堟垨myodbcd.dll锛夛紝骞剁敤鍏惰鐩myodbc3.dll锛堟垨myodbc.dll锛夛紝璇ユ枃浠堕氬父浣嶄簬C:\windows\system32鎴C:\winnt\system32鐩綍涓嬨娉ㄦ剰锛屽畬鎴愭祴璇曞悗锛屼綘鎴栬甯屾湜鎭㈠鏃х殑myodbc.dll鏂囦欢锛岃繖鏄洜涓哄畠姣攎yodbc3d.dll锛堟垨myodbcd.dll锛夊揩寰堝锛屽洜姝わ紝璇蜂繚瀛樺師濮婦LL鐨勫浠姐
7. 鍦ㄢ淢yODBC杩炴帴锛忛厤缃濆睆骞曚笂鍚敤鈥滆窡韪MyODBC鈥濋夐」銆傛棩蹇楀皢琚啓鍏ユ枃浠C:\myodbc.log銆傚綋浣犺繑鍥炰笂杩板睆骞曟椂锛屽鏋滀綘璁剧疆鐨勮窡韪夐」鏈璁颁綇锛岃〃鏄庝綘姝e湪浣跨敤鐨勬槸myodbcd.dll椹卞姩锛堝弬瑙佸墠闈㈢殑浠嬬粛锛夈鍦↙inux骞冲彴涓婏紝鎴栦綘浣跨敤鐨勬槸DSN-Less杩炴帴锛岄渶鍦ㄨ繛鎺ュ瓧绗︿覆涓彁渚涒OPTION=4鈥銆
8. 鍚姩搴旂敤绋嬪簭锛屽苟灏濊瘯鐫浣垮叾鍑虹幇闂銆傜劧鍚庢鏌yODBC璺熻釜鏂囦欢锛屾壘鍑哄彲鑳藉嚭閿欑殑鍦版柟銆
濡傛灉鍙戠幇鏌愪簺浜嬮」鍑洪敊锛岃鍙戦佺數瀛愰偖浠惰嚦myodbc@lists.mysql.com锛堟垨support@mysql.com锛屽鏋滄湁涓MySQL AB绛捐鐨勬敮鎸佸悎鍚岋級锛岀畝瑕佹弿杩板嚭鐜扮殑闂锛屽苟鎻愪緵涓嬭堪棰濆淇℃伅锛
o MyODBC鐗堟湰
o ODBC椹卞姩绠$悊鍣ㄧ殑绫诲瀷鍜岀増鏈
o MySQL鏈嶅姟鍣ㄧ殑鐗堟湰
o 椹卞姩绠$悊鍣ㄧ殑ODBC璺熻釜
o 鏉ヨ嚜MyODBC椹卞姩鐨凪yODBC鏃ュ織鏂囦欢
o 绠鍗曠殑鍙鍒剁ず渚
璇疯浣忥紝浣犳彁渚涚粰鎴戜滑鐨勪俊鎭秺澶氾紝鎴戜滑鏇存闂鐨勬満浼氬氨瓒婂ぇ銆
姝ゅ锛屽湪鎻愪緵缂洪櫡淇℃伅鍓嶏紝璇锋鏌yODBC閭欢鍒楄〃锛http://lists.mysql.com/锛夈
浣跨敤涓嬭堪搴旂敤绋嬪簭娴嬭瘯浜哅yODBC锛
MS Access 95, 97, 2000, and 2002
C++-Builder, Borland Builder 4
Centura Team Developer (formerly Gupta SQL/Windows)
ColdFusion (on Solaris and NT with service pack 5), How-to: MySQL and Coldfusion. Troubleshooting Data Sources and Database Connectivity for UnixPlatforms.
Crystal Reports
DataJunction
Delphi
ERwin
MS Excel
iHTML
FileMaker Pro
FoxPro
Notes 4.5/4.6
MS Visio Enterprise 2000
Vision
Visual Objects
Visual Interdev
SBSS
Perl DBD-ODBC
Paradox
Powerbuilder
Powerdesigner 32-bit
MS Visual C++
Visual Basic
ODBC.NET through CSharp(C#), VB and C++
Data Architect(http://thekompany.com/products/dataarchitect/)
SQLExpress for Xbase++(http://www.SQLExpress.net)
Open Office (http://www.openoffice.org) How-to: MySQL + OpenOffice. How-to: OpenOffice + MyODBC + unixODBC.
Star Office (http://wwws.sun.com/software/star/staroffice/6.0/index.html)
G2-ODBC bridge (http://www.gensym.com)
Sambar Server (http://www.sambarserver.info) How-to: MyODBC + SambarServer + MySQL.
濡傛灉浣犵煡閬撹兘澶熶笌MyODBC涓璧峰伐浣滅殑鍏朵粬搴旂敤绋嬪簭锛岃浠ョ數瀛愰偖浠剁殑鏂瑰紡鎸囨槑瀹冿細myodbc@lists.mysql.com銆
澶у鏁扮▼搴忓潎鑳戒笌MyODBC涓璧峰伐浣滐紝瀵逛笂闈㈡墍鍒楃殑姣忎竴绋嬪簭锛屾垜浠嚜宸辫繘琛屼簡娴嬭瘯锛屾垨寰楀埌鐢ㄦ埛鐨勭‘璁ゃ傚緢澶氫粙缁嶄腑鍧囩粰鍑轰簡浣犲彲鑳戒細閬囧埌闂鐨勬弿杩般
路 绋嬪簭
娉ㄩ噴
瑕佹兂浣緼ccess宸ヤ綔锛
o 濡傛灉浣犳鍦ㄤ娇鐢ˋccess 2000锛屽簲浠庝笅杩板湴鍧鑾峰彇骞跺畨瑁呮渶鏂扮殑锛2.6鐗堟垨鏇撮珮锛塎icrosoft MDAC锛Microsoft鏁版嵁璁块棶缁勪欢锛夛紝http://www.microsoft.com/data/銆傚畠鏇存浜咥ccess鍦ㄥ皢鏁版嵁瀵煎嚭鑷矼ySQL鏃跺瓨鍦ㄧ殑涓涓己闄凤紝鏈寚瀹氳〃鍚嶅拰鍒楀悕銆傚彟涓绉嶈В鍐宠缂洪櫡鐨勬柟娉曟槸锛屽崌绾у埌MyODBC 2.50.33鍜孧ySQL 3.23.x, 瀹冧滑鍏卞悓鎻愪緵浜嗛伩鍏嶈闂鐨勪竴绉嶆柟寮忋
姝ゅ锛屼綘杩樺簲鑾峰彇骞跺簲鐢∕icrosoft Jet 4.0 Service Pack 5 (SP5)锛屽彲鍦ㄤ笅杩板湴鍧鎵惧埌瀹冿細http://support.microsoft.com/default.aspx?scid=kb;EN-US;q239114銆傚畠淇浜嗘煇浜涙儏鍐典笅鍦ˋccess涓垪琚爣娉ㄤ负鈥#DELETED#鈥鐨勯棶棰樸
娉ㄩ噴锛 濡傛灉浣犳浣跨敤MySQL 3.22锛屽繀椤诲畨瑁匨DAC琛ヤ竵锛屽苟浣跨敤MyODBC 2.50.32鎴2.50.34鎴栨洿楂樼増鏈互瑙e喅璇ラ棶棰樸
o 瀵逛簬鎵鏈夌増鏈殑Access锛屽簲鍚敤鈥淢yODBC杩斿洖鍖归厤琛屸濋夐」銆傚浜嶢ccess 2.0锛岃繕搴旈澶栧惎鐢ㄢ妯℃嫙ODBC 1.0鈥閫夐」銆
o 鍦ㄥ笇鏈涜兘澶熸洿鏂扮殑鎵鏈夎〃涓紝鍧囧簲鏈夋椂闂存埑銆備负浜嗚幏寰楁渶澶х殑鍙Щ妞嶆э紝鍦ㄥ垪澹版槑涓笉瑕佷娇鐢ㄩ暱搴﹁鑼冦備篃灏辨槸璇达紝搴斾娇鐢TIMESTAMP锛岃屼笉鏄疶IMESTAMP(n), n < 14銆
o 鍦ㄨ〃涓簲鏈1涓富閿傚涓嶇劧锛屾柊鐨勬垨鏇存柊鐨勮鍙兘浼氭樉绀轰负鈥#DELETED#鈥濄
o 浠呭簲浣跨敤DOUBLE娴偣瀛楁銆涓庡崟绮惧害娴偣杩涜姣旇緝鏃讹紝Access灏嗗け璐ャ傚叾寰佸厗鏄柊鐨勬垨鏇存柊鐨勮鍙兘浼氭樉绀轰负鈥#DELETED#鈥濓紝鎴栨棤娉曟壘鍒版垨鏇存柊琛屻
o 濡傛灉浣犳浣跨敤MyODBC鏉ラ摼鎺ュ埌鏈塀IGINT鍒楃殑琛紝缁撴灉浼氭樉绀轰负鈥#DELETED鈥濄傛帓闄ゅ畠鐨勮В鍐虫柟妗堟槸锛
搂 鏈1涓互TIMESTAMP浣滀负鏁版嵁绫诲瀷鐨勮櫄鎷熷垪銆
搂 鍦ㄢ淥DBC DSN绠$悊鍣ㄢ濈殑杩炴帴瀵硅瘽妗嗕腑閫夋嫨鈥滃皢BIGINT鍒楁洿鏀逛负INT鈥濋夐」銆
搂 鍒犻櫎涓嶢ccess鐨勮〃閾炬帴锛屽苟閲嶆柊鍒涘缓瀹冦
鏃ц褰曚粛灏嗘樉绀轰负鈥#DELETED#鈥濓紝浣嗘柊澧烇紡鏇存柊鐨勮褰曚細鎭板綋鏄剧ず銆
o 娣诲姞浜員IMESTAMP鍒楀悗锛屽彟涓浣嶇敤鎴锋洿鏀逛簡鏁版嵁锛屽鏋滈敊璇緷鏃у嚭鐜帮紝涓嬭堪鎶宸ф垨璁告湁鎵甯姪锛
涓嶈浣跨敤琛ㄦ暟鎹〃瑙嗗浘銆傚彇鑰屼唬涔嬬殑鏄紝浠庝綘甯屾湜浣跨敤鐨勮〃鍒涘缓涓涓〃鍗曪紝骞朵娇鐢ㄨ〃鍗曟暟鎹〃瑙嗗浘銆傚簲灏TIMESTAM鍒楃殑DefaultValue灞炴ц缃负NOW()銆傚湪瑙嗗浘涓殣钘TIMESTAMP鍒楁垨璁告槸涓ソ涓绘剰锛岃繖鏍峰氨涓嶄細浣夸綘鐨勭敤鎴锋劅鍒拌糠鎯戙
o 鍦ㄦ煇浜涙儏鍐典笅锛孉ccess鍙兘浼氱敓鎴怣ySQL鏃犳硶鐞嗚В鐨凷QL璇彞銆傚彲閫氳繃鍦ˋccess鑿滃崟涓夋嫨鈥Query|SQLSpecific|Pass-Through鈥濇潵鏇存璇ラ棶棰樸
o 鍦∟T骞冲彴涓婏紝Access浼氬皢BLOB鍒楅氭姤涓OLE OBJECTS锛圤LE瀵硅薄锛夈濡傛灉浣犳墦绠楃敤MEMO鍒楀彇鑰屼唬涔嬶紝搴斾娇鐢ˋLTER TABLE灏咮LOB鍒楁洿鏀逛负TEXT銆
o Access鏃犳硶鍦ㄤ换浣曟椂鍊欏潎鎭板綋澶勭悊DATE鍒椼濡傛灉閬囧埌杩欑被闂锛岃灏嗗垪鏇存敼涓DATETIME銆
o 濡傛灉鍦ˋccess涓瓨鍦ㄥ畾涔変负BYTE鐨勫垪锛Access浼氳鍥惧皢鍏跺鍑轰负TINYINT鑰屼笉鏄疶INYINT UNSIGNED銆傚鏋滃垪涓殑鍊煎ぇ浜127锛屽皢鍑虹幇闂銆
浣跨敤ADO API鍜孧yODBC杩涜缂栫爜鏃讹紝闇瑕佹敞鎰忔煇浜涗笉琚玀ySQL鏈嶅姟鍣ㄦ敮鎸佺殑榛樿灞炴с備緥濡傦紝瀵逛簬RecordCount灞炴э紝濡傛灉灏咰ursorLocation灞炴х敤浣渁dUseServer锛屽皢杩斿洖缁撴灉鈥-1鈥銆瑕佹兂鑾峰緱姝g‘鐨勫硷紝闇瑕佸皢璇ュ睘鎬ц缃负adUseClient锛屽涓嬮潰缁欏嚭鐨刅B浠g爜绀轰緥鎵绀猴細
Dim myconn As New ADODB.Connection
Dim myrs As New Recordset
Dim mySQL As String
Dim myrows As Long
myconn.Open "DSN=MyODBCsample"
mySQL = "SELECT * from user"
myrs.Source = mySQL
Set myrs.ActiveConnection = myconn
myrs.CursorLocation = adUseClient
myrs.Open
myrows = myrs.RecordCount
myrs.Close
myconn.Close
鍙︿竴绉嶅鐞嗘柟寮忔槸锛屽绫讳技鏌ヨ浣跨敤SELECT COUNT(*)璇彞浠ヨ幏鍙栨纭殑琛岃鏁般
路 涓诲姩鏈嶅姟鍣ㄩ〉锛圓SP锛
搴旈夋嫨鈥滆繑鍥炲尮閰嶈鈥濋夐」銆
路 BDE搴旂敤绋嬪簭
瑕佹兂浣胯繖绫诲簲鐢ㄧ▼搴忓伐浣滐紝搴旈夋嫨鈥滀笉浼樺寲鍒楀搴﹀苟杩斿洖鍖归厤琛屸濋夐」銆
寮濮嬫煡璇㈡椂锛屽彲浣跨敤Active灞炴ф垨Open鏂规硶銆娉ㄦ剰锛Active灏嗛氳繃鑷姩鍙戝嚭鈥SELECT * FROM ...鈥鏌ヨ寮濮嬨濡傛灉琛ㄥ緢澶э紝杩欎笉鏄粈涔堝ソ浜嬨
涓嬭堪淇℃伅鍙栬嚜ColdFusion鏂囨。锛
浣跨敤涓嬭堪淇℃伅鏉ラ厤缃敤浜嶭inux鐨凜oldFusion鏈嶅姟鍣紝浠ヤ究浣跨敤閽堝MySQL鏁版嵁婧愮殑unixODBC椹卞姩鍜孧yODBC銆侫llaire宸茶瘉鏄庯紝MyODBC 2.50.26鑳藉涓嶮ySQL 3.22.27浠ュ強鐢ㄤ簬Linux鐨凜oldFusion涓璧峰伐浣溿傦紙浠讳綍杈冩柊鐨勭増鏈篃搴旇兘姝g‘宸ヤ綔锛夈備綘鍙互鍦ㄧ綉绔http://dev.mysql.com/downloads/connector/odbc/涓婁笅杞組yODBC銆
閫氳繃ColdFusion 4.5.1鐗堬紝鍙互浣跨敤鈥淐oldFusion绠$悊鍣ㄢ濇潵娣诲姞MySQL鏁版嵁婧愩備絾鏄紝椹卞姩绋嬪簭鏈寘鍚湪ColdFusion 4.5.1鐗堜腑銆傚湪MySQL椹卞姩绋嬪簭鍑虹幇鍦∣DBC鏁版嵁婧愪笅鎷夊垪琛ㄤ箣鍓嶏紝蹇呴』鍒涘缓MyODBC椹卞姩绋嬪簭锛屽苟灏嗗叾鎷疯礉鍒/opt/coldfusion/lib/libmyodbc.so銆
鍦–ontrib鐩綍涓嬪寘鍚▼搴mydsn-xxx.zip锛屼娇鐢ㄥ畠锛屽浜Coldfusion搴旂敤绋嬪簭锛屽彲鍒涘缓骞跺垹闄ょ敤浜嶮yODBC椹卞姩鐨凞SN娉ㄥ唽鏂囦欢銆
搴斿鍏惰繘琛屾洿鏀癸紝浣夸箣杈撳嚭VARCHAR鑰屼笉鏄疎NUM锛屽洜涓哄叾瀵煎嚭ENUM鐨勬柟寮忎細閫犳垚MySQL闂銆
宸ヤ綔銆備竴浜涙彁绀猴細
o 濡傛灉閬囧埌鏃ユ湡鏂归潰鐨勯棶棰橈紝璇蜂娇鐢CONCAT()鍑芥暟锛屽皢鍏堕夋嫨涓哄瓧绗︿覆銆渚嬪锛
o SELECT CONCAT(rise_time), CONCAT(set_time)
o FROM sunrise_sunset;
閲囩敤璇ユ柟寮忎互瀛楃涓叉彁鍙栫殑鍊煎簲鑳借Excel97姝g‘璇嗗埆涓烘椂闂村笺
鍦ㄦ湰渚嬩腑锛CONCAT()鐨勭洰鐨勬槸璁㎡DBC璁や负鍒楁槸鈥瀛楃涓茬被鍨鈥銆濡傛灉娌℃湁CONCAT()锛孫DBC浼氬皢鍒楄涓烘椂闂寸被鍨嬶紝Excel鏃犳硶鐞嗚В瀹冦
娉ㄦ剰锛孍xcel瀛樺湪1涓己闄凤紝杩欐槸鍥犱负瀹冧細鑷姩灏嗗瓧绗︿覆杞崲涓烘椂闂淬傚鏋滄簮鏄枃鏈枃浠讹紝涓嶅瓨鍦ㄩ棶棰橈紝浣嗗綋婧愭槸閫氭姤鍚勫垪鍑嗙‘绫诲瀷鐨凮DBC杩炴帴鏃讹紝灏嗗嚭鐜伴棶棰樸
瑕佹兂灏嗘暟鎹粠MySQL鎻愬彇鍒癢ord/Excel鏂囨。锛岄渶瑕佷娇鐢∕yODBC椹卞姩绋嬪簭浠ュ強鈥淢icrosoft鏌ヨ甯姪鈥濇彃浠躲
渚嬪锛岀敤鍚湁涓ゅ垪鏂囨湰鐨勮〃鍒涘缓1涓暟鎹簱锛
o 浣跨敤mysql瀹㈡埛绔鍛戒护琛屽伐鍏锋彃鍏ヨ銆
o 浣跨敤ODBC绠$悊鍣ㄥ垱寤1涓狣SN鏂囦欢锛屼緥濡傦紝閽堝鍒氬垱寤烘暟鎹簱鐨勨渕y鈥濄
o 鎵撳紑Word搴旂敤绋嬪簭銆
o 鍒涘缓1涓柊鐨勭┖鐧芥枃妗c
o 鍦ㄦ暟鎹簱宸ュ叿鏍忎笂锛屾寜鈥滄彃鍏ユ暟鎹簱鈥濇寜閽
o 鎸夆滆幏鍙栨暟鎹濇寜閽
o 鍦ㄢ滆幏鍙栨暟鎹濆睆骞曞彸渚э紝鎸夆Ms Query鈥濇寜閽
o 鍦ㄢMs Query鈥濅腑浣跨敤鈥my DSN鈥濇枃浠跺垱寤1涓柊鏁版嵁婧愩
o 閫夋嫨鏂版煡璇€
o 閫夋嫨鎵撶畻浣跨敤鐨勫垪銆
o 濡傛灉鎰挎剰锛屽垱寤1涓繃婊ゅ櫒銆
o 濡傛灉鎰挎剰锛屽垱寤1涓垎绫汇
o 閫夋嫨鈥滃皢鏁版嵁杩斿洖鍒Microsoft Word鈥濄
o 鐐瑰嚮鈥滃畬鎴愨濄
o 鐐瑰嚮鈥滄彃鍏ユ暟鎹濆苟閫夋嫨璁板綍銆
o 鐐瑰嚮OK锛屽湪浣犵殑Word鏂囨。涓皢鐪嬪埌鎻掑叆鐨勮銆
ODBC鐨勬祴璇曠▼搴忋
蹇呴』浣跨敤BDE 3.2鐗堟垨鏇存柊鐨勭増鏈傝繛鎺ュ埌MySQL鏃讹紝閫夋嫨鈥滀笉浼樺寲鍒楀搴︹濋夐」銆
姝ゅ锛岃繖閲岀粰鍑轰簡涓浜涘彲鑳芥湁鐢ㄧ殑Delphi浠g爜锛岃繖浜涗唬鐮佸彲璁剧疆涓篗yODBC璁剧疆ODBC鏉$洰鍜孊DE鏉$洰銆侭DE鏉$洰瑕佹眰鐢ㄥ埌鈥淏DE鍒悕缂栬緫鍣ㄢ濓紝瀹冧綅浜庨潬杩戜綘鐨勨淒elphi Super Page鈥濅笂锛屽彲鑷敱鎷栧姩銆傦紙涓嬭堪鍐呭鐢盉ryan Brunton <bryan@flesherfab.com>鎻愪緵锛夛細
fReg:= TRegistry.Create;
fReg.OpenKey('\Software\ODBC\ODBC.INI\DocumentsFab', True);
fReg.WriteString('Database', 'Documents');
fReg.WriteString('Description', ' ');
fReg.WriteString('Driver', 'C:\WINNT\System32\myodbc.dll');
fReg.WriteString('Flag', '1');
fReg.WriteString('Password', '');
fReg.WriteString('Port', ' ');
fReg.WriteString('Server', 'xmark');
fReg.WriteString('User', 'winuser');
fReg.OpenKey('\Software\ODBC\ODBC.INI\ODBC Data Sources', True);
fReg.WriteString('DocumentsFab', 'MySQL');
fReg.CloseKey;
fReg.Free;
Memo1.Lines.Add('DATABASE NAME=');
Memo1.Lines.Add('USER NAME=');
Memo1.Lines.Add('ODBC DSN=DocumentsFab');
Memo1.Lines.Add('OPEN MODE=READ/WRITE');
Memo1.Lines.Add('BATCH COUNT=200');
Memo1.Lines.Add('LANGDRIVER=');
Memo1.Lines.Add('MAX ROWS=-1');
Memo1.Lines.Add('SCHEMA CACHE DIR=');
Memo1.Lines.Add('SCHEMA CACHE SIZE=8');
Memo1.Lines.Add('SCHEMA CACHE TIME=-1');
Memo1.Lines.Add('SQLPASSTHRU MODE=SHARED AUTOCOMMIT');
Memo1.Lines.Add('SQLQRYMODE=');
Memo1.Lines.Add('ENABLE SCHEMA CACHE=FALSE');
Memo1.Lines.Add('ENABLE BCD=FALSE');
Memo1.Lines.Add('ROWSET SIZE=20');
Memo1.Lines.Add('BLOBS TO CACHE=64');
Memo1.Lines.Add('BLOB SIZE=32');
AliasEditor.Add('DocumentsFab','MySQL',Memo1.Lines);
鐢˙DE 3.0鐗堣繘琛屼簡娴嬭瘯銆傜洰鍓嶅凡鐭ョ殑鍞竴闂鏄紝鏇存敼琛ㄦ柟妗堟椂锛屾煡璇㈠瓧娈典笉鏇存柊銆傜劧鑰岋紝BDE鐪嬩笂鍘讳笉浼氳瘑鍒富閿紝瀹冧粎鏄悕涓篜RIMARY鐨勭储寮曪紝灏界杩欒皥涓嶄笂鏄棶棰樸
路 Vision
搴旈夋嫨鈥滆繑鍥炲尮閰嶈鈥濋夐」銆
瑕佹兂鏇存柊琛紝蹇呴』涓鸿〃瀹氫箟涓婚敭銆
甯︽湁ADO鐨刅isual Basic涓嶈兘澶勭悊澶ф暣鏁般傝繖鎰忓懗鐫鏌愪簺鏌ヨ锛堝SHOW PROCESSLIST绛夛級涓嶄細姝g‘宸ヤ綔銆鏇存鏂规硶鏄紝鍦∣DBC杩炴帴瀛楃涓蹭腑浣跨敤OPTION=16384锛屾垨鍦MyODBC杩炴帴灞忓箷涓婇夋嫨鈥滃皢BIGINT鍒楁洿鏀逛负INT鈥濋夐」銆傛垨璁革紝浣犱篃甯屾湜閫夋嫨鈥滆繑鍥炲尮閰嶈鈥濋夐」銆
路 VisualInterDev
濡傛灉鍦ㄧ粨鏋滀腑鏈BIGINT锛屽彲鑳戒細鍑虹幇閿欒鈥[Microsoft][ODBC Driver Manager]椹卞姩绋嬪簭涓嶆敮鎸佽鍙傛暟鈥銆傝鍦MyODBC杩炴帴灞忓箷涓婇夋嫨鈥滃皢BIGINT鍒楁洿鏀逛负INT鈥濋夐」銆
路 Visual Objects
搴旈夋嫨鈥滀笉浼樺寲鍒楀搴︹濋夐」銆
路 MS Visio Enterprise 2000
閫氳繃MyODBC锛2.50.37鎴栨洿楂樼増鏈級锛岄氳繃杩炴帴MS Vision Enterprise 2000鍜孧ySQL锛屽苟浣跨敤Visio鐨勯嗗悜宸ョ▼甯堝姛鑳斤紝鎴戜滑寤虹珛浜嗘暟鎹簱妯″瀷锛屼娇鐢ㄥ畠鏉ユ绱㈠叧浜嶥B鐨勪俊鎭紙Visio鏄剧ず浜嗘墍鏈夌殑鍒楀畾涔夈佷富閿佺储寮曠瓑锛夈傛澶栵紝鎴戜滑杩橀氳繃鎸囧畾Visio涓殑鏂拌〃杩涜浜嗘祴璇曪紝骞堕氳繃MyODBC灏嗗叾瀵煎嚭鑷矼ySQL銆
瑕佹兂浣縈icrosoft Access鑳藉涓嶮yODBC涓璧峰伐浣滐紝鍦ㄤ綘鐨勫鎴风PC涓婂繀椤诲畬鎴愪笅杩版搷浣溿
1. 濡傛灉浣犳鍦ㄤ娇鐢ˋccess 2000锛屽簲浠庝笅杩板湴鍧鑾峰彇骞跺畨瑁呮渶鏂扮殑锛2.6鐗堟垨鏇撮珮锛塎icrosoft MDAC锛Microsoft鏁版嵁璁块棶缁勪欢锛夛紝http://www.microsoft.com/data/銆傚畠鏇存浜咥ccess鍦ㄥ皢鏁版嵁瀵煎嚭鑷矼ySQL鏃跺瓨鍦ㄧ殑涓涓己闄凤紝鏈寚瀹氳〃鍚嶅拰鍒楀悕銆傚彟涓绉嶈В鍐宠缂洪櫡鐨勬柟娉曟槸锛屽崌绾у埌MyODBC 2.50.33鍜孧ySQL 3.23.x, 瀹冧滑鍏卞悓鎻愪緵浜嗛伩鍏嶈闂鐨勪竴绉嶆柟寮忋
姝ゅ锛屼綘杩樺簲鑾峰彇骞跺簲鐢∕icrosoft Jet 4.0 Service Pack 5 (SP5)锛屽彲鍦ㄤ笅杩板湴鍧鎵惧埌瀹冿細http://support.microsoft.com/default.aspx?scid=kb;EN-US;q239114銆傚畠淇浜嗘煇浜涙儏鍐典笅鍦ˋccess涓垪琚爣娉ㄤ负鈥#DELETED#鈥鐨勯棶棰樸
娉ㄩ噴锛 濡傛灉浣犳浣跨敤MySQL 3.22锛屽繀椤诲畨瑁匨DAC琛ヤ竵锛屽苟浣跨敤MyODBC 2.50.32鎴2.50.34鎴栨洿楂樼増鏈互瑙e喅璇ラ棶棰樸
2. 瀹夎鏈鏂扮増MySQL锛http://dev.mysql.com/downloads/銆
3. 瀹夎鏈鏂扮増MyODBC 3.51鎴2.50锛http://dev.mysql.com/downloads/connector/odbc/銆
4. 瀵逛簬鎵鏈夌増鏈殑Access锛屽簲鍚敤鈥淢yODBC杩斿洖鍖归厤琛屸濋夐」銆
5. 閫氳繃MyODBC锛屽皢Access鐢ㄤ綔MySQL鏈嶅姟鍣ㄧ殑鍓嶇绋嬪簭銆
闄ら潪宸插畨瑁呬簡MyODBC锛屽惁鍒欎笉鑳藉皢琛ㄦ垨鏌ヨ瀵煎嚭鍒癕ySQL銆
瑕佹兂灏嗚〃浠嶢ccess瀵煎叆MySQL锛岃閬靛惊涓嬭堪璇存槑锛
1. 鎵撳紑Access鏁版嵁搴撴垨Access椤圭洰鏃讹紝鍑虹幇鈥滄暟鎹簱鈥濈獥鍙c傚叾涓樉绀轰簡鐢ㄤ簬鍒涘缓鏂版暟鎹簱瀵硅薄鍜屾墦寮宸叉湁瀵硅薄鐨勫揩鎹锋柟寮忋
2. 鐐瑰嚮鎵撶畻瀵煎嚭鐨勮〃鍚嶆垨鏌ヨ鍚嶏紝鐒跺悗鍦ㄢ滄枃浠垛濊彍鍗曚腑閫夋嫨鈥滃鍑衡濄
3. 鍦ㄢ滃鍑哄璞$被鍨瀵硅薄鍚鑷鈥濆璇濇涓紝鍦ㄢ滃彟瀛樹负绫诲瀷鈥濇涓紝閫夋嫨鈥ODBC鏁版嵁搴()鈥锛屽涓嬪浘鎵绀锛
4. 鍦ㄢ滃鍑衡濆璇濇涓紝杈撳叆鏂囦欢鍚嶏紙鎴栦娇鐢ㄥ缓璁殑鏂囦欢鍚嶏級锛岀劧鍚庨夋嫨OK銆
5. 鏄剧ず鈥滈夋嫨鏁版嵁婧愨濆璇濇锛屽叾涓垪鍑轰簡涓鸿绠楁満涓婂凡瀹夎鐨勫悇ODBC椹卞姩瀹氫箟鐨勬暟鎹簮銆傜偣鍑烩滄枃浠舵暟鎹簮鈥濇垨鈥滄満鍣ㄦ暟鎹簮鈥濋夐」鍗★紝鐒跺悗鍙屽嚮鎵撶畻瀵煎嚭鑷崇殑MyODBC鎴朚yODBC 3.51鏁版嵁婧愩傚叧浜庝负MyODBC瀹氫箟鏂版暟鎹簮鐨勬柟娉曪紝璇峰弬瑙26.1.9.2鑺傦紝鈥滃湪Windows涓婇厤缃甅yODBC DSN鈥銆
Microsoft Access閫氳繃璇ユ暟鎹簮杩炴帴鑷矼ySQL鏈嶅姟鍣紝骞跺鍑烘柊鐨勮〃鍜岋紡鎴栨暟鎹
闄ら潪宸插畨瑁呬簡MyODBC锛屽惁鍒欎笉鑳藉皢琛ㄦ垨鏌ヨ瀵煎嚭鍒癕ySQL鏁版嵁搴撱
瑕佹兂灏嗚〃浠嶮ySQL瀵煎叆鎴栭摼鎺ュ埌Access锛岃閲囧彇涓嬭堪姝ラ锛
1. 鎵撳紑鏁版嵁搴擄紝鎴栧垏鎹㈠埌鈥滄暟鎹簱鈥濈獥鍙d互鎵撳紑鏁版嵁搴撱
2. 瑕佹兂瀵煎叆琛紝鍦ㄢ滄枃浠垛濊彍鍗曚笂锛屽皢榧犳爣鎸囬拡鎸囧悜鈥滆幏鍙栧閮ㄦ暟鎹濓紝鐒跺悗鐐瑰嚮鈥滃鍏モ濄傝鎯抽摼鎺ヨ〃锛屽湪鈥滄枃浠垛濊彍鍗曚笂锛屽皢榧犳爣鎸囬拡鎸囧悜鈥滆幏鍙栧閮ㄦ暟鎹濓紝鐒跺悗鐐瑰嚮鈥滈摼鎺ヨ〃鈥濄
3. 鍦ㄢ滃鍏モ濓紙鎴栤滈摼鎺モ濓級瀵硅瘽妗嗕腑锛屽湪鈥滄枃浠剁被鍨嬧濇涓夋嫨鈥ODBC Databases ()鈥濄傚湪鈥滈夋嫨鏁版嵁婧愨濆璇濇涓紝鍒楀嚭浜嗗畾涔夌殑鏁版嵁婧愩傛樉绀衡滈夋嫨鏁版嵁婧愨濆璇濇锛屽叾涓垪鍑轰簡涓哄畨瑁呭湪璁$畻鏈轰笂鐨勪换浣昈DBC椹卞姩瀹氫箟鐨勬暟鎹簮銆傜偣鍑烩滄枃浠舵暟鎹簮鈥濇垨鈥滄満鍣ㄦ暟鎹簮鈥濋夐」鍗★紝鐒跺悗鍙屽嚮鎵撶畻瀵煎嚭鑷崇殑MyODBC鎴朚yODBC 3.51鏁版嵁婧愩傚叧浜庝负MyODBC鎴朚yODBC 3.51椹卞姩瀹氫箟鏂版暟鎹簮鐨勬柟娉曪紝璇峰弬瑙26.1.9.2鑺傦紝鈥滃湪Windows涓婇厤缃甅yODBC DSN鈥銆
4. 濡傛灉鎵閫夌殑鏁版嵁婧愯姹傜櫥褰曪紝璇疯緭鍏ョ櫥褰旾D鍜屽瘑鐮侊紙鍙兘杩橀渶瑕侀澶栦俊鎭級锛岀劧鍚庣偣鍑籓K銆
5. Microsoft Access閫氳繃ODBC鏁版嵁婧愯繛鎺ュ埌MySQL鏈嶅姟鍣紝骞舵樉绀哄彲瀵煎叆鎴栭摼鎺ョ殑琛ㄦ竻鍗曘
6. 鐐瑰嚮甯屾湜瀵煎叆鎴栭摼鎺ョ殑姣忎釜琛紝鐒跺悗鐐瑰嚮OK銆傚鏋滀綘姝e湪閾炬帴1涓〃锛屼絾瀹冩病鏈夊敮涓璇嗗埆鍚勬潯璁板綍鐨勭储寮曪紝Microsoft Access灏嗘樉绀洪摼鎺ヨ〃涓殑瀛楁鍒楄〃銆傜偣鍑昏兘鍞竴鏍囪瘑鍚勮褰曠殑瀛楁鎴栧瓧娈电粍鍚堬紝鐒跺悗鐐瑰嚮OK銆
鏄傚綋閾炬帴琛ㄧ殑缁撴瀯鎴栦綅缃彂鐢熷彉鍖栨椂锛屽彲閲囧彇涓嬭堪姝ラ鏌ョ湅鎴栧埛鏂伴摼鎺ャ傗滈摼鎺ヨ〃绠$悊鍣ㄢ濆垪鍑轰簡褰撳墠閾炬帴鐨勬墍鏈夎〃鐨勮矾寰勩
瑕佹兂鏌ョ湅鎴栧埛鏂伴摼鎺ワ細
1. 鎵撳紑鍖呭惈琛ㄩ摼鎺ョ殑鏁版嵁搴撱
2. 鍦ㄢ滃伐鍏封濊彍鍗曚笂锛屾寚鍚戔滃姞杞介」鈥濓紙鍦ˋccess 2000鎴栨洿鏂扮増鏈腑涓衡滄暟鎹簱瀹炵敤宸ュ叿鈥濓級锛岀劧鍚庣偣鍑烩滈摼鎺ヨ〃绠$悊鍣ㄢ濄
3. 閫変腑鎵撶畻鍒锋柊閾炬帴鐨勮〃鐨勫閫夋銆
4. 鐐瑰嚮OK锛屽埛鏂伴摼鎺ャ
Microsoft Access灏嗙‘璁ゆ垚鍔熺殑鍒锋柊鎿嶄綔锛屾垨鑰咃紝濡傛灉鏈壘鍒拌〃锛屽皢鏄剧ず鈥滈夋嫨<table name>鏂颁綅缃濆璇濇锛屽湪璇ュ璇濇涓紝鍙寚瀹氳〃鐨勬柊浣嶇疆銆傚鏋滀綘鎵閫夋嫨鐨勬暟涓〃宸茶绉昏嚦浣犳墍鎸囧畾鐨勬柊浣嶇疆锛岄摼鎺ヨ〃绠$悊鍣ㄥ皢閽堝鎵鏈夋墍閫夌殑琛ㄦ悳绱㈣浣嶇疆锛屽苟涓娆℃у湴鏇存柊鎵鏈夐摼鎺ャ
瑕佹兂鏇存敼閾炬帴琛ㄩ泦鍚堢殑璺緞锛
1. 鎵撳紑鍖呭惈琛ㄩ摼鎺ョ殑鏁版嵁搴撱
2. 鍦ㄢ滃伐鍏封濊彍鍗曚笂锛屾寚鍚戔滃姞杞介」鈥濓紙鍦ˋccess 2000鎴栨洿鏂扮増鏈腑涓衡滄暟鎹簱瀹炵敤宸ュ叿鈥濓級锛岀劧鍚庣偣鍑烩滈摼鎺ヨ〃绠$悊鍣ㄢ濄
3. 閫変腑鈥滃鏂颁綅缃缁堟彁绀衡濆閫夋銆
4. 閫変腑鎵撶畻鏇存敼閾炬帴鐨勮〃鐨勫閫夋锛岀劧鍚庣偣鍑籓K銆
5. 鍦ㄢ滈夋嫨<table name>鏂颁綅缃濆璇濇涓紝鎸囧畾鏂颁綅缃紝鐐瑰嚮鈥滄墦寮鈥濓紝鐒跺悗鐐瑰嚮OK銆
濡傛灉鍦ˋccess涓彃鍏ユ垨鏇存柊鐨勮褰曟樉绀轰负鈥#DELETED#鈥濓細
路 濡傛灉浣犳鍦ㄤ娇鐢ˋccess 2000锛屽簲浠庝笅杩板湴鍧鑾峰彇骞跺畨瑁呮渶鏂扮殑锛2.6鐗堟垨鏇撮珮锛塎icrosoft MDAC锛Microsoft鏁版嵁璁块棶缁勪欢锛夛紝http://www.microsoft.com/data/銆傚畠鏇存浜咥ccess鍦ㄥ皢鏁版嵁瀵煎嚭鑷矼ySQL鏃跺瓨鍦ㄧ殑涓涓己闄凤紝鏈寚瀹氳〃鍚嶅拰鍒楀悕銆傚彟涓绉嶈В鍐宠缂洪櫡鐨勬柟娉曟槸锛屽崌绾у埌MyODBC 2.50.33鍜孧ySQL 3.23.x, 瀹冧滑鍏卞悓鎻愪緵浜嗛伩鍏嶈闂鐨勪竴绉嶆柟寮忋
姝ゅ锛屼綘杩樺簲鑾峰彇骞跺簲鐢∕icrosoft Jet 4.0 Service Pack 5 (SP5)锛屽彲鍦ㄤ笅杩板湴鍧鎵惧埌瀹冿細http://support.microsoft.com/default.aspx?scid=kb;EN-US;q239114銆傚畠淇浜嗘煇浜涙儏鍐典笅鍦ˋccess涓垪琚爣娉ㄤ负鈥#DELETED#鈥鐨勯棶棰樸
娉ㄩ噴锛 濡傛灉浣犳浣跨敤MySQL 3.22锛屽繀椤诲畨瑁匨DAC琛ヤ竵锛屽苟浣跨敤MyODBC 2.50.32鎴2.50.34鎴栨洿楂樼増鏈互瑙e喅璇ラ棶棰樸
路 瀵逛簬鎵鏈夌増鏈殑Access锛屽簲鍚敤鈥淢yODBC杩斿洖鍖归厤琛屸濋夐」銆傚浜嶢ccess 2.0锛岃繕搴旈澶栧惎鐢ㄢ妯℃嫙ODBC 1.0鈥閫夐」銆
路 鍦ㄥ笇鏈涜兘澶熸洿鏂扮殑鎵鏈夎〃涓紝鍧囧簲鏈夋椂闂存埑銆備负浜嗚幏寰楁渶澶х殑鍙Щ妞嶆э紝鍦ㄥ垪澹版槑涓笉瑕佷娇鐢ㄩ暱搴﹁鑼冦備篃灏辨槸璇达紝搴斾娇鐢TIMESTAMP锛岃屼笉鏄疶IMESTAMP(n), n < 14銆
路 鍦ㄨ〃涓簲鏈1涓富閿傚涓嶇劧锛屾柊鐨勬垨鏇存柊鐨勮鍙兘浼氭樉绀轰负鈥#DELETED#鈥濄
路 浠呭簲浣跨敤DOUBLE娴偣瀛楁銆涓庡崟绮惧害娴偣杩涜姣旇緝鏃讹紝Access灏嗗け璐ャ傚叾寰佸厗鏄柊鐨勬垨鏇存柊鐨勮鍙兘浼氭樉绀轰负鈥#DELETED#鈥濓紝鎴栨棤娉曟壘鍒版垨鏇存柊琛屻
路 濡傛灉浣犳浣跨敤MyODBC鏉ラ摼鎺ュ埌鏈塀IGINT鍒楃殑琛紝缁撴灉浼氭樉绀轰负鈥#DELETED鈥濄傛帓闄ゅ畠鐨勮В鍐虫柟妗堟槸锛
o 鏈1涓互TIMESTAMP浣滀负鏁版嵁绫诲瀷鐨勮櫄鎷熷垪銆
o 鍦ㄢ淥DBC DSN绠$悊鍣ㄢ濈殑杩炴帴瀵硅瘽妗嗕腑閫夋嫨鈥滃皢BIGINT鍒楁洿鏀逛负INT鈥濋夐」銆
o 鍒犻櫎涓嶢ccess鐨勮〃閾炬帴锛屽苟閲嶆柊鍒涘缓瀹冦
鏃ц褰曚粛灏嗘樉绀轰负鈥#DELETED#鈥濓紝浣嗘柊澧烇紡鏇存柊鐨勮褰曚細鎭板綋鏄剧ず銆
瀵逛簬鏌愪簺绋嬪簭锛屽彲鑳戒細鍑虹幇璇ラ敊璇細 鍙︿竴鐢ㄦ埛鏇存敼浜嗕綘鎵淇敼鐨勮褰曘傚湪澶у鏁版儏鍐典笅锛屽彲閫氳繃涓嬭堪鎺柦瑙e喅璇ラ棶棰橈細
路 濡傛灉涓婚敭涓嶅瓨鍦紝涓鸿〃娣诲姞1涓富閿
路 濡傛灉鏃堕棿鎴充笉瀛樺湪锛屾坊鍔1涓椂闂存埑鍒椼
路 浠呭簲浣跨敤DOUBLE娴偣瀛楁銆涓庡崟绮惧害娴偣鍊兼瘮杈冩椂锛屾煇浜涚▼搴忎細鍑洪敊銆
濡傛灉杩欎簺鎺柦鏈兘瑙e喅闂锛岄鍏堝簲浠嶰DBC绠$悊鍣ㄧ敓鎴1涓棩蹇楁枃浠讹紙璇锋眰鏉ヨ嚜ODBC ADMIN鐨勬棩蹇楁椂鑾峰緱鐨勬棩蹇楁枃浠讹級锛屼互鍙1涓狹yODBC鏃ュ織锛屼娇鐢ㄥ畠浠壘鍑哄嚭閿欑殑鍘熷洜銆傚叿浣撲粙缁嶏紝璇峰弬瑙26.1.9.7鑺傦紝鈥滆幏鍙朞DBC璺熻釜鏂囦欢鈥銆
灏嗗厜鏍囦綅缃寚瀹氫负adUseServer鏃讹紝ADO鐨GetChunk()鍜AppendChunk()鏂规硶涓嶈兘鎸夐鏈熺殑鏂瑰紡宸ヤ綔銆備粠鍙︿竴鏂归潰涓婅锛屽彲浣跨敤adUseClient鍏嬫湇璇ラ棶棰樸
鍦http://www.dwam.net/iishelp/ado/docs/adomth02_4.htm涓婄粰鍑轰簡涓涓畝鍗曠ず渚嬨
涓嬮潰缁欏嚭浜哅ike Hillyer锛m.hillyer@telusplanet.net锛夊啓鐨勪竴绡囧ソ鏂囩珷锛屽叾涓В閲婁簡濡備綍鍦ˋDO涓氳繃MyODBC鎻掑叆鏁版嵁鍜岋紡鎴栦粠Blob鍒楄幏鍙栨暟鎹殑鏂规硶銆MySQL BLOB鍒楀拰Visual Basic 6銆
涓嬮潰缁欏嚭浜咥DO銆丏AO鍜孯DO涓嶸B涓璧蜂娇鐢ㄧ殑鐢ㄦ硶绀轰緥锛
路 ADO绀轰緥锛 26.1.19鑺傦紝鈥淢yODBC涓嶸B锛欰DO銆丏AO鍜孯DO鈥
路 DAO绀轰緥锛 26.1.19鑺傦紝鈥淢yODBC涓嶸B锛欰DO銆丏AO鍜孯DO鈥
路 RDO绀轰緥锛 26.1.19鑺傦紝鈥淢yODBC涓嶸B锛欰DO銆丏AO鍜孯DO鈥
濡傛灉浣犳湁鍏朵粬濂界殑渚嬪瓙锛屾垨鍏充簬ADO/DAO/RDO鐨勫熀鏈煡璇嗭紝璇峰皢璇︽儏鍙戦佽嚦myodbc@lists.mysql.com銆
路 浣跨敤MyODBC閫氳繃ASP璁块棶浣犵殑MySQL鏁版嵁搴
鍦http://support.microsoft.com/default.aspx?scid=/Support/ActiveServer/faq/data/adofaq.asp涓紝缁欏嚭浜嗗叧浜嶢SP鐨勫父瑙侀棶棰樻竻鍗曘
渚嬪锛岀敤鍚湁涓ゅ垪鏂囨湰鐨勮〃鍒涘缓1涓暟鎹簱锛
路 浣跨敤mysql瀹㈡埛绔鍛戒护琛屽伐鍏锋彃鍏ヨ銆
路 浣跨敤ODBC绠$悊鍣ㄥ垱寤1涓狣SN鏂囦欢锛屼緥濡傦紝閽堝鍒氬垱寤烘暟鎹簱鐨勨渕y鈥濄
路 鎵撳紑Word搴旂敤绋嬪簭銆
路 鍒涘缓1涓柊鐨勭┖鐧芥枃妗c
路 鍦ㄦ暟鎹簱宸ュ叿鏍忎笂锛屾寜鈥滄彃鍏ユ暟鎹簱鈥濇寜閽
路 鎸夆滆幏鍙栨暟鎹濇寜閽
路 鍦ㄢ滆幏鍙栨暟鎹濆睆骞曞彸渚э紝鎸夆Ms Query鈥濇寜閽
路 鍦ㄢMs Query鈥濅腑浣跨敤鈥my DSN鈥濇枃浠跺垱寤1涓柊鏁版嵁婧愩
路 閫夋嫨鏂版煡璇€
路 閫夋嫨鎵撶畻浣跨敤鐨勫垪銆
路 濡傛灉鎰挎剰锛屽垱寤1涓繃婊ゅ櫒銆
路 濡傛灉鎰挎剰锛屽垱寤1涓垎绫汇
路 閫夋嫨鈥滃皢鏁版嵁杩斿洖鍒Microsoft Word鈥濄
路 鐐瑰嚮鈥滃畬鎴愨濄
路 鐐瑰嚮鈥滄彃鍏ユ暟鎹濆苟閫夋嫨璁板綍銆
路 鐐瑰嚮OK锛屽湪浣犵殑Word鏂囨。涓皢鐪嬪埌鎻掑叆鐨勮銆
涓涓父瑙侀棶棰樻槸锛屽浣曡幏鍙栦粠INSERT璇彞鑷姩鐢熸垚鐨処D鐨勫笺備娇鐢∣DBC锛屼綘鍙互浣滀笌浠ヤ笅绀轰緥绫讳技鐨勪换浣曚簨锛堝亣瀹氣渁uto鈥濅负AUTO_INCREMENT瀛楁锛夛細
INSERT INTO tbl (auto,text) VALUES(NULL,'text');
SELECT LAST_INSERT_ID();
鎴栬咃紝濡傛灉浣犱粎鎵撶畻灏咺D鎻掑叆鍒板彟涓琛ㄤ腑锛屼綘鍙互锛
INSERT INTO tbl (auto,text) VALUES(NULL,'text');
INSERT INTO tbl2 (id,text) VALUES(LAST_INSERT_ID(),'text');
璇峰弬瑙25.2.13.3鑺傦紝鈥滃浣曡幏寰椾笂娆℃彃鍏ヨ鐨勫敮涓ID鈥銆
涓轰簡浣挎煇浜汷DBC搴旂敤绋嬪簭锛堣嚦灏戞槸Delphi鍜孉ccess锛夎幏寰楁洿濂界殑鎬ц兘锛屽彲浣跨敤涓嬭堪鏌ヨ鏉ユ壘鍒版柊鎻掑叆鐨勮锛
SELECT * FROM tbl WHERE auto IS NULL;
涓轰簡閬垮厤璇ラ棶棰橈紝蹇呴』浣跨敤鍚敤浜InnoDB鎴BDB瀛樺偍寮曟搸锛堟垨涓よ咃級鐨勬湇鍔″櫒锛屽苟浣跨敤杩欑被琛ㄣ浠4.0鐗堜互鍚庯紝榛樿鎯呭喌涓嬶紝MySQL鏈嶅姟鍣ㄥ潎鏀寔InnoDB銆傚湪BDB鍙敤鐨勫钩鍙颁笂锛孧ySQL-Max鏈嶅姟鍣ㄤ篃鏀寔BDB銆
姝ゅ锛屽鏋滀綘鐨勬湇鍔″櫒鏀寔浜嬪姟琛ㄧ被鍨嬶紙InnoDB鍜孊DB锛夛紝璇风‘淇濆湪DSN閰嶇疆涓湭璁剧疆鈥滅姝簨鍔♀濋夐」銆
鏄備綘鍙互浣跨敤odbc.net锛岄氳繃MyODBC杩炴帴鍒癕ySQL銆傝繖閲岀粰鍑轰簡涓浜涗粠VC.NET鍜孷B.NET杩炴帴鍒癕ySQL鐨勫熀鏈ず渚嬨
路 璇峰弬瑙26.1.20.1鑺傦紝鈥淥DBC.NET: CSHARP(C#)鈥
路 璇峰弬瑙26.1.20.2鑺傦紝鈥淥DBC.NET: VB鈥
杩欓噷缁欏嚭浜Venu锛圡yODBC寮鍙戜汉鍛橈級鎾板啓鐨勫彟涓绡囧ソ鏂囩珷鐮旂┒.NET鐜涓嬬殑MySQL锛屽叾涓紝缁欏嚭浜嗘墍鏈夌殑MySQL .NET鎺ュ彛浠ュ強涓浜涙湁鐢ㄧ殑渚嬪瓙銆
娉ㄦ剰锛 鍦ㄤ笌MyODBC涓璧蜂娇鐢∣DBC.NET鐨勮繃绋嬩腑锛屽湪鑾峰彇绌哄瓧绗︿覆鐨勫悓鏃讹紙闀垮害涓0锛夛紝灏嗙粰鍑篠QL_NO_DATA寮傚父銆備粠绔欑偣http://support.microsoft.com/default.aspx?scid=kb;EN-US;q319243锛屽彲鑾峰彇閽堝瀹冪殑琛ヤ竵銆
MyODBC姣斿叾浠朞DBC椹卞姩绋嬪簭蹇緢澶氥傜紦鎱㈠彲鑳芥槸鍥犳湭浣跨敤涓嬭堪閫夐」閫犳垚鐨勶細
路 鎵撳紑鈥淥DBC璺熻釜鈥濋夐」銆傞伒寰杩欓噷缁欏嚭鐨勬寚绀鸿鏄庯紝浜ゅ弶妫鏌ユ槸鍚︽湭鍚敤璇ラ夐」銆
濡備笂鍥炬墍绀猴紝鈥淥DBC鏁版嵁婧愮鐞嗗櫒鈥濃滆窡韪濋夐」鍗$殑鈥滀綍鏃惰窡韪濋夐」搴斿缁堟寚鍚戔滅幇鍦ㄥ紑濮嬭窡韪濓紝鑰屼笉鏄滅幇鍦ㄥ仠姝㈣窡韪濄
路 浣跨敤浜嗛┍鍔ㄧ▼搴忕殑璋冭瘯鐗堟湰銆傚鏋滀綘姝e湪浣跨敤椹卞姩DLL鐨勮皟璇曠増鏈紝涔熶細浣挎煡璇㈠鐞嗗彉鎱€備綘鍙互鎵ц浜ゅ弶妫鏌ワ紝閫氳繃椹卞姩DLL灞炴э紙鍦ㄧ郴缁熺洰褰曚笅锛屽彸鍑婚┍鍔―LL骞剁偣鍑烩滃睘鎬р濓級鐨勨滄敞閲娾濆尯锛屾鏌LL鏄惁鏄皟璇曠増鎴栧彂甯冪増锛屽涓嬪浘鎵绀猴細
路 鍚敤浜嗏滈┍鍔ㄨ窡韪拰鏌ヨ鏃ュ織鈥濄傚嵆浣夸綘鎵撶畻浣跨敤椹卞姩绋嬪簭鐨勮皟璇曠増锛堝湪鐢熶骇鐜涓嬫诲簲浣跨敤鍙戝竷鐗堬級锛屼篃搴旂‘淇濈姝簡鈥滈┍鍔ㄨ窡韪拰鏌ヨ鏃ュ織鈥濋夐」锛圤PTION=4,524288锛夛紝濡備笅鍥炬墍绀猴細
路 閰嶇疆MyODBC DSN銆
路 杩炴帴鍒癕ySQL鏈嶅姟鍣ㄣ
路 鍒濆鍖栨搷浣溿
路 鎵цSQL璇彞銆
路 妫绱㈢粨鏋溿
路 鎵ц浜嬪姟銆
路 鏂紑涓庢湇鍔″櫒鐨勮繛鎺ャ
澶у鏁板簲鐢ㄧ▼搴忓潎浣跨敤浜嗚繖浜涙楠ょ殑鏌愪簺鍙樹綋銆傚湪涓嬪浘涓紝缁欏嚭浜嗗熀鏈殑搴旂敤姝ラ锛
鍦ㄦ湰鑺備腑锛屾瑕佷粙缁嶄簡鎸夊姛鑳藉垎绫荤殑ODBC瀛愮▼搴忋
鍏充簬鍏ㄩ儴ODBC API鍙傝冿紝璇峰弬瑙丱DBC绋嬪簭鍛樺弬鑰冿紝http://msdn.microsoft.com/library/en-us/odbc/htm/odbcabout_this_manual.asp銆
搴旂敤绋嬪簭鍙互璋冪敤SQLGetInfo鍑芥暟鏉ヨ幏寰楀叧浜MyODBC鐨勪竴鑷存т俊鎭備负浜嗚幏寰楅┍鍔ㄧ▼搴忓鐗瑰畾鍑芥暟鐨勬敮鎸佷俊鎭紝搴旂敤绋嬪簭鍙皟鐢SQLGetFunctions銆
娉ㄩ噴锛 涓轰簡鍚戝悗鍏煎锛孧yODBC 3.51椹卞姩绋嬪簭鏀寔鎵鏈夊凡涓嶄娇鐢ㄧ殑鍑芥暟銆
鍦ㄤ笅闈㈢殑琛ㄥ悇涓紝鎸変换鍔″垎缁勫垪鍑轰簡MyODBC API璋冪敤锛
杩炴帴鍒版暟鎹簮锛
鍑芥暟鍚 |
MyODBC |
MyODBC |
涓鑷存 |
鐩殑 |
|
2.50 |
3.51 |
|
|
SQLAllocHandle |
No |
Yes |
ISO 92 |
鑾峰彇鐜銆佽繛鎺ャ佽鍙ユ垨鎻忚堪绗﹀彞鏌勩 |
SQLConnect |
Yes |
Yes |
ISO 92 |
鎸夋暟鎹簮鍚嶃佺敤鎴稩D鍜屽瘑鐮佽繛鎺ュ埌鐗瑰畾椹卞姩绋嬪簭銆 |
SQLDriverConnect |
Yes |
Yes |
ODBC |
閫氳繃杩炴帴瀛楃涓诧紝鎴栭┍鍔ㄧ鐞嗗櫒鍜岄┍鍔ㄦ樉绀哄璇濇鍙戝嚭鐨勮姹傦紝杩炴帴鍒扮壒瀹氶┍鍔ㄧ▼搴忋 |
SQLAllocEnv |
Yes |
Yes |
Deprecated |
鑾峰緱椹卞姩绋嬪簭鍒嗛厤鐨勭幆澧冨彞鏌勩 |
SQLAllocConnect |
Yes |
Yes |
Deprecated |
鑾峰彇杩炴帴鍙ユ焺銆 |
鑾峰彇鍏充簬椹卞姩绋嬪簭鍜屾暟鎹簮鐨勪俊鎭細
鍑芥暟鍚 |
MyODBC |
MyODBC |
涓鑷存 |
鐩殑 |
|
2.50 |
3.51 |
|
|
SQLDataSources |
No |
No |
ISO 92 |
杩斿洖鍙敤鏁版嵁婧愮殑鍒楄〃锛岀敱椹卞姩绠$悊鍣ㄥ鐞嗐 |
SQLDrivers |
No |
No |
ODBC |
杩斿洖宸插畨瑁呴┍鍔ㄧ▼搴忓拰鍣ㄥ睘鎬х殑鍒楄〃锛岀敱椹卞姩绠$悊鍣ㄥ鐞嗐 |
SQLGetInfo |
Yes |
Yes |
ISO 92 |
杩斿洖鍏充簬鐗瑰畾椹卞姩绋嬪簭鍜屾暟鎹簮鐨勪俊鎭 |
SQLGetFunctions |
Yes |
Yes |
ISO 92 |
杩斿洖鏀寔鐨勯┍鍔ㄥ嚱鏁般 |
SQLGetTypeInfo |
Yes |
Yes |
ISO 92 |
杩斿洖鍏充簬鎵鏀寔鏁版嵁绫诲瀷鐨勪俊鎭 |
璁剧疆骞舵绱㈤┍鍔ㄥ睘鎬э細
鍑芥暟鍚 |
MyODBC |
MyODBC |
涓鑷存 |
鐩殑 |
|
2.50 |
3.51 |
|
|
SQLSetConnectAttr |
No |
Yes |
ISO 92 |
璁剧疆杩炴帴灞炴с |
SQLGetConnectAttr |
No |
Yes |
ISO 92 |
杩斿洖杩炴帴灞炴х殑鍊笺 |
SQLSetConnectOption |
Yes |
Yes |
Deprecated |
璁剧疆杩炴帴閫夐」銆 |
SQLGetConnectOption |
Yes |
Yes |
Deprecated |
杩斿洖杩炴帴閫夐」鐨勫笺 |
SQLSetEnvAttr |
No |
Yes |
ISO 92 |
璁剧疆鐜灞炴с |
SQLGetEnvAttr |
No |
Yes |
ISO 92 |
杩斿洖鐜灞炴х殑鍊笺 |
SQLSetStmtAttr |
No |
Yes |
ISO 92 |
璁剧疆璇彞灞炴с |
SQLGetStmtAttr |
No |
Yes |
ISO 92 |
杩斿洖璇彞灞炴х殑鍊笺 |
SQLSetStmtOption |
Yes |
Yes |
Deprecated |
璁剧疆璇彞閫夐」銆 |
SQLGetStmtOption |
Yes |
Yes |
Deprecated |
杩斿洖璇彞閫夐」鐨勫笺 |
鍑嗗SQL璇锋眰锛
鍑芥暟鍚 |
MyODBC |
MyODBC |
涓鑷存 |
鐩殑 |
|
2.50 |
3.51 |
|
|
SQLAllocStmt |
Yes |
Yes |
Deprecated |
鍒嗛厤璇彞鍙ユ焺銆 |
SQLPrepare |
Yes |
Yes |
ISO 92 |
鍑嗗闅忓悗鎵ц鐨凷QL璇彞銆 |
SQLBindParameter |
Yes |
Yes |
ODBC |
涓篠QL璇彞涓殑鍙傛暟鍒嗛厤瀛樺偍鍣ㄣ |
SQLGetCursorName |
Yes |
Yes |
ISO 92 |
杩斿洖涓庤鍙ュ彞鏌勭浉鍏崇殑鍏夋爣鍚嶃 |
SQLSetCursorName |
Yes |
Yes |
ISO 92 |
鎸囧畾鍏夋爣鍚嶃 |
SQLSetScrollOptions |
Yes |
Yes |
ODBC |
璁剧疆鎺у埗鍏夋爣琛屼负鐨勯夐」銆 |
鎻愪氦璇锋眰锛
鍑芥暟鍚 |
MyODBC |
MyODBC |
涓鑷存 |
鐩殑 |
|
2.50 |
3.51 |
|
|
SQLExecute |
Yes |
Yes |
ISO 92 |
鎵ц鍑嗗濂界殑璇彞銆 |
SQLExecDirect |
Yes |
Yes |
ISO 92 |
鎵ц璇彞銆 |
SQLNativeSql |
Yes |
Yes |
ODBC |
杩斿洖鐢遍┍鍔ㄧ▼搴忕炕璇戠殑SQL璇彞鐨勬枃鏈 |
SQLDescribeParam |
Yes |
Yes |
ODBC |
杩斿洖璇彞涓壒瀹氬弬鏁扮殑鎻忚堪銆 |
SQLNumParams |
Yes |
Yes |
ISO 92 |
杩斿洖璇彞涓殑鍙傛暟鏁扮洰銆 |
SQLParamData |
Yes |
Yes |
ISO 92 |
涓SQLPutData涓璧蜂娇鐢紝浠ヤ究鍦ㄦ墽琛屾椂鎻愪緵鍙傛暟銆傦紙瀵逛簬闀挎暟鎹煎緢鏈夌敤锛夈 |
SQLPutData |
Yes |
Yes |
ISO 92 |
鍙戦佹煇涓鍙傛暟鏁版嵁鍊肩殑閮ㄥ垎鎴栧叏閮ㄣ傦紙瀵逛簬闀挎暟鎹煎緢鏈夌敤锛夈 |
妫绱㈢粨鏋滀互鍙婂叧浜庣粨鏋滅殑淇℃伅锛
鍑芥暟鍚 |
MyODBC |
MyODBC |
涓鑷存 |
鐩殑 |
|
2.50 |
3.51 |
|
|
SQLRowCount |
Yes |
Yes |
ISO 92 |
杩斿洖鎻掑叆銆佹洿鏂版垨鍒犻櫎璇锋眰褰卞搷鐨勮鏁般 |
SQLNumResultCols |
Yes |
Yes |
ISO 92 |
杩斿洖缁撴灉闆嗕腑鐨勫垪鏁般 |
SQLDescribeCol |
Yes |
Yes |
ISO 92 |
鎻忚堪缁撴灉闆嗕腑鐨勫垪銆 |
SQLColAttribute |
No |
Yes |
ISO 92 |
鎻忚堪缁撴灉闆嗕腑鐨勬煇1鍒楃殑灞炴с |
SQLColAttributes |
Yes |
Yes |
Deprecated |
鎻忚堪缁撴灉闆嗕腑鐨勬煇1鍒楃殑澶氫釜灞炴с |
SQLFetch |
Yes |
Yes |
ISO 92 |
杩斿洖澶氫釜缁撴灉琛屻 |
SQLFetchScroll |
No |
Yes |
ISO 92 |
杩斿洖鍙粴鍔ㄧ粨鏋滆銆 |
SQLExtendedFetch |
Yes |
Yes |
Deprecated |
杩斿洖鍙粴鍔ㄧ粨鏋滆銆 |
SQLSetPos |
Yes |
Yes |
ODBC |
灏嗗厜鏍囧畾涓哄湪鑾峰彇鐨勬暟鎹潡涓紝鍏佽搴旂敤绋嬪簭鏇存柊琛岄泦鍚堜腑鐨勬暟鎹紝鎴栨洿鏂版垨鍒犻櫎缁撴灉闆嗕腑鐨勬暟鎹 |
SQLBulkOperations |
No |
Yes |
ODBC |
鎵ц鎵归噺鎻掑叆鍜屾壒閲忎功绛炬搷浣滐紝鍖呮嫭鏇存柊銆佸垹闄ゅ拰鎸変功绛捐幏鍙栥 |
妫绱㈤敊璇拰璇婃柇淇℃伅锛
鍑芥暟鍚 |
MyODBC |
MyODBC |
涓鑷存 |
鐩殑 |
|
2.50 |
3.51 |
|
|
SQLError |
Yes |
Yes |
Deprecated |
杩斿洖棰濆鐨勯敊璇垨鐘舵佷俊鎭 |
SQLGetDiagField |
Yes |
Yes |
ISO 92 |
杩斿洖棰濆鐨勮瘖鏂俊鎭紙璇婃柇鎬ф暟鎹粨鏋勭殑鍗曚釜瀛楁锛夈 |
SQLGetDiagRec |
Yes |
Yes |
ISO 92 |
杩斿洖棰濆鐨勮瘖鏂俊鎭紙璇婃柇鎬ф暟鎹粨鏋勭殑澶氫釜瀛楁锛夈 |
鑾峰彇鍏充簬鏁版嵁婧愮殑绯荤粺琛紙鐩綍鍑芥暟锛夋潯鐩殑淇℃伅锛
鍑芥暟鍚 |
MyODBC |
MyODBC |
涓鑷存 |
鐩殑 |
|
2.50 |
3.51 |
|
|
SQLColumnPrivileges |
Yes |
Yes |
ODBC |
杩斿洖鍏充簬涓涓垨澶氫釜琛ㄧ殑鍒楀拰鐩稿叧灞炴х殑鍒楄〃銆 |
SQLColumns |
Yes |
Yes |
X/Open |
杩斿洖鎸囧畾琛ㄤ腑鍒楀悕鐨勫垪琛ㄣ |
SQLForeignKeys |
Yes |
Yes |
ODBC |
鍦ㄦ寚瀹氳〃涓鏋滃瓨鍦ㄥ閿紝杩斿洖鏋勬垚澶栭敭鐨勫垪鍚嶅垪琛ㄣ |
SQLPrimaryKeys |
Yes |
Yes |
ODBC |
杩斿洖鏋勬垚鏌1琛ㄧ殑涓婚敭鐨勫垪鍚嶅垪琛ㄣ |
SQLSpecialColumns |
Yes |
Yes |
X/Open |
杩斿洖鍏充簬鏈浣冲垪闆嗗悎鐨勪俊鎭紝璇ュ垪闆嗗悎鍞竴鍦版寚鏄庝簡鎸囧畾琛ㄤ腑鐨勮锛屾垨褰撴煇1浜嬪姟鏇存柊浜嗚涓殑浠讳綍鍊兼椂鑷姩鏇存柊鐨勫垪銆 |
SQLStatistics |
Yes |
Yes |
ISO 92 |
杩斿洖鍏充簬鍗曚釜琛ㄧ殑缁熻淇℃伅锛屼互鍙婁笌琛ㄧ浉鍏崇殑绱㈠紩鍒楄〃銆 |
SQLTablePrivileges |
Yes |
Yes |
ODBC |
杩斿洖琛ㄥ垪琛紝浠ュ強涓庡悇琛ㄧ浉鍏崇殑鏉冮檺銆 |
SQLTables |
Yes |
Yes |
X/Open |
杩斿洖瀛樺偍鍦ㄧ壒瀹氭暟鎹簮鍐呯殑琛ㄥ悕鍒楄〃銆 |
鎵ц浜嬪姟锛
鍑芥暟鍚 |
MyODBC |
MyODBC |
涓鑷存 |
鐩殑 |
|
2.50 |
3.51 |
|
|
SQLTransact |
Yes |
Yes |
Deprecated |
鎻愪氦鎴栧洖婊氫簨鍔° |
SQLEndTran |
No |
Yes |
ISO 92 |
鎻愪氦鎴栧洖婊氫簨鍔° |
涓璇彞锛
鍑芥暟鍚 |
MyODBC |
MyODBC |
涓鑷存 |
鐩殑 |
|
2.50 |
3.51 |
|
|
SQLFreeStmt |
Yes |
Yes |
ISO 92 |
缁撴潫璇彞澶勭悊锛岃垗寮冩湭鍐崇粨鏋滐紝骞堕噴鏀句笌璇彞鍙ユ焺鐩稿叧鐨勬墍鏈夎祫婧愶紙鍙夛級銆 |
SQLCloseCursor |
Yes |
Yes |
ISO 92 |
鍏抽棴鍦ㄨ鍙ュ彞鏌勪笂鎵撳紑鐨勬寚閽堛 |
SQLCancel |
Yes |
Yes |
ISO 92 |
鍙栨秷SQL璇彞銆 |
涓杩炴帴锛
鍑芥暟鍚 |
MyODBC |
MyODBC |
涓鑷存 |
鐩殑 |
|
2.50 |
3.51 |
|
|
SQLDisconnect |
Yes |
Yes |
ISO 92 |
鍏抽棴杩炴帴銆 |
SQLFreeHandle |
No |
Yes |
ISO 92 |
閲婃斁鐜銆佽繛鎺ャ佽鍙ユ垨鎻忚堪绗﹀彞鏌勩 |
SQLFreeConnect |
Yes |
Yes |
Deprecated |
閲婃斁杩炴帴鍙ユ焺銆 |
SQLFreeEnv |
Yes |
Yes |
Deprecated |
閲婃斁杩炴帴鍙ユ焺銆 |
鍦ㄤ笅琛ㄤ腑锛屼粙缁嶄簡椹卞姩绋嬪簭灏嗘湇鍔″櫒鏁版嵁绫诲瀷鏄犲皠涓洪粯璁QL鍜孋鏁版嵁绫诲瀷鐨勬柟娉曪細
鍊 |
SQL绫诲瀷 |
C绫诲瀷 |
bit |
SQL_BIT |
SQL_C_BIT |
tinyint |
SQL_TINYINT |
SQL_C_STINYINT |
tinyint unsigned |
SQL_TINYINT |
SQL_C_UTINYINT |
bigint |
SQL_BIGINT |
SQL_C_SBIGINT |
bigint unsigned |
SQL_BIGINT |
SQL_C_UBIGINT |
long varbinary |
SQL_LONGVARBINARY |
SQL_C_BINARY |
blob |
SQL_LONGVARBINARY |
SQL_C_BINARY |
longblob |
SQL_LONGVARBINARY |
SQL_C_BINARY |
tinyblob |
SQL_LONGVARBINARY |
SQL_C_BINARY |
mediumblob |
SQL_LONGVARBINARY |
SQL_C_BINARY |
long varchar |
SQL_LONGVARCHAR |
SQL_C_CHAR |
text |
SQL_LONGVARCHAR |
SQL_C_CHAR |
mediumtext |
SQL_LONGVARCHAR |
SQL_C_CHAR |
char |
SQL_CHAR |
SQL_C_CHAR |
numeric |
SQL_NUMERIC |
SQL_C_CHAR |
decimal |
SQL_DECIMAL |
SQL_C_CHAR |
integer |
SQL_INTEGER |
SQL_C_SLONG |
integer unsigned |
SQL_INTEGER |
SQL_C_ULONG |
int |
SQL_INTEGER |
SQL_C_SLONG |
int unsigned |
SQL_INTEGER |
SQL_C_ULONG |
mediumint |
SQL_INTEGER |
SQL_C_SLONG |
mediumint unsigned |
SQL_INTEGER |
SQL_C_ULONG |
smallint |
SQL_SMALLINT |
SQL_C_SSHORT |
smallint unsigned |
SQL_SMALLINT |
SQL_C_USHORT |
real |
SQL_FLOAT |
SQL_C_DOUBLE |
double |
SQL_FLOAT |
SQL_C_DOUBLE |
float |
SQL_REAL |
SQL_C_FLOAT |
double precision |
SQL_DOUBLE |
SQL_C_DOUBLE |
date |
SQL_DATE |
SQL_C_DATE |
time |
SQL_TIME |
SQL_C_TIME |
year |
SQL_SMALLINT |
SQL_C_SHORT |
datetime |
SQL_TIMESTAMP |
SQL_C_TIMESTAMP |
timestamp |
SQL_TIMESTAMP |
SQL_C_TIMESTAMP |
text |
SQL_VARCHAR |
SQL_C_CHAR |
varchar |
SQL_VARCHAR |
SQL_C_CHAR |
enum |
SQL_VARCHAR |
SQL_C_CHAR |
set |
SQL_VARCHAR |
SQL_C_CHAR |
bit |
SQL_CHAR |
SQL_C_CHAR |
bool |
SQL_CHAR |
SQL_C_CHAR |
鍦ㄤ笅琛ㄤ腑锛屽垪鍑轰簡椹卞姩绋嬪簭杩斿洖鐨勯櫎鏈嶅姟鍣ㄩ敊璇箣澶栫殑閿欒浠g爜鍒楄〃锛
鏈満浠g爜 |
SQLSTATE 2 |
SQLSTATE 3 |
閿欒娑堟伅 |
500 |
01000 |
01000 |
涓鑸鍛 |
501 |
01004 |
01004 |
瀛楃涓叉暟鎹紝鍙虫埅 |
502 |
01S02 |
01S02 |
閫夐」鍊艰鏇存敼 |
503 |
01S03 |
01S03 |
鏈洿鏂帮紡鍒犻櫎琛 |
504 |
01S04 |
01S04 |
鏇存柊锛忓垹闄や簡1涓互涓婄殑琛 |
505 |
01S06 |
01S06 |
鍦ㄧ粨鏋滈泦鍚堣繑鍥炵1涓闆嗗悎涔嬪墠瑙嗗浘鑾峰彇鏁版嵁銆 |
506 |
07001 |
07002 |
瀵逛簬鎵鏈夊弬鏁帮紝鏈娇鐢⊿QLBindParameter銆 |
507 |
07005 |
07005 |
绮惧埗璇彞涓嶇鍚堝厜鏍囪鑼 |
508 |
07009 |
07009 |
鏃犳晥鐨勬弿杩扮绱㈠紩銆 |
509 |
08002 |
08002 |
杩炴帴鍚嶆鍦ㄤ娇鐢ㄣ |
510 |
08003 |
08003 |
杩炴帴涓嶅瓨鍦ㄣ |
511 |
24000 |
24000 |
鏃犳晥鐨勫厜鏍囩姸鎬併 |
512 |
25000 |
25000 |
鏃犳晥鐨勪簨鍔$姸鎬併 |
513 |
25S01 |
25S01 |
浜嬪姟鐘舵佹湭鐭ャ |
514 |
34000 |
34000 |
鏃犳晥鍏夋爣鍚嶃 |
515 |
S1000 |
HY000 |
涓鑸殑椹卞姩绋嬪簭瀹氫箟閿欒銆 |
516 |
S1001 |
HY001 |
鍐呭瓨鍒嗛厤閿欒銆 |
517 |
S1002 |
HY002 |
鏃犳晥鐨勫垪缂栧彿銆 |
518 |
S1003 |
HY003 |
鏃犳晥鐨勫簲鐢ㄧ紦鍐茬被鍨嬨 |
519 |
S1004 |
HY004 |
鏃犳晥鐨凷QL鏁版嵁绫诲瀷銆 |
520 |
S1009 |
HY009 |
绌烘寚閽堢殑鏃犳晥浣跨敤銆 |
521 |
S1010 |
HY010 |
鍑芥暟椤哄簭閿欒銆 |
522 |
S1011 |
HY011 |
鐜板湪鏃犳硶璁剧疆灞炴с |
523 |
S1012 |
HY012 |
鏃犳晥鐨勪簨鍔℃搷浣滅爜銆 |
524 |
S1013 |
HY013 |
鍐呭瓨绠$悊閿欒銆 |
525 |
S1015 |
HY015 |
鏃犲彲鐢ㄧ殑鍏夋爣鍚嶃 |
526 |
S1024 |
HY024 |
鏃犳晥鐨勫睘鎬у笺 |
527 |
S1090 |
HY090 |
鏃犳晥瀛楃涓叉垨缂撳啿闀垮害銆 |
528 |
S1091 |
HY091 |
鏃犳晥鐨勬弿杩扮瀛楁鏍囪瘑绗︺ |
529 |
S1092 |
HY092 |
鏃犳晥鐨勫睘鎬э紡閫夐」鏍囪瘑绗︺ |
530 |
S1093 |
HY093 |
鏃犳晥鐨勫弬鏁扮紪鍙枫 |
531 |
S1095 |
HY095 |
鍑芥暟绫诲瀷瓒呭嚭鑼冨洿銆 |
532 |
S1106 |
HY106 |
鑾峰彇绫诲瀷瓒呭嚭鑼冨洿銆 |
533 |
S1117 |
HY117 |
琛屽艰秴鍑鸿寖鍥淬 |
534 |
S1109 |
HY109 |
鏃犳晥鐨勫厜鏍囦綅缃 |
535 |
S1C00 |
HYC00 |
鍙夌壒鎬ф湭瀹炴柦銆 |
0 |
21S01 |
21S01 |
鍒楄鏁颁笌鍊艰鏁颁笉鍖归厤銆 |
0 |
23000 |
23000 |
瀹屾暣鎬х害鏉熻繚鍙嶃 |
0 |
42000 |
42000 |
璇硶閿欒鎴栬闂啿绐併 |
0 |
42S02 |
42S02 |
鏈彂鐜板熀鏈〃鎴栬鍥俱 |
0 |
42S12 |
42S12 |
鏈彂鐜扮储寮曘 |
0 |
42S21 |
42S21 |
鍒楀凡瀛樺湪銆 |
0 |
42S22 |
42S22 |
鏈彂鐜板垪銆 |
0 |
08S01 |
08S01 |
閫氫俊閾炬帴澶辫触銆 |
鍦ㄤ笅闈㈢殑ADO锛圓ctiveX鏁版嵁瀵硅薄锛夌ず渚嬩腑锛屽垱寤轰簡琛my_ado锛屽苟婕旂ず浜唕s.addNew銆rs.delete鍜rs.update鐨勭敤娉曘
Private Sub myodbc_ado_Click()
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim fld As ADODB.Field
Dim sql As String
'connect to MySQL server using MySQL ODBC 3.51 Driver锛堜娇鐢∕ySQL ODBC 3.51椹卞姩绋嬪簭杩炴帴鍒癕ySQL鏈嶅姟鍣級
Set conn = New ADODB.Connection
conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};"_
& "SERVER=localhost;"_
& " DATABASE=test;"_
& "UID=venu;PWD=venu; OPTION=3"
conn.Open
'create table锛堝垱寤鸿〃锛
conn.Execute "DROP TABLE IF EXISTS my_ado"
conn.Execute "CREATE TABLE my_ado(id int not null primary key, name varchar(20)," _
& "txt text, dt date, tm time, ts timestamp)"
'direct insert锛堢洿鎺ユ彃鍏ワ級
conn.Execute "INSERT INTO my_ado(id,name,txt) values(1,100,'venu')"
conn.Execute "INSERT INTO my_ado(id,name,txt) values(2,200,'MySQL')"
conn.Execute "INSERT INTO my_ado(id,name,txt) values(3,300,'Delete')"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseServer
'fetch the initial table ..锛堣幏鍙栧垵濮嬭〃鈥︼級
rs.Open "SELECT * FROM my_ado", conn
Debug.Print rs.RecordCount
rs.MoveFirst
Debug.Print String(50, "-") & "Initial my_ado Result Set " & String(50, "-")
For Each fld In rs.Fields
Debug.Print fld.Name,
Next
Debug.Print
Do Until rs.EOF
For Each fld In rs.Fields
Debug.Print fld.Value,
Next
rs.MoveNext
Debug.Print
Loop
rs.Close
'rs insert锛rs鎻掑叆锛
rs.Open "select * from my_ado", conn, adOpenDynamic, adLockOptimistic
rs.AddNew
rs!Name = "Monty"
rs!txt = "Insert row"
rs.Update
rs.Close
'rs update锛rs鏇存柊锛
rs.Open "SELECT * FROM my_ado"
rs!Name = "update"
rs!txt = "updated-row"
rs.Update
rs.Close
'rs update second time..锛rs鏇存柊绗2娆♀︼級
rs.Open "SELECT * FROM my_ado"
rs!Name = "update"
rs!txt = "updated-second-time"
rs.Update
rs.Close
'rs delete锛rs鍒犻櫎锛
rs.Open "SELECT * FROM my_ado"
rs.MoveNext
rs.MoveNext
rs.Delete
rs.Close
'fetch the updated table ..锛堣幏鍙栨洿鏂扮殑琛ㄢ︼級
rs.Open "SELECT * FROM my_ado", conn
Debug.Print rs.RecordCount
rs.MoveFirst
Debug.Print String(50, "-") & "Updated my_ado Result Set " & String(50, "-")
For Each fld In rs.Fields
Debug.Print fld.Name,
Next
Debug.Print
Do Until rs.EOF
For Each fld In rs.Fields
Debug.Print fld.Value,
Next
rs.MoveNext
Debug.Print
Loop
rs.Close
conn.Close
End Sub
Private Sub myodbc_dao_Click()
Dim ws As Workspace
Dim conn As Connection
Dim queryDef As queryDef
Dim str As String
'connect to MySQL server using MySQL ODBC 3.51 Driver锛堜娇鐢∕ySQL ODBC 3.51椹卞姩绋嬪簭杩炴帴鍒癕ySQL锛
Set ws = DBEngine.CreateWorkspace("", "venu", "venu", dbUseODBC)
str = "odbc;DRIVER={MySQL ODBC 3.51 Driver};"_
& "SERVER=localhost;"_
& " DATABASE=test;"_
& "UID=venu;PWD=venu; OPTION=3"
Set conn = ws.OpenConnection("test", dbDriverNoPrompt, False, str)
'Create table my_dao锛堝垱寤鸿〃my_dao锛
Set queryDef = conn.CreateQueryDef("", "drop table if exists my_dao")
queryDef.Execute
Set queryDef = conn.CreateQueryDef("", "create table my_dao(Id INT AUTO_INCREMENT PRIMARY KEY, " _
& "Ts TIMESTAMP(14) NOT NULL, Name varchar(20), Id2 INT)")
queryDef.Execute
'Insert new records using rs.addNew锛堜娇鐢rs.addNew鎻掑叆鏂拌褰曪級
Set rs = conn.OpenRecordset("my_dao")
Dim i As Integer
For i = 10 To 15
rs.AddNew
rs!Name = "insert record" & i
rs!Id2 = i
rs.Update
Next i
rs.Close
'rs update..锛rs鏇存柊锛
Set rs = conn.OpenRecordset("my_dao")
rs.Edit
rs!Name = "updated-string"
rs.Update
rs.Close
'fetch the table back...锛堝悜鍚庤幏鍙栬〃鈥︼級
Set rs = conn.OpenRecordset("my_dao", dbOpenDynamic)
str = "Results:"
rs.MoveFirst
While Not rs.EOF
str = " " & rs!Id & " , " & rs!Name & ", " & rs!Ts & ", " & rs!Id2
Debug.Print "DATA:" & str
rs.MoveNext
Wend
'rs Scrolling锛rs婊氬姩锛
rs.MoveFirst
str = " FIRST ROW: " & rs!Id & " , " & rs!Name & ", " & rs!Ts & ", " & rs!Id2
Debug.Print str
rs.MoveLast
str = " LAST ROW: " & rs!Id & " , " & rs!Name & ", " & rs!Ts & ", " & rs!Id2
Debug.Print str
rs.MovePrevious
str = " LAST-1 ROW: " & rs!Id & " , " & rs!Name & ", " & rs!Ts & ", " & rs!Id2
Debug.Print str
'free all resources锛堥噴鏀炬墍鏈夎祫婧愶級
rs.Close
queryDef.Close
conn.Close
ws.Close
End Sub
Dim rs As rdoResultset
Dim cn As New rdoConnection
Dim cl As rdoColumn
Dim SQL As String
'cn.Connect = "DSN=test;"
cn.Connect = "DRIVER={MySQL ODBC 3.51 Driver};"_
& "SERVER=localhost;"_
& " DATABASE=test;"_
& "UID=venu;PWD=venu; OPTION=3"
cn.CursorDriver = rdUseOdbc
cn.EstablishConnection rdDriverPrompt
'drop table my_rdo锛堣垗寮冭〃my_rdo锛
SQL = "drop table if exists my_rdo"
cn.Execute SQL, rdExecDirect
'create table my_rdo锛堝垱寤鸿〃my_rdo锛
SQL = "create table my_rdo(id int, name varchar(20))"
cn.Execute SQL, rdExecDirect
'insert 鈥 direct锛堟彃鍏ワ紝鐩存帴锛
SQL = "insert into my_rdo values (100,'venu')"
cn.Execute SQL, rdExecDirect
SQL = "insert into my_rdo values (200,'MySQL')"
cn.Execute SQL, rdExecDirect
'rs insert锛rs鎻掑叆锛
SQL = "select * from my_rdo"
Set rs = cn.OpenResultset(SQL, rdOpenStatic, rdConcurRowVer, rdExecDirect)
rs.AddNew
rs!id = 300
rs!Name = "Insert1"
rs.Update
rs.Close
'rs insert锛rs鎻掑叆锛
SQL = "select * from my_rdo"
Set rs = cn.OpenResultset(SQL, rdOpenStatic, rdConcurRowVer, rdExecDirect)
rs.AddNew
rs!id = 400
rs!Name = "Insert 2"
rs.Update
rs.Close
'rs update锛rs鏇存柊锛
SQL = "select * from my_rdo"
Set rs = cn.OpenResultset(SQL, rdOpenStatic, rdConcurRowVer, rdExecDirect)
rs.Edit
rs!id = 999
rs!Name = "updated"
rs.Update
rs.Close
'fetch back...
SQL = "select * from my_rdo"
Set rs = cn.OpenResultset(SQL, rdOpenStatic, rdConcurRowVer, rdExecDirect)
Do Until rs.EOF
For Each cl In rs.rdoColumns
Debug.Print cl.Value,
Next
rs.MoveNext
Debug.Print
Loop
Debug.Print "Row count="; rs.RowCount
'close锛堝叧闂級
rs.Close
cn.Close
End Sub
鍦ㄤ笅闈㈢殑绠鍗曠ず渚嬩腑鍒涘缓浜嗚〃my_odbc_net锛屽苟浠嬬粛浜嗗畠鍦–#涓殑浣跨敤銆
/** * @sample : mycon.cs * @purpose : Demo sample for ODBC.NET using MyODBC * @author : Venu, <venu@mysql.com> * * (C) Copyright MySQL AB, 1995-2004 * **/ /* build command * * csc /t:exe * /out:mycon.exe mycon.cs * /r:Microsoft.Data.Odbc.dll */ using Console = System.Console; using Microsoft.Data.Odbc; namespace myodbc3 { class mycon { static void Main(string[] args) { try { //Connection string for MyODBC 2.50 /*string MyConString = "DRIVER={MySQL};" + "SERVER=localhost;" + "DATABASE=test;" + "UID=venu;" + "PASSWORD=venu;" + "OPTION=3"; */ //Connection string for MyODBC 3.51 string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" + "SERVER=localhost;" + "DATABASE=test;" + "UID=venu;" + "PASSWORD=venu;" + "OPTION=3"; //Connect to MySQL using MyODBC OdbcConnection MyConnection = new OdbcConnection(MyConString); MyConnection.Open(); Console.WriteLine("\n !!! success, connected successfully !!!\n"); //Display connection information Console.WriteLine("Connection Information:"); Console.WriteLine("\tConnection String:" + MyConnection.ConnectionString); Console.WriteLine("\tConnection Timeout:" + MyConnection.ConnectionTimeout); Console.WriteLine("\tDatabase:" + MyConnection.Database); Console.WriteLine("\tDataSource:" + MyConnection.DataSource); Console.WriteLine("\tDriver:" + MyConnection.Driver); Console.WriteLine("\tServerVersion:" + MyConnection.ServerVersion); //Create a sample table OdbcCommand MyCommand = new OdbcCommand("DROP TABLE IF EXISTS my_odbc_net",MyConnection); MyCommand.ExecuteNonQuery(); MyCommand.CommandText = "CREATE TABLE my_odbc_net(id int, name varchar(20), idb bigint)"; MyCommand.ExecuteNonQuery(); //Insert MyCommand.CommandText = "INSERT INTO my_odbc_net VALUES(10,'venu', 300)"; Console.WriteLine("INSERT, Total rows affected:" + MyCommand.ExecuteNonQuery());; //Insert MyCommand.CommandText = "INSERT INTO my_odbc_net VALUES(20,'mysql',400)"; Console.WriteLine("INSERT, Total rows affected:" + MyCommand.ExecuteNonQuery()); //Insert MyCommand.CommandText = "INSERT INTO my_odbc_net VALUES(20,'mysql',500)"; Console.WriteLine("INSERT, Total rows affected:" + MyCommand.ExecuteNonQuery()); //Update MyCommand.CommandText = "UPDATE my_odbc_net SET id=999 WHERE id=20"; Console.WriteLine("Update, Total rows affected:" + MyCommand.ExecuteNonQuery()); //COUNT(*) MyCommand.CommandText = "SELECT COUNT(*) as TRows FROM my_odbc_net"; Console.WriteLine("Total Rows:" + MyCommand.ExecuteScalar()); //Fetch MyCommand.CommandText = "SELECT * FROM my_odbc_net"; OdbcDataReader MyDataReader; MyDataReader = MyCommand.ExecuteReader(); while (MyDataReader.Read()) { if(string.Compare(MyConnection.Driver,"myodbc3.dll") == 0) { Console.WriteLine("Data:" + MyDataReader.GetInt32(0) + " " + MyDataReader.GetString(1) + " " + MyDataReader.GetInt64(2)); //Supported only by MyODBC 3.51 } else { Console.WriteLine("Data:" + MyDataReader.GetInt32(0) + " " + MyDataReader.GetString(1) + " " + MyDataReader.GetInt32(2)); //BIGINTs not supported by MyODBC } } //Close all resources MyDataReader.Close(); MyConnection.Close(); } catch (OdbcException MyOdbcException)//Catch any ODBC exception .. { for (int i=0; i < MyOdbcException.Errors.Count; i++) { Console.Write("ERROR #" + i + "\n" + "Message: " + MyOdbcException.Errors[i].Message + "\n" + "Native: " + MyOdbcException.Errors[i].NativeError.ToString() + "\n" + "Source: " + MyOdbcException.Errors[i].Source + "\n" + "SQL: " + MyOdbcException.Errors[i].SQLState + "\n"); } } } } }
鍦ㄤ笅闈㈢殑绠鍗曠ず渚嬩腑鍒涘缓浜嗚〃my_vb_net锛屽苟浠嬬粛浜嗗畠鍦╒B涓殑鐢ㄦ硶銆
' @sample : myvb.vb ' @purpose : Demo sample for ODBC.NET using MyODBC ' @author : Venu, <venu@mysql.com> ' ' (C) Copyright MySQL AB, 1995-2004 ' ' ' ' build command ' ' vbc /target:exe ' /out:myvb.exe ' /r:Microsoft.Data.Odbc.dll ' /r:System.dll ' /r:System.Data.dll ' Imports Microsoft.Data.Odbc Imports System Module myvb Sub Main() Try 'MyODBC 3.51 connection string Dim MyConString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _ "SERVER=localhost;" & _ "DATABASE=test;" & _ "UID=venu;" & _ "PASSWORD=venu;" & _ "OPTION=3;" 'Connection Dim MyConnection As New OdbcConnection(MyConString) MyConnection.Open() Console.WriteLine ("Connection State::" & MyConnection.State.ToString) 'Drop Console.WriteLine ("Dropping table") Dim MyCommand As New OdbcCommand() MyCommand.Connection = MyConnection MyCommand.CommandText = "DROP TABLE IF EXISTS my_vb_net" MyCommand.ExecuteNonQuery() 'Create Console.WriteLine ("Creating....") MyCommand.CommandText = "CREATE TABLE my_vb_net(id int, name varchar(30))" MyCommand.ExecuteNonQuery() 'Insert MyCommand.CommandText = "INSERT INTO my_vb_net VALUES(10,'venu')" Console.WriteLine("INSERT, Total rows affected:" & MyCommand.ExecuteNonQuery()) 'Insert MyCommand.CommandText = "INSERT INTO my_vb_net VALUES(20,'mysql')" Console.WriteLine("INSERT, Total rows affected:" & MyCommand.ExecuteNonQuery()) 'Insert MyCommand.CommandText = "INSERT INTO my_vb_net VALUES(20,'mysql')" Console.WriteLine("INSERT, Total rows affected:" & MyCommand.ExecuteNonQuery()) 'Insert MyCommand.CommandText = "INSERT INTO my_vb_net(id) VALUES(30)" Console.WriteLine("INSERT, Total rows affected:" & MyCommand.ExecuteNonQuery()) 'Update MyCommand.CommandText = "UPDATE my_vb_net SET id=999 WHERE id=20" Console.WriteLine("Update, Total rows affected:" & MyCommand.ExecuteNonQuery()) 'COUNT(*) MyCommand.CommandText = "SELECT COUNT(*) as TRows FROM my_vb_net" Console.WriteLine("Total Rows:" & MyCommand.ExecuteScalar()) 'Select Console.WriteLine ("Select * FROM my_vb_net") MyCommand.CommandText = "SELECT * FROM my_vb_net" Dim MyDataReader As OdbcDataReader MyDataReader = MyCommand.ExecuteReader While MyDataReader.Read If MyDataReader("name") Is DBNull.Value Then Console.WriteLine ("id = " & CStr(MyDataReader("id")) & " name = " & _ "NULL") Else Console.WriteLine ("id = " & CStr(MyDataReader("id")) & " name = " & _ CStr(MyDataReader("name"))) End If End While 'Catch ODBC Exception Catch MyOdbcException As OdbcException Dim i As Integer Console.WriteLine (MyOdbcException.ToString) 'Catch program exception Catch MyException As Exception Console.WriteLine (MyException.ToString) End Try End Sub End Module
MySQL Connector/NET鍖呮嫭瀵逛笅杩颁簨瀹滅殑瀹屾暣鏀寔锛
路 MySQL 5.0鐗规э紙瀛樺偍绋嬪簭绛夛級銆
路 MySQL 4.1鐗规э紙鏈嶅姟鍣ㄧ鐨勭簿鍒惰鍙ャ乁nicode銆佷互鍙婂叡浜唴瀛樿闂瓑锛夈
路 澶т俊鎭寘鏀寔锛屽彲鍙戦佸拰鎺ユ敹楂樿揪2GB鐨勮鍜孊LOB銆
路 鍗忚鍘嬬缉锛屽厑璁稿帇缂╁鎴风鍜屾湇鍔″櫒涔嬮棿鐨勬暟鎹祦銆
路 鏀寔浣跨敤CP/IP濂楁帴瀛椼佸懡鍚嶇閬撱佷互鍙奧indows鍏变韩鍐呭瓨鐨勮繛鎺ャ
路 鏀寔浣跨敤CP/IP濂楁帴瀛椼佹垨Unix濂楁帴瀛楃殑杩炴帴銆
路 鏀寔鐢盢ovell寮鍙戠殑寮鏀炬簮鐮丮ono妗嗘灦銆
路 鍙畬鍏ㄧ鐞嗭紝涓嶅埄鐢∕ySQL瀹㈡埛绔簱銆
MySQL Connector/NET鐨勫紑鍙戜汉鍛橀珮搴﹀皧閲嶇敤鎴峰湪杞欢寮鍙戣繃绋嬩腑鎻愪緵鐨勫府鍔┿傚鏋滀綘鍙戠幇MySQL Connector/NET缂哄皯瀵逛綘鏉ヨ寰堥噸瑕佺殑鏌愪簺鐗规э紝鎴栬呭鏋滀綘鍙戠幇浜嗙己闄凤紝璇蜂娇鐢ㄦ垜浠殑MySQL缂洪櫡绯荤粺璇锋眰璇ョ壒鎬ф垨閫氭姤闂銆
閫氳繃http://forums.mysql.com涓婄殑璁哄潧浠ュ強http://lists.mysql.com涓婄殑閭欢鍒楄〃锛屽彲鎵惧埌閽堝MySQL Connector/NET鐨勭ぞ鍖烘敮鎸佷俊鎭侻ySQL AB鍏徃鎻愪緵浠樿垂鏀寔锛屾洿澶氫俊鎭鍙傝http://www.mysql.com/support/銆
鏈枃妗g殑鐩殑鏄綔涓篗ySQL Connector/NET鐨勭敤鎴锋寚鍗楋紝鑰屼笉鏄娉曞弬鑰冦傚鏋滀綘鎵撶畻浜嗚В璇︾粏鐨勮娉曚俊鎭紝璇烽槄璇籑ySQL Connector/NET鍒嗗彂鐗堜腑鎻愪緵鐨Documentation.chm鏂囦欢銆
MySQL Connector/NET鑳藉杩愯鍦ㄤ换浣曟敮鎸.NET妗嗘灦鐨勫钩鍙颁笂銆.NET妗嗘灦涓昏琚渶杩戠殑Microsoft Windows鐗堟湰鏀寔锛岄氳繃鐢盢ovell寮鍙戠殑Mono妗嗘灦锛屽湪Linux涓婁篃鏀寔瀹冿紙璇峰弬瑙http://www.mono-project.com锛夈
MySQL Connector/NET鍙氳繃浣跨敤Windows Installer (.msi)瀹夎杞欢鍖呰繘琛屽畨瑁咃紝浣跨敤璇ヨ蒋浠跺寘锛屽彲鍦ㄤ换浣昗indows鎿嶄綔绯荤粺涓婂畨瑁匨ySQL Connector/NET銆侻SI杞欢鍖呭寘鍚湪鍚嶄负mysql-connector-net-version.zip鐨勫帇缂╂枃浠朵腑锛屽叾涓紝鈥version鈥锛堢増鏈級鎸囨槑浜MySQL Connector/NET鐨勭増鏈
鍙粠涓嬭堪缃戠珯涓嬭浇MySQL Connector/NET锛http://dev.mysql.com/downloads/connector/net/1.0.html銆
闅忕潃Windows XP鐨勫彂甯冿紝Windows Installer锛堝畨瑁呭櫒锛夊紩鎿庝篃浜堜互浜嗘洿鏂帮紝瀵逛簬浣跨敤鏃х増鏈殑鐢ㄦ埛锛屽彲鍙傞槄璇icrosoft鐭ヨ瘑搴撴枃绔浠ヤ簡瑙e崌绾ц嚦鏈鏂扮増鏈殑鏇村淇℃伅銆
瑕佹兂瀹夎MySQL Connector/NET锛岃鍙冲嚮MSI鏂囦欢骞堕夋嫨鈥滃畨瑁呪濄傚湪瀹夎鍣ㄦ彁绀轰綘瀹屾垚瀹夎鍙傛暟閫夋嫨鍚庯紝瀹夎灏嗚嚜鍔ㄥ紑濮嬨傚浜庡ぇ澶氭暟鐢ㄦ埛锛屽缓璁噰鐢ㄥ吀鍨嬪畨瑁呫
濡傛灉鍦ㄨ繍琛屽畨瑁呭櫒鏃堕亣鍒伴棶棰橈紝鍙笅杞戒笉甯﹀畨瑁呭櫒鐨刏IP鏂囦欢銆傝鏂囦欢鍚嶄负mysql-connector-net-version-noinstall.zip銆備娇鐢╖IP绋嬪簭锛屽皢鍏惰В鍘嬭嚦浣犳墍閫夋嫨鐨勭洰褰曘
闄ら潪浣滀簡鍏朵粬閫夋嫨锛屽惁鍒橫ySQL Connector/NET灏嗚瀹夎鍒扳C:\Program Files\MySQL\MySQL Connector Net X.X.X鈥濓紝鍏朵腑锛屸X.X.X鈥濇槸浣犳墍瀹夎鐨凪ySQL Connector/NET鐨勭増鏈彿銆傛柊瀹夎涓嶄細瑕嗙洊宸叉湁鐨凪ySQL Connector/NET鐗堟湰銆
涓嬮潰浠嬬粛浜哅ySQL Connector/NET鐨勪富瑕佺被锛
路 MySqlCommand锛氫唬琛ㄥMySQL鏁版嵁搴撹繘琛屾墽琛屾搷浣滅殑SQL璇彞銆
路 MySqlCommandBuilder锛氳嚜鍔ㄧ敓鎴愬崟涓〃鐨勫懡浠わ紝鐢ㄤ簬鍗忚皟瀵笵ataSet鎵浣滅殑鏇存敼鍜岀浉鍏崇殑MySQL鏁版嵁搴撱
路 MySqlConnection锛氫唬琛ㄤ笌MySQL鏈嶅姟鍣ㄦ暟鎹簱鐨勫紑鏀惧紡杩炴帴銆
路 MySqlDataAdapter锛氫唬琛ㄤ竴缁勬暟鎹懡浠ゅ拰鏁版嵁搴撹繛鎺ワ紝鐢ㄤ簬濉厖鏁版嵁搴撳拰鏇存柊MySQL鏁版嵁搴撱
路 MySqlDataReader锛氭彁渚涗簡浠嶮ySQL鏁版嵁搴撹鍙栬鐨勨滀粎姝e悜鈥濇祦鐨勪竴绉嶆柟寮忋
路 MySqlException锛氬綋MySQL杩斿洖閿欒鏃舵姏鍑虹殑寮傚父銆
路 MySqlHelper锛氬姪鎵嬬被锛岃兘浣垮伐浣滃彉鐨勬洿绠鍗曘
路 MySqlTransaction锛氫唬琛ㄥ皢鍦∕ySQL鏁版嵁搴撲腑杩涜鐨凷QL浜嬪姟銆
鍦ㄥ悗缁钀戒腑锛屽皢鍒嗗埆浠嬬粛杩欎簺瀵硅薄銆傝繖浜涚珷鑺傜殑鐩殑鏄瑕佷粙缁峂ySQL Connector/NET鐨勪富瑕佺被锛岃屼笉鏄娉曞弬鑰冦傚鏋滀綘鎵撶畻浜嗚В璇︾粏鐨勮娉曚俊鎭紝璇烽槄璇籑ySQL Connector/NET鍒嗗彂鐗堜腑鎻愪緵鐨Documentation.chm鏂囦欢銆
MySqlCommand绫浠h〃瀵筂ySQL鏁版嵁搴撹繘琛屾墽琛屾搷浣滅殑SQL璇彞銆
娉ㄩ噴锛鍦ㄤ互鍓嶇殑鐗堟湰涓紝閲囩敤绗﹀彿鈥淍鈥濇潵鏍囪瘑SQL涓殑鍙傛暟銆傚畠涓嶮ySQL鐢ㄦ埛鍙橀噺涓嶅吋瀹癸紝鍥犳锛岀幇閲囩敤绗﹀彿鈥?鈥濇潵瀹氫綅SQL涓殑鍙傛暟銆備负浜嗘敮鎸佹棭鏈熶唬鐮侊紝涔熷彲浠ュ湪杩炴帴瀛楃涓蹭腑璁剧疆鈥渙ld syntax=yes鈥濄傚鏋滆繘琛屼簡杩欑被璁剧疆锛岃娉ㄦ剰锛屽鏋滄棤娉曞畾涔夊笇鏈涘湪SQL涓娇鐢ㄧ殑鍙傛暟锛堝畾涔夊け璐ワ級锛屼笉浼氱粰鍑哄紓甯告彁绀恒
路 CommandText锛氳幏鍙栨垨璁剧疆灏嗗湪鏁版嵁婧愪笂鎵ц鐨凷QL璇彞銆
路 CommandTimeout锛氳幏鍙栨垨璁剧疆涓鎵ц鍛戒护骞剁敓鎴愰敊璇箣鍓嶅簲绛夊緟鐨勬椂闂淬
路 CommandType锛氳幏鍙栨垨璁剧疆鍊硷紝璇ュ兼寚鏄庝簡瑙i噴CommandText鐨勬柟寮忋傚彲鑳界殑鍊煎寘鎷StoredProcedure銆TableDirect鍜Text銆
路 Connection锛氳幏鍙栨垨璁剧疆璇ySqlCommand瀹炰緥浣跨敤鐨凪ySqlConnection銆
路 IsPrepared锛氬鏋滆鍛戒护宸插噯澶囧ソ锛屼负鈥滅湡鈥濓紝鍚﹀垯涓衡滃亣鈥濄
路 Parameters锛氳幏鍙朚ySqlParameterCollection銆
路 Transaction锛氳幏鍙栨垨璁剧疆MySqlTransaction锛孧ySqlCommand灏嗗湪鍏朵腑鎵ц銆
路 UpdatedRowSource锛氬綋DbDataAdapter鐨刄pdate鏂规硶浣跨敤瀹冩椂锛岀敤浜庤幏鍙栨垨璁剧疆鍛戒护缁撴灉浣滅敤鍦―ataRow涓婄殑鏂瑰紡銆
路 Cancel锛氬皾璇曞彇娑圡ySqlCommand鐨勬墽琛屻涓嶆敮鎸佽鎿嶄綔銆
路 Clone锛氬垱寤鸿MySqlCommand瀵硅薄鐨勫厠闅嗗璞°傚寘鎷珻ommandText銆丆onnection鍜孴ransaction灞炴э紝浠ュ強鏁翠釜鍙傛暟鍒楄〃銆
路 CreateParameter锛氬垱寤篗ySqlParameter瀵硅薄鐨勬柊瀹炰緥銆
路 Dispose锛氬鐞嗚MySqlCommand瀹炰緥銆
路 ExecuteNonQuery锛氭牴鎹繛鎺ユ儏鍐垫墽琛孲QL璇彞锛屽苟杩斿洖鍙楀奖鍝嶇殑琛屾暟銆
路 ExecuteReader锛氬皢CommandText鍙戦佺粰Connection锛屽苟鍒涘缓MySqlDataReader銆
路 ExecuteScalar锛氭墽琛屾煡璇紝骞惰繑鍥炴煡璇㈡搷浣滄墍杩斿洖鐨勭粨鏋滈泦涓1琛岀殑绗1鍒椼傚浣欑殑鍒楁垨琛屽皢琚拷鐣ャ
路 Prepare锛氬湪MySQL鏈嶅姟鍣ㄧ殑1涓疄渚嬩笂鍒涘缓鍛戒护鐨勯鍒剁増鏈
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦╒B.NET涓娇鐢∕ySqlCommand绫荤殑鏂规硶锛
Public Sub InsertRow(myConnectionString As String) ' If the connection string is null, use a default. If myConnectionString = "" Then myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass" End If Dim myConnection As New MySqlConnection(myConnectionString) Dim myInsertQuery As String = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)" Dim myCommand As New MySqlCommand(myInsertQuery) myCommand.Connection = myConnection myConnection.Open() myCommand.ExecuteNonQuery() myCommand.Connection.Close() End Sub
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦–#涓娇鐢∕ySqlCommand绫荤殑鏂规硶锛
public void InsertRow(string myConnectionString) { // If the connection string is null, use a default. if(myConnectionString == "") { myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass"; } MySqlConnection myConnection = new MySqlConnection(myConnectionString); string myInsertQuery = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)"; MySqlCommand myCommand = new MySqlCommand(myInsertQuery); myCommand.Connection = myConnection; myConnection.Open(); myCommand.ExecuteNonQuery(); myCommand.Connection.Close(); }
MySqlDataAdapter涓嶄細鑷姩鐢熸垚鎵闇鐨凷QL璇彞锛堢敤浜庡崗璋冨DataSet鎵浣滅殑鏇存敼鍜岀浉鍏崇殑MySQL瀹炰緥锛夈備絾鏄紝濡傛灉璁剧疆浜哅ySqlDataAdapter鐨凷electCommand灞炴э紝鍙互鍒涘缓MySqlCommandBuilder瀵硅薄鏉ヨ嚜鍔ㄧ敓鎴愰拡瀵瑰崟涓〃鏇存柊鐨凷QL璇彞銆傞殢鍚庯紝MySqlCommandBuilder灏嗙敓鎴愪綘鏈缃殑浠讳綍闄勫姞鐨凷QL璇彞銆
涓鏃︿綘璁剧疆浜咲ataAdapter灞炴э紝MySqlCommandBuilder浼氬皢鑷繁娉ㄥ唽涓洪拡瀵筄nRowUpdating浜嬩欢鐨勭洃鍚▼搴忋備竴娆″彧鑳藉皢1涓狹ySqlDataAdapter鎴朚ySqlCommandBuilder瀵硅薄鍏宠仈璧锋潵銆
涓轰簡鐢熸垚INSERT銆乁PDATE鎴朌ELETE璇彞锛孧ySqlCommandBuilder浣跨敤浜哠electCommand灞炴ф潵鑷姩妫绱㈡墍闇鐨勫厓鏁版嵁闆嗗悎銆傚鏋滃湪妫绱㈠畬鍏冩暟鎹悗鏇存敼浜哠electCommand锛堜緥濡傞娆℃洿鏂板悗锛夛紝搴旇皟鐢≧efreshSchema鏂规硶鏉ユ洿鏂板厓鏁版嵁銆
SelectCommand涔熷繀椤昏繑鍥炶嚦灏1涓富閿垨鍞竴鍒椼傚鏋滄湭鏄剧ず浠讳綍杩斿洖淇℃伅锛屽皢鐢熸垚InvalidOperation寮傚父锛岃屼笖涓嶄細鐢熸垚鍛戒护銆
MySqlCommandBuilder杩樹細浣跨敤SelectCommand寮曠敤鐨凜onnection銆丆ommandTimeout鍜孴ransaction灞炴с傚鏋滄洿鏀逛簡杩欎簺灞炴т腑鐨勪换浣1涓紝鎴栬咃紝濡傛灉鏇挎崲浜哠electCommand鏈韩锛岀敤鎴峰簲璋冪敤RefreshSchema銆傚涓嶇劧锛孖nsertCommand銆乁pdateCommand鍜孌eleteCommand灞炴у皢淇濇寔瀹冧滑浠ュ墠鐨勫笺
濡傛灉璋冪敤浜咲ispose锛孧ySqlCommandBuilder灏嗚В闄や笌MySqlDataAdapter鐨勫叧鑱旓紝宸茬敓鎴愮殑鍛戒护灏嗕笉鍐嶄娇鐢ㄣ
鍙敤灞炴у涓嬶細
路 DataAdapter锛歁ySqlCommandBuilder灏嗚嚜宸辨敞鍐屼负閽堝RowUpdating浜嬩欢鐨勭洃鍚▼搴忥紝RowUpdating浜嬩欢鏄敱鍦ㄨ灞炴т腑鎸囧畾鐨凪ySqlDataAdapter鐢熸垚鐨勩傚垱寤轰簡鏂扮殑MySqlCommandBuilder瀹炰緥鏃讹紝灏嗛噴鏀句换浣曞凡鏈夌殑涓嶮ySqlDataAdapter鍏宠仈鐨凪ySqlCommandBuilder銆
路 QuotePrefix, QuoteSuffix锛歁ySQL涓殑鏁版嵁搴撳璞¤兘澶熷寘鍚壒娈婂瓧绗︼紝濡傜┖鏍肩瓑锛岃繖浼氫娇寰楁甯哥殑SQL瀛楃涓叉棤娉曡В鏋愩備娇鐢≦uotePrefix鍜孮uoteSuffix灞炴э紝MySqlCommandBuilder鑳藉鍒涘缓澶勭悊璇ラ棶棰樼殑SQL鍛戒护銆
鍙敤鏂规硶濡備笅锛
路 DeriveParameters锛氫粠MySqlCommand鎸囧畾鐨勫瓨鍌ㄧ▼搴忎腑妫绱㈠弬鏁颁俊鎭紝骞跺~鍏呮墍鎸囧畾MySqlCommand瀵硅薄鐨勫弬鏁伴泦銆傜洰鍓嶄笉鏀寔璇ユ柟娉曪紝杩欐槸鍥犱负MySQL涓湭鎻愪緵瀛樺偍绋嬪簭銆
路 GetDeleteCommand锛氳幏鍙栫敤浜庡湪鏁版嵁搴撲笂鎵ц鍒犻櫎鎿嶄綔鎵闇鐨勩佽嚜鍔ㄧ敓鎴愮殑MySqlCommand瀵硅薄銆
路 GetInsertCommand锛氳幏鍙栫敤浜庡湪鏁版嵁搴撲笂鎵ц鎻掑叆鎿嶄綔鎵闇鐨勩佽嚜鍔ㄧ敓鎴愮殑MySqlCommand瀵硅薄銆
路 GetUpdateCommand锛氳幏鍙栫敤浜庡湪鏁版嵁搴撲笂鎵ц鏇存柊鎿嶄綔鎵闇鐨勩佽嚜鍔ㄧ敓鎴愮殑MySqlCommand瀵硅薄銆
路 RefreshSchema锛氬埛鏂扮敤浜庣敓鎴怚NSERT銆乁PDATE鎴朌ELETE璇彞鐨勬暟鎹簱鏂规淇℃伅銆
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦╒B.NET涓娇鐢∕ySqlCommandBuilder绫荤殑鏂规硶锛
Public Shared Function SelectRows(myConnection As String, mySelectQuery As String, myTableName As String) As DataSet Dim myConn As New MySqlConnection(myConnection) Dim myDataAdapter As New MySqlDataAdapter() myDataAdapter.SelectCommand = New MySqlCommand(mySelectQuery, myConn) Dim cb As SqlCommandBuilder = New MySqlCommandBuilder(myDataAdapter) myConn.Open() Dim ds As DataSet = New DataSet myDataAdapter.Fill(ds, myTableName) ' Code to modify data in DataSet here ' Without the MySqlCommandBuilder this line would fail. myDataAdapter.Update(ds, myTableName) myConn.Close() End Function 'SelectRows
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦–#涓娇鐢∕ySqlCommandBuilder绫荤殑鏂规硶锛
public static DataSet SelectRows(string myConnection, string mySelectQuery, string myTableName) { MySqlConnection myConn = new MySqlConnection(myConnection); MySqlDataAdapter myDataAdapter = new MySqlDataAdapter(); myDataAdapter.SelectCommand = new MySqlCommand(mySelectQuery, myConn); MySqlCommandBuilder cb = new MySqlCommandBuilder(myDataAdapter); myConn.Open(); DataSet ds = new DataSet(); myDataAdapter.Fill(ds, myTableName); //code to modify data in DataSet here //Without the MySqlCommandBuilder this line would fail myDataAdapter.Update(ds, myTableName); myConn.Close(); return ds; }
MySqlConnection瀵硅薄浠h〃涓嶮ySQL鏈嶅姟鍣ㄦ暟鎹簮鐨勪細璇濄傚垱寤篗ySqlConnection瀹炰緥鏃讹紝鎵鏈夊睘鎬у潎灏嗚璁剧疆涓哄畠浠殑鍒濆鍊笺傚叧浜庤繖浜涘肩殑鍒楄〃锛岃鍙傝MySqlConnection鏋勯犲嚱鏁般
濡傛灉MySqlConnection瓒呭嚭鑼冨洿锛屼笉浼氳鍏抽棴銆傚洜姝わ紝蹇呴』閫氳繃璋冪敤Close鎴朌ispose鏄庣‘鍦板叧闂繛鎺ャ
路 ConnectionString锛氳缃垨鑾峰彇鐢ㄤ簬杩炴帴鑷矼ySQL鏈嶅姟鍣ㄦ暟鎹簱鐨勫瓧绗︿覆銆
路 ConnectionTimeout锛氳幏鍙栧湪涓灏濊瘯骞剁敓鎴愰敊璇箣鍓嶄负寤虹珛杩炴帴鎵闇鐨勭瓑寰呮椂闂淬
路 Database锛氳幏鍙栧綋鍓嶆暟鎹簱鐨勫悕绉版垨鎵撳紑杩炴帴鍚庡皢浣跨敤鐨勬暟鎹簱鐨勫悕绉般
路 DataSource锛氳幏鍙栧皢瑕佽繛鎺ョ殑MySQL鏈嶅姟鍣ㄧ殑鍚嶇О銆
路 ServerThread锛氳繑鍥炶杩炴帴鎵浣跨敤鐨勬湇鍔″櫒绾跨▼鐨処D銆
路 ServerVersion锛氳幏鍙栧寘鍚鎴风涓庝箣鐩歌繛鐨凪ySQL鏈嶅姟鍣ㄧ増鏈殑瀛楃涓层
路 State锛氳幏鍙栬繛鎺ョ殑褰撳墠杩炴帴鐨勭姸鎬併
路 UseConnection锛氫笌鏈嶅姟鍣ㄨ繘琛岄氫俊鏃讹紝鎸囨槑璇ヨ繛鎺ユ槸鍚﹀皢浣跨敤鍘嬬缉鐗规с
路 BeginTransaction锛氬紑濮嬫暟鎹簱浜嬪姟銆
路 ChangeDatabase锛氶拡瀵规墦寮鐨凪ySqlConnection锛屾洿鏀瑰綋鍓嶆暟鎹簱銆
路 Close锛氬叧闂笌鏁版嵁搴撶殑杩炴帴銆傝繖鏄叧闂换浣曟墦寮杩炴帴鐨勯閫夋柟娉曘
路 CreateCommand锛氬垱寤哄苟杩斿洖涓嶮ySqlConnection鐩稿叧鐨凪ySqlCommand瀵硅薄銆
路 Dispose锛氶噴鏀綧ySqlConnection浣跨敤鐨勮祫婧愩
路 Open锛氱敤ConnectionString鎸囧畾鐨勫睘鎬ц缃墦寮鏁版嵁搴撹繛鎺ャ
路 Ping锛氬MySQL鏈嶅姟鍣ㄦ墽琛孭ing鎿嶄綔銆
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦╒B.NET涓娇鐢∕ySqlConnection绫荤殑鏂规硶锛
Public Sub InsertRow(myConnectionString As String) ' If the connection string is null, use a default. If myConnectionString = "" Then myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass" End If Dim myConnection As New MySqlConnection(myConnectionString) Dim myInsertQuery As String = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)" Dim myCommand As New MySqlCommand(myInsertQuery) myCommand.Connection = myConnection myConnection.Open() myCommand.ExecuteNonQuery() myCommand.Connection.Close() End Sub
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦–#涓娇鐢∕ySqlConnection绫荤殑鏂规硶锛
public void InsertRow(string myConnectionString) { // If the connection string is null, use a default. if(myConnectionString == "") { myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass"; } MySqlConnection myConnection = new MySqlConnection(myConnectionString); string myInsertQuery = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)"; MySqlCommand myCommand = new MySqlCommand(myInsertQuery); myCommand.Connection = myConnection; myConnection.Open(); myCommand.ExecuteNonQuery(); myCommand.Connection.Close(); }
褰揗ySQLDataAdapter濉厖DataSet鏃讹紝濡傛灉琛ㄦ垨鍒椾笉瀛樺湪锛屽畠灏嗕负杩斿洖鐨勬暟鎹垱寤哄繀瑕佺殑琛ㄥ拰鍒椼備絾鏄紝鍦ㄩ殣寮忓垱寤虹殑鏂规涓笉鍖呮嫭涓婚敭淇℃伅锛岄櫎闈炲皢MissingSchemaAction灞炴ц涓篈ddWithKey銆傚湪浣跨敤FillSchema鐢ㄦ暟鎹~鍏呭畠涔嬪墠锛屼篃鑳借MySQLDataAdapter鍒涘缓DataSet鏂规锛屽寘鍚富閿俊鎭
MySQLDataAdapter鐢ㄤ簬MySqlConnection鍜孧ySqlCommand鐨勮繛鎺ワ紝鐢ㄤ互鎻愬崌杩炴帴鑷矼ySQL鏁版嵁搴撴椂鐨勬ц兘銆
MySQLDataAdapter杩樺寘鎷琒electCommand銆両nsertCommand銆丏eleteCommand銆乁pdateCommand鍜孴ableMappings灞炴э紝鐢ㄤ簬绠鍖栨暟鎹殑鍔犺浇鍜屾洿鏂版搷浣溿
鍙敤灞炴у涓嬶細
路 AcceptChangesDuringFill锛氳幏鍙栨垨璁剧疆鍊硷紝璇ュ兼寚鏄庝簡鍦ㄤ换浣曞~鍏呮搷浣滆繃绋嬩腑锛屽湪灏咲ataRow娣诲姞鍒癉ataTable鍚庯紝鏄惁瑕佸湪DataRow涓婅皟鐢ˋcceptChanges銆
路 ContinueUpdateOnError锛氳幏鍙栨垨璁剧疆鍊硷紝璇ュ兼寚瀹氫簡鍦ㄨ鏇存柊杩囩▼涓嚭鐜伴敊璇椂鏄惁瑕佺敓鎴愬紓甯搁」銆
路 DeleteCommand锛氳幏鍙栨垨璁剧疆鐢ㄤ簬灏嗚褰曚粠鏁版嵁闆嗕腑鍒犻櫎鐨凷QL璇彞鎴栧瓨鍌ㄧ▼搴忋
路 InsertCommand锛氳幏鍙栨垨璁剧疆鐢ㄤ簬鍦ㄦ暟鎹泦涓彃鍏ヨ褰曠殑SQL璇彞鎴栧瓨鍌ㄧ▼搴忋
路 MissingMappingAction锛氱‘瀹氬綋杩涘叆鐨勬暟鎹笉鍚尮閰嶈〃鎴栧垪鏃堕渶瑕侀噰鍙栫殑鍔ㄤ綔銆
路 MissingSchemaAction锛氱‘瀹氬綋宸叉湁鐨凞ataSet鏂规涓庤繘鍏ユ暟鎹笉鍖归厤鏃堕渶瑕侀噰鍙栫殑鍔ㄤ綔銆
路 SelectCommand锛氳幏鍙栨垨璁剧疆鐢ㄤ簬鍦ㄦ暟鎹簮涓夋嫨璁板綍鐨凷QL璇彞鎴栧瓨鍌ㄧ▼搴忋
路 TableMappings锛氳幏鍙栨彁渚涗簡婧愯〃鍜孌ataTable涔嬮棿涓绘槧灏勭殑闆嗗悎銆
路 UpdateCommand锛氳幏鍙栨垨璁剧疆鐢ㄤ簬鍦ㄦ暟鎹簮涓洿鏂拌褰曠殑SQL璇彞鎴栧瓨鍌ㄧ▼搴忋
路 Fill锛氫娇鐢―ataSet鍚嶇О娣诲姞鎴栧埛鏂癉ataSet涓殑琛岋紝浠ヤ究涓庢暟鎹簮涓殑琛屽尮閰嶏紝骞跺垱寤哄悕涓衡淭able鈥濈殑DataTable銆
路 FillSchema锛氬皢鍚嶄负鈥淭able鈥濈殑DataTable娣诲姞鍒版寚瀹氱殑DataSet锛屽苟閰嶇疆鏂规锛屼互渚夸笌鍩轰簬鎸囧畾SchemaType鐨勬暟鎹簮涓殑琛ㄥ尮閰嶃
路 GetFillParameters锛氭墽琛孲QL SELECT璇彞鏃讹紝鎸夌敤鎴疯幏鍙栧弬鏁伴泦銆
路 Update锛氫负鎸囧畾DataSet涓殑鍚勬彃鍏ヨ銆佹洿鏂拌鎴栧垹闄よ鍒嗗埆璋冪敤INSERT銆乁PDATE鎴朌ELETE璇彞銆
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦╒B.NET涓娇鐢∕ySqlDataAdapter绫荤殑鏂规硶锛
Public Function SelectRows(dataSet As DataSet, connection As String, query As String) As DataSet Dim conn As New MySqlConnection(connection) Dim adapter As New MySqlDataAdapter() adapter.SelectCommand = new MySqlCommand(query, conn) adapter.Fill(dataset) Return dataset End Function
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦–#涓娇鐢∕ySqlDataAdapter绫荤殑鏂规硶锛
public DataSet SelectRows(DataSet dataset,string connection,string query) { MySqlConnection conn = new MySqlConnection(connection); MySqlDataAdapter adapter = new MySqlDataAdapter(); adapter.SelectCommand = new MySqlCommand(query, conn); adapter.Fill(dataset); return dataset; }
瑕佹兂鍒涘缓MySQLDataReader锛屽繀椤昏皟鐢∕ySqlCommand瀵硅薄鐨凟xecuteReader鏂规硶锛岃屼笉鏄洿鎺ヤ娇鐢ㄦ瀯閫犲嚱鏁般
浣跨敤MySqlDataReader鐨勫悓鏃讹紝鐩稿叧鐨凪ySqlConnection灏嗗繖浜嶮ySqlDataReader銆傞櫎浜嗗叧闂畠涔嬪锛屼笉鑳藉湪MySqlConnection涓婃墽琛屼换浣曟搷浣溿傝鎯呭喌灏嗕竴鐩存寔缁埌璋冪敤浜哅ySqlDataReader鐨勨淐lose鈥濇柟娉曚负姝€
鍏抽棴浜哅ySqlDataReader鍚庯紝浣犲彧鑳借皟鐢↖sClosed鍜孯ecordsAffected灞炴с傚敖绠″湪MySqlDataReader瀛樺湪鍚屾椂鑳藉璁块棶RecordsAffected灞炴э紝浣嗗湪杩斿洖RecordsAffected鐨勫间箣鍓嶆诲簲璋冪敤鈥淐lose鈥濓紝浠ョ‘淇濆噯纭殑杩斿洖鍊笺
涓轰簡鑾峰緱鏈浣虫ц兘锛孧ySqlDataReader灏嗛伩鍏嶅垱寤轰笉蹇呰鐨勫璞℃垨鎵ц涓嶅繀瑕佺殑鏁版嵁鎷疯礉銆傚叾缁撴灉鏄紝瀵硅濡侴etValue绛夋柟娉曠殑澶氫釜璋冪敤浼氳繑鍥炲鐩稿悓瀵硅薄鐨勫紩鐢ㄣ傚鏋滀綘鍑嗗鏇存敼鐢辫濡侴etValue绛夋柟娉曡繑鍥炵殑瀵硅薄鐨勫熀鏈硷紝璇蜂粩缁嗗皬蹇冦
路 Depth锛氳幏鍙栨寚鏄庡綋鍓嶈宓屽娣卞害鐨勫笺傜洰鍓嶅苟涓嶆敮鎸佹柟娉曪紝鎬讳細杩斿洖0銆
路 FieldCount锛氳幏鍙栧綋鍓嶈涓殑鍒楁暟銆
路 HasRows锛氳幏鍙栧硷紝璇ュ兼寚鏄庝簡MySqlDataReader鏄惁鍖呭惈1琛屾垨澶氳銆
路 IsClosed锛氳幏鍙栧硷紝璇ュ兼寚鏄庝簡鍜岃嫃鍓ч槄璇诲櫒鏄惁宸插叧闂
路 Item锛氫互鍥烘湁鏍煎紡鑾峰彇鍒楃殑鍊笺傚湪C#锛岃灞炴ф槸MySqlDataReader绫荤殑绱㈠紩灞炴с
路 RecordsAffected锛氳幏鍙栭殣鎵цSQL璇彞鑰屾洿鏀广佹彃鍏ャ佹垨鍒犻櫎鐨勮鏁般
路 Close锛氬叧闂璏ySqlDataReader瀵硅薄銆
路 GetBoolean锛氳幏鍙栨寚瀹氬垪鐨勫竷灏斿笺
路 GetByte锛氫互瀛楄妭褰㈠紡鑾峰彇鎸囧畾鍒楃殑鍊笺
路 GetBytes锛氳鍙栦粠鎸囧畾鍒楀亸绉昏嚦缂撳啿鐨勫瓧鑺傛祦锛屾暟缁勪粠缁欏畾鐨勭紦鍐插亸绉讳綅缃紑濮嬨
路 GetChar锛氫互鍗曞瓧绗﹀舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetChars锛氳鍙栦粠鎸囧畾鍒楀亸绉昏嚦缂撳啿鐨勫瓧绗︽祦锛屾暟缁勪粠缁欏畾鐨勭紦鍐插亸绉讳綅缃紑濮嬨
路 GetDataTypeName锛氳幏鍙栨簮鏁版嵁绫诲瀷鐨勫悕绉般
路 GetDateTime锛氫互DateTime瀵硅薄褰㈠紡鑾峰彇鎸囧畾鍒楃殑鍊笺
路 GetDecimal锛氫互DateTime瀵硅薄褰㈠紡鑾峰彇鎸囧畾鍒楃殑鍊笺
路 GetDouble锛氫互鍙岀簿搴︽诞鐐规暟鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetFieldType锛氳幏鍙栦綔涓哄璞℃暟鎹被鍨嬬殑绫诲瀷銆
路 GetFloat锛氫互鍗曠簿搴︽诞鐐规暟鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetGuid锛氫互GUID鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetInt16锛氫互16浣嶅甫绗﹀彿鏁存暟鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetInt32锛氫互32浣嶅甫绗﹀彿鏁存暟鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetInt64锛氫互64浣嶅甫绗﹀彿鏁存暟鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetMySqlDateTime锛氫互MySqlDateTime瀵硅薄鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetName锛氳幏鍙栨寚瀹氬垪鐨勫悕绉般
路 GetOrdinal锛氱粰瀹氬垪鍚嶏紝鑾峰彇鍒楃殑椤哄簭銆
路 GetSchemaTable锛氳繑鍥炴弿杩颁簡MySqlDataReader鐨勫垪鍏冩暟鎹殑DataTable銆
路 GetString锛氫互String瀵硅薄鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetTimeSpan锛氫互TimeSpan瀵硅薄鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetUInt16锛氫互16浣嶆棤绗﹀彿鏁存暟鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetUInt32锛氫互32浣嶆棤绗﹀彿鏁存暟鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetUInt64锛氫互64浣嶆棤绗﹀彿鏁存暟鐨勫舰寮忚幏鍙栨寚瀹氬垪鐨勫笺
路 GetValue锛氫互鍥烘湁鏍煎紡鑾峰彇鎸囧畾鍒楃殑鍊笺
路 GetValues锛氳幏鍙栧綋鍓嶈闆嗗悎涓殑鎵鏈夊睘鎬у垪銆
路 IsDBNull锛氳幏鍙栧硷紝璇ュ兼寚鏄庝簡鍒椾腑鏄惁鍖呭惈涓嶅瓨鍦ㄦ垨涓㈠け鐨勫笺
路 NextResult锛氳鍙栨壒SQL璇彞鐨勭粨鏋滄椂锛屼娇鏁版嵁闃呰鍣ㄨ烦鍒颁笅涓涓粨鏋溿
路 Read锛氫娇MySqlDataReader璺冲埌涓嬩竴鏉¤褰曘
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦╒B.NET涓娇鐢∕ySqlDataReader绫荤殑鏂规硶锛
Public Sub ReadMyData(myConnString As String) Dim mySelectQuery As String = "SELECT OrderID, CustomerID FROM Orders" Dim myConnection As New MySqlConnection(myConnString) Dim myCommand As New MySqlCommand(mySelectQuery, myConnection) myConnection.Open() Dim myReader As MySqlDataReader myReader = myCommand.ExecuteReader() ' Always call Read before accessing data. While myReader.Read() Console.WriteLine((myReader.GetInt32(0) & ", " & myReader.GetString(1))) End While ' always call Close when done reading. myReader.Close() ' Close the connection when done with it. myConnection.Close() End Sub 'ReadMyData
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦–#涓娇鐢∕ySqlDataReader绫荤殑鏂规硶锛
public void ReadMyData(string myConnString) { string mySelectQuery = "SELECT OrderID, CustomerID FROM Orders"; MySqlConnection myConnection = new MySqlConnection(myConnString); MySqlCommand myCommand = new MySqlCommand(mySelectQuery,myConnection); myConnection.Open(); MySqlDataReader myReader; myReader = myCommand.ExecuteReader(); // Always call Read before accessing data. while (myReader.Read()) { Console.WriteLine(myReader.GetInt32(0) + ", " + myReader.GetString(1)); } // always call Close when done reading. myReader.Close(); // Close the connection when done with it. myConnection.Close(); }
路 HelpLink锛氳幏鍙栨垨璁剧疆鎸囧悜涓庤寮傚父鐩稿叧鐨勫府鍔╂枃浠剁殑閾炬帴銆
路 InnerException锛氳幏鍙栧鑷村綋鍓嶅紓甯哥殑寮傚父瀹炰緥銆
路 IsFatal锛氬鏋滆寮傚父鏄嚧鍛界殑锛屼负鈥滅湡鈥濓紝骞跺叧闂繛鎺ワ紝濡傛灉涓嶆槸鑷村懡鐨勶紝涓衡滃亣鈥濄
路 Message锛氳幏鍙栨弿杩板綋鍓嶅紓甯哥殑娑堟伅銆
路 Number锛氳幏鍙栨寚鏄庨敊璇被鍨嬬殑缂栧彿銆
路 Source锛氳幏鍙栨垨璁剧疆瀵艰嚧閿欒鐨勫簲鐢ㄧ▼搴忔垨瀵硅薄鐨勫悕绉般
路 StackTrace锛氳幏鍙栨姏鍑哄綋鍓嶅紓甯告椂鍦ㄨ皟鐢ㄥ爢鏍堜笂甯х殑瀛楃涓茶〃寰併
路 TargetSite锛氳幏鍙栨姏鍑哄綋鍓嶅紓甯哥殑鏂规硶銆
璇ョず渚嬩粙缁嶅湪VB.NET涓嬩娇鐢∕ySqlException绫荤殑鏂规硶銆
Public Sub ShowException() Dim mySelectQuery As String = "SELECT column1 FROM table1" Dim myConnection As New MySqlConnection ("Data Source=localhost;Database=Sample;") Dim myCommand As New MySqlCommand(mySelectQuery, myConnection) Try myCommand.Connection.Open() Catch e As MySqlException MessageBox.Show( e.Message ) End Try End Sub
璇ョず渚嬩粙缁嶅湪C#涓嬩娇鐢∕ySqlException绫荤殑鏂规硶銆
public void ShowException() { string mySelectQuery = "SELECT column1 FROM table1"; MySqlConnection myConnection = new MySqlConnection("Data Source=localhost;Database=Sample;"); MySqlCommand myCommand = new MySqlCommand(mySelectQuery,myConnection); try { myCommand.Connection.Open(); } catch (MySqlException e) { MessageBox.Show( e.Message ); } }
路 ExecuteDataRow锛氭墽琛屽崟涓猄QL璇彞骞惰繑鍥炵粨鏋滈泦鐨勭1琛屻傚湪璇ユ柟娉曠殑鎵ц杩囩▼涓紝灏嗗垱寤恒佹墦寮骞跺叧闂1涓柊鐨凪ySqlConnection瀵硅薄銆
路 ExecuteDataset锛氭墽琛屽崟涓猄QL鍛戒护骞惰繑鍥濪ataSet涓殑缁撴灉闆嗐傚湪璇ユ柟娉曠殑鎵ц杩囩▼涓紝灏嗗垱寤恒佹墦寮骞跺叧闂1涓柊鐨凪ySqlConnection瀵硅薄銆
路 ExecuteNonQuery锛氬湪MySQL鏁版嵁搴撲笂鎵ц鍗曚釜鍛戒护銆傝皟鐢ㄨ鏂规硶鏃讹紝灏嗚涓篗ySqlConnection宸叉墦寮锛屾柟娉曟墽琛屽畬鍚庯紝MySqlConnection浠嶄繚鎸佹墦寮鐘舵併
路 ExecuteReader锛歄verloaded锛氬湪MySQL鏁版嵁搴撲笂鎵ц鍗曚釜鍛戒护銆
路 ExecuteScalar锛氬湪MySQL鏁版嵁搴撲笂鎵ц鍗曚釜鍛戒护銆
路 UpdateDataSet锛氱敤鏉ヨ嚜缁欏畾DataSet鐨勬暟鎹洿鏂扮粰瀹氳〃銆
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦╒B.NET涓娇鐢∕ySqlTransaction绫荤殑鏂规硶锛
Public Sub RunTransaction(myConnString As String) Dim myConnection As New MySqlConnection(myConnString) myConnection.Open() Dim myCommand As MySqlCommand = myConnection.CreateCommand() Dim myTrans As MySqlTransaction ' Start a local transaction myTrans = myConnection.BeginTransaction() ' Must assign both transaction object and connection ' to Command object for a pending local transaction myCommand.Connection = myConnection myCommand.Transaction = myTrans Try myCommand.CommandText = "Insert into Region (RegionID, RegionDescription) VALUES (100, 'Description')" myCommand.ExecuteNonQuery() myCommand.CommandText = "Insert into Region (RegionID, RegionDescription) VALUES (101, 'Description')" myCommand.ExecuteNonQuery() myTrans.Commit() Console.WriteLine("Both records are written to database.") Catch e As Exception Try myTrans.Rollback() Catch ex As MySqlException If Not myTrans.Connection Is Nothing Then Console.WriteLine("An exception of type " & ex.GetType().ToString() & _ " was encountered while attempting to roll back the transaction.") End If End Try Console.WriteLine("An exception of type " & e.GetType().ToString() & _ "was encountered while inserting the data.") Console.WriteLine("Neither record was written to database.") Finally myConnection.Close() End Try End Sub 'RunTransaction
鍦ㄤ笅渚嬩腑锛屼粙缁嶄簡鍦–#涓娇鐢∕ySqlTransaction绫荤殑鏂规硶锛
public void RunTransaction(string myConnString) { MySqlConnection myConnection = new MySqlConnection(myConnString); myConnection.Open(); MySqlCommand myCommand = myConnection.CreateCommand(); MySqlTransaction myTrans; // Start a local transaction myTrans = myConnection.BeginTransaction(); // Must assign both transaction object and connection // to Command object for a pending local transaction myCommand.Connection = myConnection; myCommand.Transaction = myTrans; try { myCommand.CommandText = "Insert into Region (RegionID, RegionDescription) VALUES (100, 'Description')"; myCommand.ExecuteNonQuery(); myCommand.CommandText = "Insert into Region (RegionID, RegionDescription) VALUES (101, 'Description')"; myCommand.ExecuteNonQuery(); myTrans.Commit(); Console.WriteLine("Both records are written to database."); } catch(Exception e) { try { myTrans.Rollback(); } catch (MySqlException ex) { if (myTrans.Connection != null) { Console.WriteLine("An exception of type " + ex.GetType() + " was encountered while attempting to roll back the transaction."); } } Console.WriteLine("An exception of type " + e.GetType() + " was encountered while inserting the data."); Console.WriteLine("Neither record was written to database."); } finally { myConnection.Close(); } }
MySqlConnection瀵硅薄鏄娇鐢ㄨ繛鎺ュ瓧绗︿覆閰嶇疆鐨勩1涓繛鎺ュ瓧绗︿覆鍖呭惈鏈嶅姟鍣ㄩ敭锛忓煎锛岀敱鍒嗗彿闅斿紑銆傛瘡涓敭锛忓煎鐢辩瓑鍙疯繛鎺ャ
涓嬮潰缁欏嚭浜1涓畝鍗曠殑杩炴帴瀛楃涓茬ず渚嬶細
Server=127.0.0.1;Uid=root;Pwd=12345;Database=test;
鍦ㄦ湰渚嬩腑锛屽MySqlConnection瀵硅薄杩涜浜嗛厤缃紝浣跨敤鐢ㄦ埛鍚鈥root鈥鍜屽瘑鐮鈥12345鈥涓庝綅浜127.0.0.1鐨MySQL鏈嶅姟鍣ㄧ浉杩炪傛墍鏈夎鍙ョ殑榛樿鏁版嵁搴撲负娴嬭瘯鏁版嵁搴撱
鍏稿瀷鐨勯夐」濡備笅锛堝叧浜庨夐」鐨勫畬鏁存竻鍗曪紝璇峰弬瑙丄PI鏂囨。锛夛細
路 Server锛氬皢瑕佽繛鎺ョ殑MySQL瀹炰緥鐨勫悕绉版垨缃戠粶鍦板潃銆傞粯璁や负鏈湴涓绘満銆傚埆鍚嶅寘鎷琀ost, Data Source, DataSource, Address, Addr鍜Network Address銆
路 Uid锛氳繛鎺ユ椂浣跨敤鐨凪ySQL鐢ㄦ埛璐︽埛銆傚埆鍚嶅寘鎷User Id, Username鍜User name銆
路 Pwd锛歁ySQL璐︽埛鐨勫瘑鐮併備篃鍙互浣跨敤鍒悕瀵嗙爜銆
路 Database锛氭墍鏈夎鍙ヤ綔鐢ㄤ簬鐨勯粯璁ゆ暟鎹簱銆傞粯璁や负mysql銆備篃鍙互浣跨敤鍒悕Initial Catalog銆
路 Port锛歁ySQL鐢ㄤ簬鐩戝惉杩炴帴鐨勭鍙c傞粯璁や负3306銆灏嗚鍊兼寚瀹氫负鈥-1鈥灏嗕娇鐢ㄥ懡鍚嶇閬撹繛鎺ャ
涓鏃﹀垱寤轰簡杩炴帴瀛楃涓诧紝鍙娇鐢ㄥ畠鎵撳紑涓嶮ySQL鏈嶅姟鍣ㄧ殑杩炴帴銆
涓嬭堪浠g爜鐢ㄤ簬鍒涘缓MySqlConnection瀵硅薄锛屾寚瀹氳繛鎺ュ瓧绗︿覆锛屽苟鎵撳紑杩炴帴銆
[VB]
Dim conn As New MySql.Data.MySqlClient.MySqlConnection Dim myConnectionString as String myConnectionString = "server=127.0.0.1;" _ & "uid=root;" _ & "pwd=12345;" _ & "database=test;" Try conn.ConnectionString = myConnectionString conn.Open() Catch ex As MySql.Data.MySqlClient.MySqlException MessageBox.Show(ex.Message) End Try
[C#]
MySql.Data.MySqlClient.MySqlConnection conn; string myConnectionString; myConnectionString = "server=127.0.0.1;uid=root;" + "pwd=12345;database=test;"; try { conn = new MySql.Data.MySqlClient.MySqlConnection(); conn.ConnectionString = myConnectionString; conn.Open(); } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show(ex.Message); }
浣犱篃鍙互灏嗚繛鎺ュ瓧绗︿覆浼犻掔粰MySqlConnection绫荤殑鏋勯犲嚱鏁帮細
[VB]
Dim myConnectionString as String myConnectionString = "server=127.0.0.1;" _ & "uid=root;" _ & "pwd=12345;" _ & "database=test;" Try Dim conn As New MySql.Data.MySqlClient.MySqlConnection(myConnectionString) conn.Open() Catch ex As MySql.Data.MySqlClient.MySqlException MessageBox.Show(ex.Message) End Try
[C#]
MySql.Data.MySqlClient.MySqlConnection conn; string myConnectionString; myConnectionString = "server=127.0.0.1;uid=root;" + "pwd=12345;database=test;"; try { conn = new MySql.Data.MySqlClient.MySqlConnection(myConnectionString); conn.Open(); } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show(ex.Message); }
鐢变簬涓庡閮ㄦ湇鍔″櫒鐨勮繛鎺ヤ笉鍙娴嬶紝搴斾负浣犵殑.NET搴旂敤绋嬪簭娣诲姞閿欒澶勭悊鍔熻兘锛岃繖鐐瑰緢閲嶈銆傚嚭鐜拌繛鎺ラ敊璇椂锛MySqlConnection绫诲皢杩斿洖1涓MySqlException瀵硅薄銆璇ュ璞℃湁涓や釜鍦ㄥ鐞嗛敊璇椂鍗佸垎鏈夌敤鐨勫睘鎬э細
路 Message锛氭弿杩板綋鍓嶅紓甯哥殑娑堟伅銆
路 Number锛歁ySQL閿欒缂栧彿銆
澶勭悊閿欒鏃讹紝鍙牴鎹敊璇紪鍙蜂簡瑙e簲鐢ㄧ▼搴忕殑鍝嶅簲銆傝繘琛岃繛鎺ユ椂鏈甯歌鐨勪袱涓敊璇紪鍙峰涓嬶細
路 0: 鏃犳硶杩炴帴鍒版湇鍔″櫒銆
路 1045: 鏃犳晥鐨勭敤鎴峰悕鍜岋紡鎴栧瘑鐮併
鍦ㄤ笅闈㈢殑浠g爜涓紝浠嬬粛浜嗘牴鎹疄闄呴敊璇敼缂栧簲鐢ㄧ▼搴忕殑鏂规硶锛
[VB]
Dim myConnectionString as String myConnectionString = "server=127.0.0.1;" _ & "uid=root;" _ & "pwd=12345;" _ & "database=test;" Try Dim conn As New MySql.Data.MySqlClient.MySqlConnection(myConnectionString) conn.Open() Catch ex As MySql.Data.MySqlClient.MySqlException Select Case ex.Number Case 0 MessageBox.Show("Cannot connect to server. Contact administrator") Case 1045 MessageBox.Show("Invalid username/password, please try again") End Select End Try
[C#]
MySql.Data.MySqlClient.MySqlConnection conn; string myConnectionString; myConnectionString = "server=127.0.0.1;uid=root;" + "pwd=12345;database=test;"; try { conn = new MySql.Data.MySqlClient.MySqlConnection(myConnectionString); conn.Open(); } catch (MySql.Data.MySqlClient.MySqlException ex) { switch (ex.Number) { case 0: MessageBox.Show("Cannot connect to server. Contact administrator"); case 1045: MessageBox.Show("Invalid username/password, please try again"); } }
瀵逛簬澶氭鎵ц鐨勮鍙ワ紝棰勫鐞嗘墽琛岀殑閫熷害蹇簬鐩存帴鎵ц锛岃繖鏄洜涓哄彧闇杩涜1娆¤В鏋愭搷浣溿傚湪鐩存帴鎵ц鐨勬儏鍐典笅锛屾瘡娆℃墽琛屾椂鍧囧皢杩涜瑙f瀽鎿嶄綔銆傞澶勭悊鎵ц杩樿兘闄嶄綆缃戠粶閫氫俊閲忥紝杩欐槸鍥犱负瀵逛簬棰勫鐞嗚鍙ョ殑姣忔鎵ц锛屼粎闇鍙戦佺敤浜庡弬鏁扮殑鏁版嵁銆
棰勫鐞嗚鍙ョ殑鍙︿竴浼樼偣鏄紝瀹冭兘浣跨敤浜岃繘鍒跺崗璁紝杩欎娇寰楀鎴风鍜屾湇鍔″櫒闂寸殑鏁版嵁浼犺緭鏇存湁鏁堢巼銆
杈撳叆璇彞鍚庯紝璋冪敤MySqlCommand瀵硅薄鐨.Prepare鏂规硶銆瀹屾垚璇彞鐨勫噯澶囧悗锛屼负鏌ヨ涓殑姣忎釜鍏冪礌娣诲姞鍙傛暟銆
杈撳叆鏌ヨ骞惰緭鍏ュ弬鏁板悗锛屼娇鐢.ExecuteNonQuery()銆.ExecuteScalar()銆佹垨.ExecuteReader鏂规硶鎵ц璇彞銆
瀵逛簬鍚庣画鐨勬墽琛屾搷浣滐紝浠呴渶鏇存敼鍙傛暟鍊煎苟鍐嶆璋冪敤鎵ц鏂规硶锛屾棤闇璁剧疆.CommandText灞炴ф垨閲嶆柊瀹氫箟鍙傛暟銆
[VB]
Dim conn As New MySqlConnection
Dim cmd As New MySqlCommand
conn.ConnectionString = strConnection
Try
conn.Open()
cmd.Connection = conn
cmd.CommandText = "INSERT INTO myTable VALUES(NULL, ?number, ?text)"
cmd.Prepare()
cmd.Parameters.Add("?number", 1)
cmd.Parameters.Add("?text", "One")
For i = 1 To 1000
cmd.Parameters("?number").Value = i
cmd.Parameters("?text").Value = "A string value"
cmd.ExecuteNonQuery()
Next
Catch ex As MySqlException
MessageBox.Show("Error " & ex.Number & " has occurred: " & ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
[C#]
MySql.Data.MySqlClient.MySqlConnection conn;
MySql.Data.MySqlClient.MySqlCommand cmd;
conn = new MySql.Data.MySqlClient.MySqlConnection();
cmd = new MySql.Data.MySqlClient.MySqlCommand();
conn.ConnectionString = strConnection;
try
{
conn.Open();
cmd.Connection = conn;
cmd.CommandText = "INSERT INTO myTable VALUES(NULL, ?number, ?text)";
cmd.Prepare();
cmd.Parameters.Add("?number", 1);
cmd.Parameters.Add("?text", "One");
for (int i=1; i <= 1000; i++)
{
cmd.Parameters["?number"].Value = i;
cmd.Parameters["?text"].Value = "A string value";
cmd.ExecuteNonQuery();
}
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{
MessageBox.Show("Error " + ex.Number + " has occurred: " + ex.Message,
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
闅忕潃MySQL鐗堟湰5鐨勫彂甯冿紝MySQL鏈嶅姟鍣ㄧ洰鍓嶆敮鎸佸瓨鍌ㄧ▼搴忥紝瀹冮噰鐢ㄤ簡SQL 2003瀛樺偍绋嬪簭鐨勮娉曘
瀛樺偍绋嬪簭鎸囩殑鏄兘澶熶繚瀛樺湪鏈嶅姟鍣ㄤ笂鐨勪竴缁凷QL璇彞銆 涓鏃﹀畬鎴愪簡璇ユ搷浣滐紝瀹㈡埛绔棤闇鍐嶆鍙戝嚭鍗曠嫭璇彞锛岃屼粎闇寮曠敤瀛樺偍绋嬪簭鍙栬屼唬涔嬨
鍦ㄤ笅杩版儏鍐典笅锛屽瓨鍌ㄧ▼搴忓挨鍏舵湁鐢細
路 澶氫釜瀹㈡埛绔簲鐢ㄧ▼搴忔槸閲囩敤涓嶅悓璇█缂栧啓鐨勬垨宸ヤ綔鍦ㄤ笉鍚屽钩鍙颁笂锛屼絾闇鎵ц鐩稿悓鐨勬暟鎹簱鎿嶄綔銆
路 瀹夊叏鎬ф瀬鍏堕噸瑕佹椂銆備緥濡傦紝瀵逛簬鎵鏈夊叡鍚屾搷浣滐紝閾惰閲囩敤浜嗗瓨鍌ㄧ▼搴忋傝繖鏍凤紝灏辫兘鎻愪緵涓鑷翠笖瀹夊叏鐨勭幆澧冿紝鑰屼笖杩欑被瀛樺偍绋嬪簭鑳藉淇濊瘉姣忔鎿嶄綔鍧囧叿鏈夋伆褰撶櫥褰曘傚湪杩欑被璁剧疆涓嬶紝搴旂敤绋嬪簭鍜岀敤鎴锋棤娉曠洿鎺ヨ闂暟鎹簱琛紝浣嗚兘鎵ц鐗瑰畾鐨勫瓨鍌ㄧ▼搴忋
MySQL Connector/NET鏀寔閫氳繃MySqlCommand瀵硅薄鐨勫瓨鍌ㄧ▼搴忚皟鐢ㄣ浣跨敤MySqlCommand.Parameters闆嗭紝鑳藉灏嗘暟鎹紶鍏ュ拰浼犲嚭MySQL瀛樺偍绋嬪簭銆
鍦ㄦ湰鑺備腑锛屾湭娣卞害浠嬬粛鍒涘缓瀛樺偍绋嬪簭鏂归潰鐨勪俊鎭紝瑕佹兂浜嗚В杩欑被淇℃伅锛岃鍙傝MySQL鍙傝冩墜鍐岀殑瀛樺偍绋嬪簭銆
鍦∕ySQL Connector/NET瀹夎鐨Samples鐩綍涓嬶紝鍙壘鍒1涓浉搴旂殑绀轰緥锛岃绀轰緥婕旂ず浜嗕笌MySQL Connector/NET涓璧蜂娇鐢ㄥ瓨鍌ㄧ▼搴忕殑鏂规硶銆
鍙娇鐢ㄥ绉嶅伐鍏峰垱寤篗ySQL涓殑瀛樺偍绋嬪簭銆傞鍏堬紝鍙娇鐢mysql鍛戒护琛屽鎴风鍒涘缓瀛樺偍绋嬪簭銆傚叾娆★紝鍙娇鐢MySQL Query Browser GUI瀹㈡埛绔垱寤哄瓨鍌ㄧ▼搴忋傛渶鍚庯紝鍙娇鐢MySqlCommand瀵硅薄鐨.ExecuteNonQuery鏂规硶鍒涘缓瀛樺偍绋嬪簭銆
[VB]
Dim conn As New MySqlConnection Dim cmd As New MySqlCommand conn.ConnectionString = "server=127.0.0.1;" _ & "uid=root;" _ & "pwd=12345;" _ & "database=test" Try conn.Open() cmd.Connection = conn cmd.CommandText = "CREATE PROCEDURE add_emp(" _ & "IN fname VARCHAR(20), IN lname VARCHAR(20), IN bday DATETIME, OUT empno INT) " _ & "BEGIN INSERT INTO emp(first_name, last_name, birthdate) " _ & "VALUES(fname, lname, DATE(bday)); SET empno = LAST_INSERT_ID(); END" cmd.ExecuteNonQuery() Catch ex As MySqlException MessageBox.Show("Error " & ex.Number & " has occurred: " & ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try
[C#]
MySql.Data.MySqlClient.MySqlConnection conn; MySql.Data.MySqlClient.MySqlCommand cmd; conn = new MySql.Data.MySqlClient.MySqlConnection(); cmd = new MySql.Data.MySqlClient.MySqlCommand(); conn.ConnectionString = "server=127.0.0.1;uid=root;" + "pwd=12345;database=test;"; try { conn.Open(); cmd.Connection = conn; cmd.CommandText = "CREATE PROCEDURE add_emp(" + "IN fname VARCHAR(20), IN lname VARCHAR(20), IN bday DATETIME, OUT empno INT) " + "BEGIN INSERT INTO emp(first_name, last_name, birthdate) " + "VALUES(fname, lname, DATE(bday)); SET empno = LAST_INSERT_ID(); END"; cmd.ExecuteNonQuery(); } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show("Error " + ex.Number + " has occurred: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
瑕佹兂浣跨敤MySQL Connector/NET鏉ヨ皟鐢ㄥ瓨鍌ㄧ▼搴忥紝搴斿垱寤1涓MySqlCommand瀵硅薄锛屽苟灏嗗瓨鍌ㄧ▼搴忓悕浣滀负.CommandText灞炴т紶閫掋灏.CommandType灞炴ц缃负CommandType.StoredProcedure銆
鍛藉悕浜瀛樺偍绋嬪簭鍚庯紝涓哄瓨鍌ㄧ▼搴忎腑鐨勬瘡涓弬鏁板垱寤1涓狹ySqlCommand鍙傛暟銆鐢ㄥ弬鏁板悕鍜屽寘鍚肩殑瀵硅薄瀹氫箟IN鍙傛暟锛岀敤鍙傛暟鍚嶅拰棰勮灏嗚繑鍥炵殑鏁版嵁绫诲瀷瀹氫箟OUT鍙傛暟銆傚浜庢墍鏈夊弬鏁帮紝鍧囬渶瀹氫箟鍙傛暟鏂瑰悜銆
瀹氫箟瀹屽弬鏁板悗锛屼娇鐢MySqlCommand.ExecuteNonQuery()鏂规硶璋冪敤瀛樺偍绋嬪簭銆
[VB]
Dim conn As New MySqlConnection Dim cmd As New MySqlCommand conn.ConnectionString = "server=127.0.0.1;" _ & "uid=root;" _ & "pwd=12345;" _ & "database=test" Try conn.Open() cmd.Connection = conn cmd.CommandText = "add_emp" cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add("?lname", 'Jones') cmd.Parameters("?lname").Direction = ParameterDirection.Input cmd.Parameters.Add("?fname", 'Tom') cmd.Parameters("?fname").Direction = ParameterDirection.Input cmd.Parameters.Add("?bday", #12/13/1977 2:17:36 PM#) cmd.Parameters("?bday").Direction = ParameterDirection.Input cmd.Parameters.Add("?empno", MySqlDbType.Int32) cmd.Parameters("?empno").Direction = ParameterDirection.Output cmd.ExecuteNonQuery() MessageBox.Show(cmd.Parameters("?empno").Value) Catch ex As MySqlException MessageBox.Show("Error " & ex.Number & " has occurred: " & ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try
[C#]
MySql.Data.MySqlClient.MySqlConnection conn; MySql.Data.MySqlClient.MySqlCommand cmd; conn = new MySql.Data.MySqlClient.MySqlConnection(); cmd = new MySql.Data.MySqlClient.MySqlCommand(); conn.ConnectionString = "server=127.0.0.1;uid=root;" + "pwd=12345;database=test;"; try { conn.Open(); cmd.Connection = conn; cmd.CommandText = "add_emp"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("?lname", "Jones"); cmd.Parameters("?lname").Direction = ParameterDirection.Input; cmd.Parameters.Add("?fname", "Tom"); cmd.Parameters("?fname").Direction = ParameterDirection.Input; cmd.Parameters.Add("?bday", DateTime.Parse("12/13/1977 2:17:36 PM")); cmd.Parameters("?bday").Direction = ParameterDirection.Input; cmd.Parameters.Add("?empno", MySqlDbType.Int32); cmd.Parameters("?empno").Direction = ParameterDirection.Output; cmd.ExecuteNonQuery(); MessageBox.Show(cmd.Parameters("?empno").Value); } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show("Error " + ex.Number + " has occurred: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
鍙娇鐢–onnector/NET璁块棶淇濆瓨鍦˙LOB鍒椾腑鐨勬暟鎹紝骞惰兘浣跨敤瀹㈡埛绔唬鐮佸杩欑被鏁版嵁杩涜鎿嶄綔銆備娇鐢–onnector/NET鍜孊LOB鏁版嵁鏃讹紝鏃犵壒娈婅姹傘
鍦ㄦ湰鑺備腑锛岀粰鍑轰簡鏁颁釜绠鍗曠殑浠g爜绀轰緥锛屽湪MySQL Connector/NET瀹夎鐨Samples鐩綍涓嬶紝鍙壘鍒1涓畬鏁寸殑绀轰緥搴旂敤绋嬪簭銆
CREATE TABLE file(
file_id SMALLINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
file_name VARCHAR(64) NOT NULL,
file_size MEDIUMINT UNSIGNED NOT NULL,
file MEDIUMBLOB NOT NULL);
瀹屾垚琛ㄧ殑鍒涘缓鍚庯紝鎴栬闇瑕佹洿鏀筸ax_allowed_packet绯荤粺鍙橀噺銆傝鍙橀噺鍐冲畾浜嗚兘澶熷彂閫佺粰MySQL鏈嶅姟鍣ㄧ殑淇℃伅鍖咃紙鍗冲崟涓锛夊ぇ灏忋傞粯璁ゆ儏鍐典笅锛屾湇鍔″櫒鑳藉鎺ュ彈鏉ヨ嚜瀹㈡埛绔簲鐢ㄧ▼搴忕殑淇℃伅鍖呮渶澶т负1MB銆傚鏋滀笉鎵撶畻瓒呰繃1MB锛屾儏鍐佃壇濂姐傚鏋滄墦绠楀湪鏂囦欢浼犺緭涓秴鍑1MB锛屽繀椤诲鍔犺鏁板笺
鍙互浣跨敤鈥淢ySQL绯荤粺绠$悊鍛樼殑鍚姩鍙橀噺鈥濆睆骞曟洿鏀筸ax_allowed_packet閫夐」銆傚湪鈥滆仈缃戔濋夐」鍗$殑鈥滃唴瀛樷濋儴鍒嗭紝鎭板綋璋冩暣鈥滃厑璁哥殑鏈澶у尖濋夐」銆傚畬鎴愬肩殑璋冩暣鍚庯紝鐐瑰嚮鈥滃簲鐢ㄦ洿鏀光濇寜閽紝骞朵娇鐢ㄢ淢ySQL绠$悊鍛樷濈殑鈥滄湇鍔℃帶鍒垛濆睆骞曢噸鏂板惎鍔ㄦ湇鍔″櫒銆備篃鍙互鍦╩y.cnf鏂囦欢涓洿鎺ヨ皟鏁磋鍊硷紙娣诲姞1琛岋紝max_allowed_packet=xxM锛夛紝鎴栧湪MySQL涓娇鐢⊿ET max_allowed_packet=xxM銆
璁剧疆max_allowed_packet鏃跺簲淇濆畧浜涳紝杩欐槸鍥犱负浼犺緭BLOB鏁版嵁闇瑕佷竴娈垫椂闂淬傛伆褰撳湴璁剧疆璇ュ硷紝浣夸箣涓庨鏈熶娇鐢ㄧ浉绗︼紝骞跺湪蹇呰鏃跺澶ц鍊笺
瑕佹兂灏嗘枃浠跺啓鍏ユ暟鎹簱锛岄渶瑕佸皢鏂囦欢杞崲涓哄瓧鑺傛暟缁勶紝鐒跺悗灏嗗瓧鑺傛暟缁勭敤浣淚NSERT鏌ヨ鐨勫弬鏁般
鍦ㄤ笅杩颁唬鐮佷腑锛屼娇鐢‵ileStream瀵硅薄鎵撳紑浜1涓枃浠讹紝灏嗗叾璇诲叆鑷冲瓧鑺傛暟缁勶紝鐒跺悗灏嗗叾鎻掑叆鍒版枃浠惰〃涓細
[VB]
Dim conn As New MySqlConnection Dim cmd As New MySqlCommand Dim SQL As String Dim FileSize As UInt32 Dim rawData() As Byte Dim fs As FileStream conn.ConnectionString = "server=127.0.0.1;" _ & "uid=root;" _ & "pwd=12345;" _ & "database=test" Try fs = New FileStream("c:\image.png", FileMode.Open, FileAccess.Read) FileSize = fs.Length rawData = New Byte(FileSize) {} fs.Read(rawData, 0, FileSize) fs.Close() conn.Open() SQL = "INSERT INTO file VALUES(NULL, ?FileName, ?FileSize, ?File)" cmd.Connection = conn cmd.CommandText = SQL cmd.Parameters.Add("?FileName", strFileName) cmd.Parameters.Add("?FileSize", FileSize) cmd.Parameters.Add("?File", rawData) cmd.ExecuteNonQuery() MessageBox.Show("File Inserted into database successfully!", _ "Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) conn.Close() Catch ex As Exception MessageBox.Show("There was an error: " & ex.Message, "Error", _ MessageBoxButtons.OK, MessageBoxIcon.Error) End Try
[C#]
MySql.Data.MySqlClient.MySqlConnection conn; MySql.Data.MySqlClient.MySqlCommand cmd; conn = new MySql.Data.MySqlClient.MySqlConnection(); cmd = new MySql.Data.MySqlClient.MySqlCommand(); string SQL; UInt32 FileSize; byte[] rawData; FileStream fs; conn.ConnectionString = "server=127.0.0.1;uid=root;" + "pwd=12345;database=test;"; try { fs = new FileStream(@"c:\image.png", FileMode.Open, FileAccess.Read); FileSize = fs.Length; rawData = new byte[FileSize]; fs.Read(rawData, 0, FileSize); fs.Close(); conn.Open(); SQL = "INSERT INTO file VALUES(NULL, ?FileName, ?FileSize, ?File)"; cmd.Connection = conn; cmd.CommandText = SQL; cmd.Parameters.Add("?FileName", strFileName); cmd.Parameters.Add("?FileSize", FileSize); cmd.Parameters.Add("?File", rawData); cmd.ExecuteNonQuery(); MessageBox.Show("File Inserted into database successfully!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); conn.Close(); } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show("Error " + ex.Number + " has occurred: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
涓鏃﹀皢鏂囦欢鍔犺浇鍒颁簡鏂囦欢琛ㄤ腑锛屽氨鑳戒娇鐢MySqlDataReader绫绘潵妫绱㈠畠銆
鍦ㄤ笅杩颁唬鐮佷腑锛屼粠鏂囦欢琛ㄦ彁鍙栦簡1琛岋紝鐒跺悗灏嗘暟鎹杞藉埌瑕佸啓鍏ヨ嚦纾佺洏鐨FileStream瀵硅薄銆
[VB]
Dim conn As New MySqlConnection Dim cmd As New MySqlCommand Dim myData As MySqlDataReader Dim SQL As String Dim rawData() As Byte Dim FileSize As UInt32 Dim fs As FileStream conn.ConnectionString = "server=127.0.0.1;" _ & "uid=root;" _ & "pwd=12345;" _ & "database=test" SQL = "SELECT file_name, file_size, file FROM file" Try conn.Open() cmd.Connection = conn cmd.CommandText = SQL myData = cmd.ExecuteReader If Not myData.HasRows Then Throw New Exception("There are no BLOBs to save") myData.Read() FileSize = myData.GetUInt32(myData.GetOrdinal("file_size")) rawData = New Byte(FileSize) {} myData.GetBytes(myData.GetOrdinal("file"), 0, rawData, 0, FileSize) fs = New FileStream("C:\newfile.png", FileMode.OpenOrCreate, FileAccess.Write) fs.Write(rawData, 0, FileSize) fs.Close() MessageBox.Show("File successfully written to disk!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) myData.Close() conn.Close() Catch ex As Exception MessageBox.Show("There was an error: " & ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try
[C#]
MySql.Data.MySqlClient.MySqlConnection conn; MySql.Data.MySqlClient.MySqlCommand cmd; MySql.Data.MySqlClient.MySqlDataReader myData; conn = new MySql.Data.MySqlClient.MySqlConnection(); cmd = new MySql.Data.MySqlClient.MySqlCommand(); string SQL; UInt32 FileSize; byte[] rawData; FileStream fs; conn.ConnectionString = "server=127.0.0.1;uid=root;" + "pwd=12345;database=test;"; SQL = "SELECT file_name, file_size, file FROM file"; try { conn.Open(); cmd.Connection = conn; cmd.CommandText = SQL; myData = cmd.ExecuteReader(); if (! myData.HasRows) throw new Exception("There are no BLOBs to save"); myData.Read(); FileSize = myData.GetUInt32(myData.GetOrdinal("file_size")); rawData = new byte[FileSize]; myData.GetBytes(myData.GetOrdinal("file"), 0, rawData, 0, FileSize); fs = new FileStream(@"C:\newfile.png", FileMode.OpenOrCreate, FileAccess.Write); fs.Write(rawData, 0, FileSize); fs.Close(); MessageBox.Show("File successfully written to disk!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); myData.Close(); conn.Close(); } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show("Error " + ex.Number + " has occurred: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
鍦–rystal Reports涓垱寤烘姤鍛婃椂锛屽湪璁捐鎶ュ憡鏃讹紝鏈変袱涓敤浜庤闂甅ySQL鏁版嵁鐨勯夐」銆
绗1涓夐」鏄紝璁捐鎶ュ憡鏃讹紝浣跨敤Connector/ODBC浣滀负ADO鏁版嵁婧愩備綘鑳藉娴忚鏁版嵁搴擄紝骞朵娇鐢ㄦ嫋鏀惧紡鎿嶄綔閫夋嫨琛ㄥ拰瀛楁浠ュ垱寤烘姤鍛娿傝鏂规硶鐨勭己鐐规槸锛屽繀椤诲湪搴旂敤绋嬪簭涓墽琛岄澶栨搷浣滀互鐢熸垚涓庢姤鍛婇鏈熺殑鏁版嵁闆嗗尮閰嶇殑鏁版嵁闆嗐
绗2涓夐」鏄湪VB.NET涓垱寤烘暟鎹泦锛屽苟灏嗗叾淇濆瓨涓篨ML鏍煎紡銆傞殢鍚庯紝璇ML鏂囦欢鍙鐢ㄤ簬璁捐鎶ュ憡銆傚湪搴旂敤绋嬪簭涓樉绀烘姤鍛婃椂锛屽畠鐨勮〃鐜扮浉褰撹壇濂斤紝浣嗚璁℃椂鐨勯氱敤鎬ц緝宸紝杩欐槸鍥犱负鍦ㄥ垱寤烘暟鎹泦鏃讹紝蹇呴』閫夋嫨鎵鏈夌殑鐩稿叧鍒椼傚鏋滃繕璁伴夋嫨浜嗘煇涓鍒楋紝鍦ㄨ兘澶熷皢鍒楁坊鍔犲埌鎶ュ憡鍓嶏紝蹇呴』閲嶆柊鍒涘缓鏁版嵁闆嗐
浣跨敤涓嬭堪浠g爜锛屽彲鏍规嵁鏌ヨ鎿嶄綔鍒涘缓鏁版嵁闆嗭紝骞跺皢鍏跺啓鍏ョ鐩樸
[VB]
Dim myData As New DataSet Dim conn As New MySqlConnection Dim cmd As New MySqlCommand Dim myAdapter As New MySqlDataAdapter conn.ConnectionString = "server=127.0.0.1;" _ & "uid=root;" _ & "pwd=12345;" _ & "database=world" Try conn.Open() cmd.CommandText = "SELECT city.name AS cityName, city.population AS CityPopulation, " _ & "country.name, country.population, country.continent " _ & "FROM country, city ORDER BY country.continent, country.name" cmd.Connection = conn myAdapter.SelectCommand = cmd myAdapter.Fill(myData) myData.WriteXml("C:\dataset.xml", XmlWriteMode.WriteSchema) Catch ex As Exception MessageBox.Show(ex.Message, "Report could not be created", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try
[C#]
DataSet myData = new DataSet(); MySql.Data.MySqlClient.MySqlConnection conn; MySql.Data.MySqlClient.MySqlCommand cmd; MySql.Data.MySqlClient.MySqlDataAdapter myAdapter; conn = new MySql.Data.MySqlClient.MySqlConnection(); cmd = new MySql.Data.MySqlClient.MySqlCommand(); myAdapter = new MySql.Data.MySqlClient.MySqlDataAdapter(); conn.ConnectionString = "server=127.0.0.1;uid=root;" + "pwd=12345;database=test;"; try { cmd.CommandText = "SELECT city.name AS cityName, city.population AS CityPopulation, " + "country.name, country.population, country.continent " + "FROM country, city ORDER BY country.continent, country.name"; cmd.Connection = conn; myAdapter.SelectCommand = cmd; myAdapter.Fill(myData); myData.WriteXml(@"C:\dataset.xml", XmlWriteMode.WriteSchema); } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show(ex.Message, "Report could not be created", MessageBoxButtons.OK, MessageBoxIcon.Error); }
濡傛灉浣犻夋嫨浣跨敤Connector/ODBC鏉ヨ璁℃姤鍛婏紝鍙粠dev.mysql.com涓嬭浇瀹冦
鍚戝棣栧厛瑕佹眰浣犳彁渚涙暟鎹簮銆傚鏋滀綘姝d娇鐢–onnector/ODBC浣滀负鏁版嵁婧愶紝閫夋嫨鏁版嵁婧愭椂锛岃浣跨敤OLE DB (ADO)鏍戠殑鈥滅敤浜嶰DBC鐨凮LEDB provider鈥濋夐」锛岋紝鑰屼笉鏄潵鑷狾DBC (RDO)鐨勫搴旈夐」銆傚鏋滀綘浣跨敤鐨勬槸宸蹭繚瀛樼殑鏁版嵁闆嗭紝璇烽夋嫨ADO.NET (XML)閫夐」锛屽苟娴忚浣犱繚瀛樼殑鏁版嵁闆嗐
鍦ㄦ姤鍛婄殑鍒涘缓杩囩▼涓紝鍓╀綑閮ㄥ垎灏嗙敱鍚戝鑷姩瀹屾垚銆
鍒涘缓瀹屾姤鍛婂悗锛岄夋嫨鈥滄枃浠垛濊彍鍗曚腑鐨勨淩eport Options...鈥濊彍鍗曢」銆傚彇娑堝鈥淪ave Data With Report鈥濓紙涓庢姤鍛婁竴璧蜂繚瀛樻暟鎹級閫夐」鐨勯夋嫨銆傝繖鏍凤紝灏辫兘闃叉淇濆瓨鐨勬暟鎹共鎵板簲鐢ㄧ▼搴忎腑鐨勬暟鎹姞杞芥搷浣溿
瑕佹兂鏄剧ず鎶ュ憡锛岄鍏堢敤鎶ュ憡鎵闇鐨勬暟鎹~鍏呮暟鎹泦锛岀劧鍚庡姞杞芥姤鍛婏紝骞跺皢鍏朵笌缁戝畾鍒版暟鎹泦銆傛渶鍚庯紝灏嗘姤鍛婁紶閫掔粰crViewer鎺у埗锛屼互渚垮悜鐢ㄦ埛鏄剧ず瀹冦
鍦ㄦ樉绀烘姤鍛婄殑椤圭洰涓紝闇瑕佷笅杩板紩鐢細
路 CrytalDecisions.CrystalReports.Engine
路 CrystalDecisions.ReportSource
路 CrystalDecisions.Shared
路 CrystalDecisions.Windows.Forms
鍦ㄤ笅杩颁唬鐮佷腑锛屽亣瀹氫綘浣跨敤鏁版嵁闆嗭紙鐢鍒涘缓鏁版嵁婧涓粰鍑虹殑浠g爜淇濆瓨鐨勬暟鎹泦锛夊垱寤轰簡鎶ュ憡锛屽苟鍦ㄥ悕涓衡myViewer鈥濈殑琛ㄥ崟涓婃湁1涓猚rViewer鎺т欢銆
[VB]
Imports CrystalDecisions.CrystalReports.Engine Imports System.Data Imports MySql.Data.MySqlClient Dim myReport As New ReportDocument Dim myData As New DataSet Dim conn As New MySqlConnection Dim cmd As New MySqlCommand Dim myAdapter As New MySqlDataAdapter conn.ConnectionString = _ "server=127.0.0.1;" _ & "uid=root;" _ & "pwd=12345;" _ & "database=test" Try conn.Open() cmd.CommandText = "SELECT city.name AS cityName, city.population AS CityPopulation, " _ & "country.name, country.population, country.continent " _ & "FROM country, city ORDER BY country.continent, country.name" cmd.Connection = conn myAdapter.SelectCommand = cmd myAdapter.Fill(myData) myReport.Load(".\world_report.rpt") myReport.SetDataSource(myData) myViewer.ReportSource = myReport Catch ex As Exception MessageBox.Show(ex.Message, "Report could not be created", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try
[C#]
using CrystalDecisions.CrystalReports.Engine; using System.Data; using MySql.Data.MySqlClient; ReportDocument myReport = new ReportDocument(); DataSet myData = new DataSet(); MySql.Data.MySqlClient.MySqlConnection conn; MySql.Data.MySqlClient.MySqlCommand cmd; MySql.Data.MySqlClient.MySqlDataAdapter myAdapter; conn = new MySql.Data.MySqlClient.MySqlConnection(); cmd = new MySql.Data.MySqlClient.MySqlCommand(); myAdapter = new MySql.Data.MySqlClient.MySqlDataAdapter(); conn.ConnectionString = "server=127.0.0.1;uid=root;" + "pwd=12345;database=test;"; try { cmd.CommandText = "SELECT city.name AS cityName, city.population AS CityPopulation, " + "country.name, country.population, country.continent " + "FROM country, city ORDER BY country.continent, country.name"; cmd.Connection = conn; myAdapter.SelectCommand = cmd; myAdapter.Fill(myData); myReport.Load(@".\world_report.rpt"); myReport.SetDataSource(myData); myViewer.ReportSource = myReport; } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show(ex.Message, "Report could not be created", MessageBoxButtons.OK, MessageBoxIcon.Error); }
浣跨敤鐩稿悓鐨勬煡璇紙鐢ㄤ簬鐢熸垚鍓嶉潰淇濆瓨鐨勬暟鎹泦锛夛紝鍙敓鎴愭柊鐨勬暟鎹泦銆備竴鏃﹀~鍏呬簡鏁版嵁闆嗭紝鍙娇鐢≧eportDocument鍔犺浇鎶ュ憡鏂囦欢锛屽苟灏嗗叾涓庢暟鎹泦缁戝畾鍦ㄤ竴璧枫俁eportDocument鏄綔涓篶rViewer鐨凴eportSource鑰屼紶閫掔殑銆
浣跨敤Connector/ODBC浠庡崟涓〃鍒涘缓鎶ュ憡鏃讹紝閲囩敤浜嗙浉鍚岀殑鏂规硶銆傛暟鎹泦鏇挎崲鎶ュ憡涓娇鐢ㄧ殑琛紝骞舵伆褰撴樉绀烘姤鍛娿
濡傛灉鎶ュ憡鏄娇鐢–onnector/ODBC浠庡涓〃鍒涘缓鐨勶紝鍦ㄦ垜浠殑搴旂敤绋嬪簭涓繀椤诲垱寤哄叿鏈夊涓〃鐨勬暟鎹泦銆傝繖鏍凤紝灏辫兘鐢ㄦ暟鎹泦涓殑鎶ュ憡鏇挎崲鎶ュ憡鏁版嵁婧愪腑鐨勫悇涓〃銆
鍦ㄦ垜浠殑MySqlCommand瀵硅薄涓彁渚涘鏉ELECT璇彞锛岄氳繃璇ユ柟寮忥紝鐢ㄥ涓〃濉厖鏁版嵁闆嗐傝繖浜汼ELECT璇彞鍩轰簬SQL鏌ヨ锛屽鏁版嵁搴撹彍鍗曗淪how SQL Query鈥濋夐」涓殑鈥淐rystal Reports鈥濅腑鏄剧ず鐨勯偅鏍枫傚亣瀹氭湁涓嬭堪鏌ヨ锛
SELECT `country`.`Name`, `country`.`Continent`, `country`.`Population`, `city`.`Name`, `city`.`Population`
FROM `world`.`country` `country` LEFT OUTER JOIN `world`.`city` `city` ON `country`.`Code`=`city`.`CountryCode`
ORDER BY `country`.`Continent`, `country`.`Name`, `city`.`Name`
璇ユ煡璇㈠皢琚浆鎹负涓ゆ潯SELECT鏌ヨ锛屽苟浠ヤ笅杩颁唬鐮佹樉绀猴細
[VB]
Imports CrystalDecisions.CrystalReports.Engine Imports System.Data Imports MySql.Data.MySqlClient Dim myReport As New ReportDocument Dim myData As New DataSet Dim conn As New MySqlConnection Dim cmd As New MySqlCommand Dim myAdapter As New MySqlDataAdapter conn.ConnectionString = "server=127.0.0.1;" _ & "uid=root;" _ & "pwd=12345;" _ & "database=world" Try conn.Open() cmd.CommandText = "SELECT name, population, countrycode FROM city ORDER BY countrycode, name; " _ & "SELECT name, population, code, continent FROM country ORDER BY continent, name" cmd.Connection = conn myAdapter.SelectCommand = cmd myAdapter.Fill(myData) myReport.Load(".\world_report.rpt") myReport.Database.Tables(0).SetDataSource(myData.Tables(0)) myReport.Database.Tables(1).SetDataSource(myData.Tables(1)) myViewer.ReportSource = myReport Catch ex As Exception MessageBox.Show(ex.Message, "Report could not be created", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try
[C#]
using CrystalDecisions.CrystalReports.Engine; using System.Data; using MySql.Data.MySqlClient; ReportDocument myReport = new ReportDocument(); DataSet myData = new DataSet(); MySql.Data.MySqlClient.MySqlConnection conn; MySql.Data.MySqlClient.MySqlCommand cmd; MySql.Data.MySqlClient.MySqlDataAdapter myAdapter; conn = new MySql.Data.MySqlClient.MySqlConnection(); cmd = new MySql.Data.MySqlClient.MySqlCommand(); myAdapter = new MySql.Data.MySqlClient.MySqlDataAdapter(); conn.ConnectionString = "server=127.0.0.1;uid=root;" + "pwd=12345;database=test;"; try { cmd.CommandText = "SELECT name, population, countrycode FROM city ORDER " + "BY countrycode, name; SELECT name, population, code, continent FROM " + "country ORDER BY continent, name"; cmd.Connection = conn; myAdapter.SelectCommand = cmd; myAdapter.Fill(myData); myReport.Load(@".\world_report.rpt"); myReport.Database.Tables(0).SetDataSource(myData.Tables(0)); myReport.Database.Tables(1).SetDataSource(myData.Tables(1)); myViewer.ReportSource = myReport; } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show(ex.Message, "Report could not be created", MessageBoxButtons.OK, MessageBoxIcon.Error); }
鍦ㄥ鎴风涓婇檺鍒舵棤鏁堟棩鏈熷崄鍒嗙畝鍗曪紝鍗虫讳娇鐢.NET DateTime绫绘潵澶勭悊鏃ユ湡銆侱ateTime绫讳粎鍏佽鏈夋晥鏃ユ湡锛屼粠鑰岀‘淇濅簡鏁版嵁搴撲腑鐨勫间篃鏄湁鏁堢殑銆璇ユ柟娉曠殑缂虹偣鏄紝鍦ㄤ娇鐢.NET鍜岄潪.NET浠g爜鎿嶄綔鏁版嵁搴撶殑娣峰悎鐜涓嬩笉鑳戒娇鐢ㄥ畠锛岃繖鏄洜涓哄悇搴旂敤绋嬪簭蹇呴』鎵ц鑷繁鐨勬棩鏈熼獙璇併
MySQL 5.0.2鍜屾洿楂樼増鏈殑鐢ㄦ埛鍙娇鐢ㄦ柊鐨勪紶缁烻QL妯″紡鏉ラ檺鍒舵棤鏁堟棩鏈熷笺傚叧浜庝娇鐢ㄤ紶缁烻QL妯″紡鐨勬洿澶氫俊鎭紝璇峰弬瑙http://dev.mysql.com/doc/mysql/en/server-sql-mode.html銆
MySqlDateTime鏁版嵁绫诲瀷鏀寔MySQL鏈嶅姟鍣ㄦ敮鎸佺殑鐩稿悓鏃ユ湡鍊笺侻ySQL Connector/NET鐨勯粯璁よ涓烘槸锛屽鏈夋晥鐨勬棩鏈熷艰繑鍥1涓.NET DateTime瀵硅薄锛屽鏃犳晥鏃ユ湡鍊艰繑鍥為敊璇傚彲浠ユ洿鏀硅榛樿鏂瑰紡锛屼娇MySQL Connector/NET涓烘棤鏁堟棩鏈熻繑鍥MySqlDateTime瀵硅薄銆
瑕佹兂浣縈ySQL Connector/NET涓烘棤鏁堟棩鏈熻繑鍥MySqlDateTime瀵硅薄锛屽彲鍦ㄨ繛鎺ュ瓧绗︿覆涓坊鍔犱笅琛岋細
Allow Zero Datetime=True
璇锋敞鎰忥紝浣跨敤MySqlDateTime绫讳粛浼氫骇鐢熼棶棰樸涓嬮潰浠嬬粛浜嗕竴浜涘凡鐭ラ棶棰橈細
1. 鏃犳晥鏃ユ湡鐨勬暟鎹粦瀹氫粛浼氬鑷撮敊璇紙闆舵棩鏈0000-00-00鐪嬩笂鍘讳笉瀛樺湪璇ラ棶棰橈級銆
2. ToString鏂规硶杩斿洖鎸夋爣鍑哅ySQL鏍煎紡杩涜鏍煎紡澶勭悊鐨勬棩鏈燂紙渚嬪锛2005-02-23 08:50:25锛夈傝繖涓.NET DateTime绫荤殑ToString琛屼负涓嶅悓銆
3. MySqlDateTime绫绘敮鎸丯ULL鏃ユ湡锛屼絾.NET DateTime绫讳笉鏀寔NULL鏃ユ湡銆傚鏋滄湭棣栧厛妫鏌ULL锛屽湪璇曞浘灏哅ySQLDateTime杞崲涓篋ateTime鏃讹紝浼氬鑷撮敊璇
鐢变簬瀛樺湪涓婅堪宸茬煡浜嬪疁锛屾渶浣冲缓璁粛鏄紝鍦ㄤ綘鐨勫簲鐢ㄧ▼搴忎腑浠呬娇鐢ㄦ湁鏁堟棩鏈熴
.NET DateTime鏁版嵁绫诲瀷涓嶈兘澶勭悊NULL鍊笺鍚屾牱锛屽湪鏌ヨ涓负DateTime鍙橀噺璧嬪兼椂锛屽繀椤婚鍏堟鏌ュ兼槸鍚︽槸NULL銆
浣跨敤MySqlDataReader鏃讹紝鍦ㄨ祴鍊煎墠锛屽簲浣跨敤.IsDBNull鏂规硶妫鏌ュ兼槸鍚︿负NULL锛
[VB]
If Not myReader.IsDBNull(myReader.GetOrdinal("mytime")) Then myTime = myReader.GetDateTime(myReader.GetOrdinal("mytime")) Else myTime = DateTime.MinValue End If
[C#]
if (! myReader.IsDBNull(myReader.GetOrdinal("mytime"))) myTime = myReader.GetDateTime(myReader.GetOrdinal("mytime")); else myTime = DateTime.MinValue;
路 鏇存浜嗗湪鏈~鍏匔onnection.Database鐨勬儏鍐典笅浣跨敤瀛樺偍绋嬪簭鏃跺嚭鐜扮殑寮傚父 (Bug #11450) 銆
路 鐗瑰畾鐨勬畫缂烘煡璇㈠皢瑙﹀彂鈥滆繛鎺ュ繀椤绘槸鏈夋晥鍜屾墦寮鐨勨濋敊璇秷鎭 (Bug #11490) 銆
路 璋冪敤鍏舵煇涓鍙傛暟鍚湁鐗规畩瀛楃锛堝鈥淍鈥濓級鐨勫瓨鍌ㄧ▼搴忓皢浜х敓寮傚父銆傛敞鎰忥紝蹇呴』鍚敤ANSI_QUOTES鎵嶄細浣夸箣鎴愪负鍙兘 (Bug #13753) 銆
路 濡傛灉璇彞鍖呭惈瀵圭浉鍚屽弬鏁扮殑澶氫釜寮曠敤锛屾棤娉曞鍏惰繘琛岄澶勭悊 (Bug #13541) 銆
路 Ping()鏂规硶涓嶆洿鏂癈onnection瀵硅薄鐨凷tate灞炴 (Bug #13658) 銆
路 Nant鏋勫缓搴忓垪鏈夐棶棰(Bug #12978)
路 濡傛灉浼犻掔殑绗1涓兼槸NULL锛屽弬鏁扮殑涓茶鍖栨搷浣滃け璐 (Bug #13276) 銆
路 鍚笅杩板瓧绗︾殑瀛楁鍚嶅皢瀵艰嚧閿欒锛()%<>/ (Bug #13036) 銆
路 MySQL Connector/NET 1.0.5瀹夎绋嬪簭涓嶈兘鍚屾椂瀹夎MySQL Connector/NET 1.0.4. (Bug #12835)銆
路 鍦∕ono涓奙ySQL Connector/NET 1.0.5涓嶈兘杩炴帴 (Bug #13345) 銆
路 杩炴帴瀛楃涓蹭腑鏈夊涓富鏈烘椂锛孧ySQL Connector/NET鏃犳硶涓庡垪琛ㄤ腑鐨1涓富鏈虹浉杩 (Bug #12628) 銆
路 MySQL Connector/NET灏嗘柊鐨勫崄杩涘埗鏁版嵁绫诲瀷瑙i噴涓哄瓧鑺傛暟缁 (Bug #11294) 銆
路 涓嶆敮鎸cp1250瀛楃闆 (Bug #11621) 銆
路 褰.NET绾跨▼姹犳棤鍙敤鐨勫伐浣滅嚎绋嬫椂锛岃繛鎺ュ彲鑳藉け璐 (Bug #10637) 銆
路 鍗佽繘鍒跺弬鏁板鑷磋娉曢敊璇 (Bug #11550, Bug #10486, Bug #10152)銆
路 濡傛灉瀛樺偍绋嬪簭涓嶅惈鍙傛暟锛岃皟鐢ㄥ瓨鍌ㄧ▼搴忓皢瀵艰嚧寮傚父 (Bug #11542) 銆
路 鐗瑰畾鐨勬畫缂烘煡璇㈠皢瑙﹀彂鈥滆繛鎺ュ繀椤绘槸鏈夋晥鍜屾墦寮鐨勨濋敊璇秷鎭 (Bug #11490) 銆
路 闄や簡榛樿鏁版嵁搴撳锛MySqlCommandBuilder绫讳笉鑳藉鐞嗗紩鐢ㄤ簡鍏朵粬鏁版嵁搴撲腑琛ㄧ殑鏌ヨ (Bug #8382) 銆
路 MySQL Connector/NET鏃犳硶鐗瑰畾鐨勫眬閮ㄨ缃竴璧锋甯稿伐浣 (WL#8228)銆
路 鏈~鍏Connection.Database鏃朵娇鐢ㄥ瓨鍌ㄧ▼搴忓鑷村紓甯 (Bug #11450) 銆
路 璇诲彇TIMESTAMP鍒楁椂浜х敓寮傚父 (Bug #7951) 銆
路 鐢ㄦ崲琛岀闅斿紑鍙傛暟鏃讹紝鏃犳硶璇嗗埆鍙傛暟 (Bug #9722) 銆
路 鍦ㄥ垵濮嬭繛鎺ヤ笂鏈缃繛鎺ュ瓧绗︿覆鏃讹紝璋冪敤MySqlConnection.clone灏嗗鑷撮敊璇 (Bug #10281) 銆
路 澧炲姞浜嗗浠嶮ySQL Connector/NET璋冪敤瀛樺偍鍑芥暟鐨勬敮鎸 (Bug #10644) 銆
路 MySQL Connector/NET涓嶈兘杩炴帴鍒癕ySQL 4.1.14. (Bug #12771)銆
路 鐢ㄨ璁″櫒娣诲姞浜MySqlConnection瀵硅薄鏃讹紝鏃犳硶璁剧疆ConnectionString灞炴 (Bug #12551, Bug #8724)銆
路 Bug #7243锛氳皟鐢ㄥ噯澶囧鑷村紓甯竅宸叉洿姝銆
路 鏇存浜嗕笌棰勫鐞嗚鍙ユ湁鍏崇殑鍙︿竴涓皬闂銆
路 Bug #7258锛歁ySqlCommand.Connection杩斿洖IDbConnection [宸叉洿姝銆
路 Bug #7345锛歁ySqlAdapter.Fill鏂规硶鎶涘嚭閿欒娑堟伅锛氶渶瑕侀潪璐熸暟鍊糩宸叉洿姝銆
路 Bug #7478锛歁ySqlCommand涓殑鍏嬮殕鏂规硶缂洪櫡[宸叉洿姝銆
路 Bug #7612锛氬綋瀛楁涓篘ULL鏃讹紝MySqlDataReader.GetString(index)杩斿洖浜嗛潪Null鍊糩宸叉洿姝銆
路 Bug #7755锛氬鏋滃垪鏄棤绗﹀彿绫诲瀷锛孧ySqlReader.GetInt32鎶涘嚭寮傚父[宸叉洿姝銆
路 Bug #7704锛欸etBytes涓嶅啀宸ヤ綔[宸叉洿姝銆
路 Bug #7724锛氬紩鐢ㄥ瓧绗︹\222鈥濆湪EscapeString涓湭琚紩鐢╗宸叉洿姝銆
路 鏇存浜嗗懡鍚嶇閬撲笉鑳戒笌鏌愪簺Blob鍔熻兘涓璧峰伐浣滅殑闂銆
路 鏇存浜嗕笌鍏变韩鍐呭瓨杩炴帴鏈夊叧鐨勯棶棰樸
路 Bug #7436锛氫笌澶氫釜缁撴灉闆嗘湁鍏崇殑闂鈥 [宸叉洿姝銆
路 鍦ˋPI鍙傝冩枃妗d腑澧炲姞浜嗗涓富棰樸
路 浣縈ySQL鎴愪负榛樿鐨勫懡鍚嶇閬撳悕绉般
路 鐜板湪锛岃繛鎺ユ椂SHOW COLLATION鍙敤浜庢绱㈠畬鏁寸殑瀛楃闆咺D鍒楄〃銆
路 鏇存浜嗘棤鏁堝瓧绗﹂泦绱㈠紩锛200 (Bug #6547) 銆
路 瀹夎鍣ㄧ幇鍦ㄥ寘鍚簡澶氫釜閫夐」锛屽彲瀹夎鑷矴AC涓紝骞跺垱寤衡滃紑濮嬧濊彍鍗曢」銆
路 Bug #6863锛歁ySqlCommand鍙傛暟涓殑Int64鏀寔[宸叉洿姝銆
路 瀵逛簬杩炴帴锛岀幇鍦ㄦ棤闇鍦ㄨ繛鎺ュ瓧绗︿覆涓婄粰鍑烘暟鎹簱銆
路 Bug #6770锛歁ySqlDataReader.GetChar(int i)鎶涘嚭IndexOutOfRange寮傚父[宸叉洿姝銆
路 鏇存浜嗗洜鍏锋湁涓嶅悓琛屾暟鐨勫涓粨鏋滈泦鑰屽鑷寸殑闂銆
路 Bug #6983锛氬啀娆℃姏鍑哄紓甯告椂寮傚父鍫嗘爤璺熻釜涓㈠け[宸叉洿姝銆
路 鏇存浜嗕笌浣跨敤棰勫鐞嗚鍙ユ娴婲ull鍊兼湁鍏崇殑涓昏闂銆
路 Bug #6902锛氳В鏋愬瓨鍌ㄧ▼搴忓弬鏁版椂鐨勯敊璇痆宸叉洿姝銆
路 Bug #6668锛氬瓨鍌ㄧ▼搴忕殑鏁存暟杈撳嚭鍙傛暟杩斿洖涓哄瓧绗︿覆[宸叉洿姝銆
路 Bug #7032锛氭寜鏂囨湰鍒嗙被鐨勬暟鎹〃涓殑MySqlDateTime锛屾棤鏁版嵁 [宸叉洿姝銆
路 Bug #7133锛氫娇鐢╥nout鍙傛暟鏃剁殑鏃犳晥鏌ヨ瀛楃涓瞇宸叉洿姝銆
路 Bug #6831锛氫笌MySQL 4.0涓璧锋椂锛屾祴璇曞け璐ワ紝鍘熷洜鍦ㄤ簬琛ㄥ悕鐨勫ぇ灏忓啓鏁忔劅鎬宸叉洿姝銆
路 Bug #7132锛氭彃鍏ateTime瀵艰嚧System.InvalidCastException鐨勬姏鍑篬宸叉洿姝銆
路 Bug #6879锛氫娇鐢―ATE_ADD-function鏃剁殑InvalidCast[宸叉洿姝銆
路 Bug #6634锛1涓墦寮鐨勮繛鎺ヨ涓绘満绯荤粺鍏抽棴[宸叉洿姝銆
路 涓篗ySqlConnection娣诲姞浜哠erverThread灞炴т互鏄剧ず鏈嶅姟鍣ㄧ嚎绋婭D銆
路 涓篗ySqlConnection澧炲姞浜哖ing鏂规硶銆
路 灏嗘祴璇曞寘鐨勫悕绉版洿鏀逛负MySql.Data.Tests.dll銆
路 鏇存浜嗕笌MySqlBinary鏈夊叧鐨勯棶棰橈紝鍏朵腑锛屾棤娉曚娇鐢ㄥ瓧绗︿覆鍊兼洿鏂版墿灞曠殑鏂囨湰鍒椼
路 鏇存浜嗕娇鐢ㄥ畾鍒跺畨瑁呮椂蹇界暐鐨勫畨瑁呯洰褰曢棶棰(Bug #6329)銆
路 鏇存浜嗚缃懡浠ゆ枃鏈皢鍛戒护鐣欏湪棰勫鐞嗙姸鎬佺殑闂銆
路 鏇存浜哅ySqlParameter鍙岀被鍨嬪鐞嗛棶棰橈紙瀛楃涓瞤arameterName锛屽璞″硷級(Bug #6428)銆
路 鏇存浜嗗~鍏呮暟鎹泦鏃惰繑鍥為浂鏃ユ湡鈥0000-00-00鈥濋敊璇(Bug #6429)銆
路 鏇存浜嗚皟鐢ㄥ瓨鍌ㄧ▼搴忓彲鑳戒細瀵艰嚧鈥淚llegal mix of collations鈥濓紙闈炴硶鏍″缁勫悎锛夌殑闂銆
路 澧炲姞浜哻harset杩炴帴瀛楃涓查夐」銆
路 鏇存浜#HY000鈥淚llegal mix of collations鈥濓紙闈炴硶鏍″缁勫悎锛(latin1_swedish_ci,IMPLICIT)鍜(utf8_general_ (Bug #6322)闂銆
路 澧炲姞浜員ableEditor CS鍜孷B绀轰緥銆
路 鏇存浜嗗叧浜嶶CS-2鐨凜harset-map闂(Bug #6541)銆
路 鏇存柊浜嗗畨瑁呭櫒锛屽寘鍚簡鏂扮殑绀轰緥銆
路 鏇存瑙勪簡Long鎻掑叆鑰楁椂寰堥暱鐨勯棶棰(Bug #5453)銆
路 鏇存浜嗗璞℃棤娉曡澶勭悊鐨勯棶棰(Bug #6649)銆
路 鎻愪緵鏂规灏嗘湇鍔″櫒鎸囧畾鐨勫瓧绗﹂泦鐢ㄤ綔榛樿瀛楃闆嗐
路 鏇存浜哅ySqlParameter(string, object)鏋勯犲嚱鏁颁腑鐨勫彲鑳界己闄BUG #5602銆
路 鏇存浜BUG #5458锛屽湪longtext鍒椾笂璋冪敤GetChars灏嗘姏鍑哄紓甯搞
路 鏇存浜BUG #5474锛屾棤娉曡繍琛屽瓨鍌ㄧ▼搴忔潵濉厖mysqlcommand.parameters銆
路 鏇存浜BUG #5469锛岃缃瓺bType鏃舵姏鍑篘ullReferenceException銆
路 鏇存浜嗗湪鍏抽棴濂楁帴瀛椾箣鍓嶈繛鎺ュ櫒鏃犳硶鍙戝嚭CMD_QUIT鐨勯棶棰樸
路 鏇存浜BUG #5392锛孧ySqlCommand鍦ㄥ瓧绗︿覆鏂囨湰鍐呭涓彂鐜颁綔涓哄弬鏁扮殑鈥?鈥濄
路 鏇存浜嗕笌ConnectionInternal鏈夊叧鐨勯棶棰橈紝鍏朵腑锛1涓敭鍙兘浼氳娣诲姞澶氭銆
路 褰撴湇鍔″櫒鐗堟湰涓4.1.2鎴栨洿楂樻椂锛孋P1252浠呯敤浜嶭atin1銆
路 鏇存浜BUG #5388锛屽鏋1琛屼负NULL锛孌ataReader閫氭姤鎵鏈夎鍧囦负NULL銆
路 铏氭嫙鍖栦簡椹卞姩瀛愮郴缁燂紝浠ヤ究鏈潵鐗堟湰鑳借交鏄撳湴鏀寔瀹㈡埛绔垨宓屽叆寮忔湇鍔″櫒銆
路 鍐嶆浣跨敤瀛楁缂撳啿锛屼互鍑忓皯鍐呭瓨鍒嗛厤骞跺鍔犻熷害銆
路 鏇存浜嗙浉搴旂殑闂锛屼娇鐢ㄦ帴鍙f椂浣跨敤鏃ц娉曞皢瀵艰嚧闂銆
路 瀵逛簬鍐欏叆娴佹搷浣滐紝浣跨敤PacketWriter鍙栦唬Packet銆
路 鍦–ompressedStream涓啀鍒嗚В鍘嬬缉浠g爜锛屼互娓呯悊NativeDriver銆
路 澧炲姞浜嗙敤浜庡湪棰勫鐞嗗懡浠や笂閲嶇疆鍛戒护鏂囨湰鐨勬祴璇曡寖渚嬨
路 鏇存浜嗙粰瀹歂ull鍊兼椂MySqlParameterCollection.Add()灏嗘姏鍑轰笉鏄庡紓甯哥殑闂(Bug #5621)銆
路 鏇存浜哅ySqlCommand()涓殑鏋勯犲嚱鏁板垵濮嬪寲闂(Bug #5613)銆
路 鏇存浜嗚В鏋愨;鈥濆瓧绗︾殑闂(Bug #5876)銆
路 鏇存浜嗗湪DbType璁剧疆鍣ㄤ腑涓㈠け寮曠敤鐨勯棶棰(Bug #5897)銆
路 鏇存浜嗕娇鐢╕EAR鏁版嵁绫诲瀷鏃剁殑System.OverflowException闂(Bug #6036)銆
路 澧炲姞浜嗚仛鍚堝嚱鏁版祴璇曪紙瀹為檯涓婁笉鏄己闄凤級銆
路 鏇存浜嗘诞鐐瑰弬鏁(double, numeric, single, decimal)鐨勫簭鍒楀寲闂(Bug #5900)銆
路 IsNullable閿欒(Bug #5796)銆
路 鏇存浜嗕笉閬靛畧杩炴帴瀛楃涓蹭笂缁欏嚭鐨勮繛鎺ュ鍛界殑闂銆
路 鏇存浜嗕笉閬靛畧Min Pool Size锛堟渶灏忔睜澶у皬锛夌殑闂銆
路 鏇存浜哅ySqlDataReader鍜屸渟how tables from ...鈥濓紙浠鈥鏄剧ず琛級琛屼负(Bug #5256)銆
路 瀹炴柦浜哠equentialAccess銆
路 鏇存浜嗗彂鐜扮1涓0鍚嶮ySqlDateTime鍦ㄦ墍鏈塻ubseq.records涓婅缃甀sZero灞炴х殑闂(Bug #6006)銆
路 鏇存浜嗘棤娉曟纭樉绀轰腑鏂囧瓧鐨勯棶棰(Bug #5288)銆
路 杩樻洿姝d簡淇勬枃瀛楃鏀寔銆
路 鏇存浜哅ethod TokenizeSql()浠呭皢鏈夐檺鐨勬湁鏁堝瓧绗︾敤浜庡弬鏁扮殑闂(Bug #6217)銆
路 鏇存浜嗕涪澶眗esx鏂囦欢鐨凬ET Connector婧(Bug #6216)銆
路 鏇存浜嗕笌妫绱紡鏇存柊鏌ヨ涓璧蜂娇鐢ㄦ槸浼氬鑷撮棶棰樼殑DBNull鍊 (Bug #5798) 銆
路 鏇存浜嗕粛鏈夊彟涓涓滄湭璁剧疆缁欏璞″疄渚嬬殑瀵硅薄寮曠敤鈥(Bug #5496)銆
路 鏇存浜哖acketReader涓殑闂锛屽叾涓紝浼氳瘯鍥惧湪EnsureCapacity涓垎閰嶉敊璇殑缂撳啿澶у皬銆
路 鏇存浜咷etBoolean杩斿洖閿欒鍊肩殑闂(Bug #6227)銆
路 鏇存浜嗗甫鏈塆etString(index)鐨凞ataReader涓璧疯鍙朆LOB鏃剁殑IndexOutOfBounds闂(Bug #6230)銆
路 鏇存浜咮UG# 3889锛屼笉鑳芥纭敮鎸乀hai缂栫爜銆
路 鏇存柊浜嗗緢澶氭祴璇曡寖渚嬨
路 鏇存浜嗕笌浣跨敤鍘嬬缉鏈夊叧鐨勯棶棰樸
路 灏嗚礉濉1鐗堟湰鐨勭増鏈彿鎵╁厖涓1.0.0銆
路 澧炲姞浜嗙敤浜庡畨瑁呭櫒鐨凜OPYING.rtf鏂囦欢銆
路 鍒犻櫎浜嗘墍鏈夌殑XML娉ㄩ噴璀﹀憡锛堜互鍚庡皢鏇村ソ鍦版竻鐞嗗畠浠級銆
路 鍒犻櫎浜嗕竴浜涘ByteFX鐨勬渶杩戝紩鐢ㄣ
路 涓洪澶勭悊璇彞澧炲姞浜嗘祴璇曞畾浣嶅櫒銆
路 鐩墠锛屾墍鏈夌被鍨嬬殑绫诲潎瀹炴柦浜哠erializeBinary鏂规硶锛岀敤浜庡皢鍏舵暟鎹彂閫佺粰PacketWriter銆
路 澧炲姞浜哖acketWriter绫伙紝鍏佽灏嗘潵鐨勪綆鍐呭瓨澶у璞″鐞嗐
路 鏇存浜嗚繍琛岄澶勭悊璇彞鍜屽瓨鍌ㄧ▼搴忎腑瀛樺湪鐨勫緢澶氬皬缂洪櫡銆
路 鏇存敼浜嗗鏉″懡浠わ紝浣垮緱鍦ㄦ墽琛屽甫鏈夌壒瀹氬弬鏁帮紙閲囩敤鏃ц娉曟ā寮忥級鐨勫瓨鍌ㄧ▼搴忔椂涓嶅啀鎶涘嚭寮傚父銆
路 SingleRow鐜板湪宸ヤ綔姝e父锛屽嵆浣垮湪瀛樺湪闄愬埗鐨勬儏鍐典笅涔熷悓鏍枫
路 GetBytes鐩墠浠呬綔鐢ㄥ湪浜岃繘鍒跺垪涓娿
路 Logger鐜板湪鑳藉鎴煭闀跨殑SQL鍛戒护锛屼粠鑰屼娇寰梑lob鍒椾笉浼氣滄拺鐖嗏濇棩蹇椼
路 涓绘満鍜屾暟鎹簱鐩墠鐨勯粯璁ゅ间负鈥溾濓紝闄ら潪浣滀簡鍏朵粬璁剧疆銆
路 鏇存浜咮UG# 5214锛屽拷鐣ヤ簡杩炴帴瓒呮椂銆
路 澧炲姞浜嗘祴璇曡寖渚嬶紝閽堝bug# 5051锛欸etSchema涓嶈兘姝g‘宸ヤ綔銆
路 鏇存浜嗗綋鍒椾负鍏抽敭瀛楁椂GetSchema涓篒sUnique杩斿洖鈥滃亣鈥濈殑闂銆
路 MySqlDataReader GetXXX鏂规硶鐩墠閲囩敤浜嗗瓧娈电骇MySqlValue瀵硅薄锛屼笉鎵ц杞崲銆
路 鏇存浜咮UG# 5097锛欴ataReader涓烘椂闂村垪杩斿洖NULL銆
路 A澧炲噺浜嗛拡瀵筁OAD DATA LOCAL INFILE鐨勬祴璇曡寖渚嬨
路 澧炲姞浜唕eplacetext custom nant浠诲姟銆
路 澧炲姞浜咰ommandBuilderTest瀹氫綅鍣ㄣ
路 涓篊ommandBuilder澧炲姞浜哃ast One Wins锛堟渶鍚庝竴涓儨鍑猴級鐗规с
路 鏇存浜嗘寔缁у畨鍏ㄤ俊鎭棶棰樸
路 鏇存浜咷etBool锛屼娇寰1, true, "true"鍜"yes"鍧囧彲琛ㄧずtrueWL# 2024锛屼粠鑰屼娇寰楀弬鏁版爣蹇楁垚涓哄彲閰嶇疆鐨勩
路 澧炲姞浜"old syntax"杩炴帴瀛楃涓插弬鏁帮紝鍏佽浣跨敤鈥淍鈥濆弬鏁版爣璁扮銆
路 鏇存浜Bug #4658锛孧ySqlCommandBuilder銆
路 鏇存浜Bug #4864锛屽鏋溾淧ersist Security Info鈥濓紙鎸佺画鎬у畨鍏ㄤ俊鎭級涓哄亣锛孊yteFX.MySqlClient灏嗗瀵嗙爜杩涜缂撳啿澶勭悊銆
路 鍦ㄦ墍鏈夌殑婧愭枃浠朵腑鏇存柊浜嗚鍙爣蹇楋紝浠ュ寘鍚獸LOSS寮傚父銆
路 閽堝鐩墠鎵鏈夌殑MySql绫诲瀷锛屽鍔犱簡鏂扮殑.Types鍚嶇О绌洪棿鍜屽叿浣撳疄鏂姐
路 澧炲姞浜嗕綔涓篗ySqlField瀛愮被鐨凪ySqlField41銆
路 鏇存敼浜嗗緢澶氱被锛屼娇涔嬭兘澶熶娇鐢ㄦ柊鐨.Types绫诲瀷銆
路 灏唀num int绫诲瀷鏇存敼涓篒nt32锛屽皢short绫诲瀷鏇存敼涓篒nt16锛屽苟灏哹igint绫诲瀷鏇存敼涓篒nt64銆
路 澧炲姞浜嗕吉绫诲瀷UInt16銆乁Int32鍜孶Int64锛屽厑璁稿垱寤烘棤绗﹀彿鍙傛暟銆
路 鐜板湪锛屼粠杩炴帴姹犳媺鍑鸿繛鎺ユ椂锛岃繛鎺ュ皢琚浣嶃
路 鍦ㄩ┍鍔ㄧ▼搴忎腑鍐嶆鍒嗚В浜哸uth浠g爜锛屼娇寰楀叾鍗宠兘鐢ㄤ簬auth锛屼篃鑳界敤浜巖eset銆
路 鍦≒oolingTests.cs涓鍔犱簡UserReset娴嬭瘯銆
路 鐜板湪锛屼娇鐢–OM_CHANGE_USER浠庢睜涓媺鍑鸿繛鎺ユ椂锛岃繛鎺ュ皢琚浣嶃
路 瀹炵幇浜哠ingleResultSet琛屼负銆
路 瀹炵幇浜嗗unicode鐨勬敮鎸併
路 涓簎tf-8鍜寀cs-2澧炲姞浜嗗瓧绗﹂泦鏄犲皠銆
路 鏇存浜Bug #4520锛屼娇鐢╞ytefx .net mysql椹卞姩鏃讹紝鏃堕棿瀛楁婧㈠嚭銆
路 鍦ㄦ暟鎹被鍨嬫祴璇曞畾浣嶅櫒涓慨鏀逛簡鏃堕棿娴嬭瘯锛屼互渚胯兘澶熸鏌モ渉ours > 24鈥濈殑鏃堕棿璺ㄥ害銆
路 鏇存浜Bug #4505锛屽湪ByteFx.Data.MySqlClient.MySqlParameter涓甫鏈夊弽鏂滄潬杞箟鐨勯敊璇瓧绗︿覆銆
路 涓哄弬鏁版祴璇曡寖渚婽estQuoting澧炲姞浜嗕唬鐮侊紝浠ユ祴璇曞弽鏂滅嚎绗﹀彿銆
路 鏇存浜Bug #4486锛屼笌multi-word鍒楀悕涓璧峰伐浣滄椂锛宮ysqlcommandbuilder澶辫触銆
路 鏇存浜員okenizeSql涓殑缂洪櫡锛屽叾涓紝涓嬪垝绾垮皢涓鑾峰彇鍙傛暟鍚嶄腑鐨勫瓧绗︺
路 涓哄垪鍚嶇┖闂村鍔犱簡娴嬭瘯鑼冧緥銆
路 鏇存浜哹ug# 4324锛孧ySqlDataReader.GetBytes涓嶈兘姝g‘宸ヤ綔銆
路 涓篋ataReader娴嬭瘯瀹氫綅鍣ㄥ鍔犱簡GetBytes()娴嬭瘯鑼冧緥銆
路 鐜板湪锛岃兘澶熷皢InternalConnection.Configure涓殑鎵鏈夋湇鍔″櫒鍙橀噺璇诲叆鍒癏ashtable銆
路 鐩墠浣跨敤瀛楃涓瞇]锛岀敤浜嶤harSetMap涓殑绱㈠紩鏄犲皠銆
路 涓篠QL涓殑carriage杩斿洖澧炲姞浜咰RInSQL娴嬭瘯鑼冧緥銆
路 鍦―river.ctor涓紝灏唌axPacketSize璁句负榛樿鍊笺
路 鏇存浜bug #4442锛屽湪鍙傛暟涓婅缃甅ySqlDbType鐨勬搷浣滀笉璁剧疆涓鑸被鍨嬨
路 鍒犻櫎浜嗚繃鏃剁殑鍒楃被鍨婰ong鍜孡ongLong銆
路 鏇存浜哹ug# 4071锛屽湪杩炴帴瀛楃涓蹭笂浣跨敤鈥渦se pipe鈥濇椂锛屾姏鍑烘孩鍑哄紓甯搞
路 灏嗗叧閿瓧鈥渦se pipe鈥濇洿鏀逛负鈥減ipe name鈥濇垨鈥減ipe鈥濄
路 鍏佽浠庡崟涓煡璇㈣鍙栧涓粨鏋滈泦銆
路 涓篠erverStatusFlags enum澧炲姞浜嗘爣蹇楀睘鎬с
路 灏哠erverStatus enum鐨勫悕绉版洿鏀逛负ServerStatusFlags銆
路 鏇存浜BUG #4386锛屾彃鍏ョ殑鏁版嵁琛屾湭姝g‘鏇存柊銆
路 鏇存浜bug #4074锛岄敊璇鐞嗚〃鏄庡垱寤轰簡琛ㄣ
路 灏哖acket.ReadLenInteger鏇存敼涓篟eadPackedLong锛屽苟澧炲姞浜唒acket.ReadPackedInteger锛屽畠鎬昏鍙栫敤2銆3銆4缁勮鐨勬暣鏁般
路 澧炲姞浜唖yntax.cs娴嬭瘯瀹氫綅鍣紝浠ユ祴璇曞悇绉峉QL璇硶缂洪櫡銆
路 鏇存浜哹ug# 4149锛屽鏃堕棿鍊肩殑涓嶅綋澶勭悊銆傜幇鍦紝鍊尖00:00:00鈥濅笉鍐嶈褰撲綔Null銆
路 灏嗘墍鏈夌殑娴嬭瘯鍖呮枃浠剁Щ鍒颁簡TestSuite鏂囦欢澶广
路 鏇存浜嗙┖鍒椾細灏嗙粨鏋滀俊鎭寘鎸囬拡鍚戝悗绉荤殑闂銆
路 澧炲姞浜嗘柊鐨刵ant鍒涘缓鑴氭湰銆
路 鏇存浜BUG #3917锛屾竻闄よ〃鍚嶏紝浠ヤ究鑳藉湪涓嬩竴GenerateSchema鎵ц鏈熼棿鎭板綋鍦伴噸鏂扮敓鎴愬畠銆
路 鏇存浜bug #3915锛孏etValues鎬昏繑鍥0锛岃屼笖鎬绘槸璇曞浘澶嶅埗鎵鏈夊瓧娈碉紝鑰屼笉鏄牴鎹墍浼犲叆鏁扮粍鐨勫ぇ灏忋
路 瀹炴柦浜嗗叡浜唴瀛樿闂崗璁
路 瀹炴柦浜嗛拡瀵圭殑MySQL 4.1鐨勯澶勭悊璇彞銆
路 瀹炴柦浜嗛拡瀵筂ySQL 5.0鐨勫瓨鍌ㄧ▼搴忋
路 灏哅ySqlInternalConnection閲嶆柊鍛藉悕涓篒nternalConnection銆
路 SQL鐜板湪琚В閲婁负瀛楃锛屾洿姝d簡涓庡叾浠栬瑷鏈夊叧鐨勯棶棰樸
路 澧炲姞浜嗘棩蹇楀姛鑳斤紝骞跺厑璁告壒杩炴帴瀛楃涓查夐」銆
路 鏇存浜bug #3888锛岃缃瓺ataAdapter灞炴ф椂鏈缃甊owUpdating浜嬩欢銆
路 鏇存浜嗗瓧绗﹂泦鏄犲皠涓瓨鍦ㄧ殑缂洪櫡銆
路 瀹炴柦浜4.1閴村畾銆
路 鏀瑰杽浜嗛┍鍔ㄤ腑鐨刼pen/auth浠g爜銆
路 鏀瑰杽浜嗗湪杩炴帴杩囩▼涓繛鎺ヤ綅鐨勮缃柟寮忋
路 鐜板湪锛屽湪鍒濆鐨勬彙鎵嬮樁娈碉紝灏嗘暟鎹簱鍚嶄紶閫掔粰浜嗘湇鍔″櫒銆
路 灏嗗鎴风鐨勫悕绉扮┖闂存洿鏀逛负MySql.Data.MySqlClient銆
路 灏嗗鎴风鐨勮閰嶅悕绉版洿鏀逛负MySql.Data.dll銆
路 灏嗘墍鏈夋簮鏂囦欢涓殑璁稿彲鏂囨湰鏇存敼涓轰簡GPL銆
路 澧炲姞浜哅ySqlClient.build Nant鏂囦欢銆
路 鍒犻櫎浜唌ono鎵瑰鐞嗘枃浠躲
路 灏嗕竴浜涙湭浣跨敤鐨勬枃浠剁Щ鍒颁簡notused鏂囦欢澶癸紝浠庤屼娇寰梟ant鍒涘缓鏂囦欢鑳藉浣跨敤閫氶厤绗︺
路 瀹炴柦浜嗗叡浜唴瀛樿闂
路 瀵逛唬鐮佺粨鏋勮繘琛屼簡杈冨ぇ淇ˉ銆
路 鐜板湪锛岄澶勭悊璇彞鑳藉鍦∕ySql 4.1.1鍜屾洿楂樼増鏈腑浣跨敤銆
路 瀵4.0銆4.1.0鍜4.1.1瀹屾垚浜哸uth瀹炴柦銆
路 灏嗗悕绉扮┖闂翠粠MySQL.Data.MySQLClient鏇存敼涓篗ySql.Data.MySqlClient銆
路 鏇存浜咰harSetMapping涓瓨鍦ㄧ殑缂洪櫡锛屽叾涓紝瀹冭瘯鍥惧皢鏂囨湰鍚嶇О鐢ㄤ綔ints銆
路 灏嗗悕绉扮┖闂存洿鏀逛负MySQL.Data.MySQLClient銆
路 闆嗘垚浜嗘潵鑷猆C2004鐨刟uth鍙樺姩銆
路 鏇存浜嗗湪璇诲彇鏁版嵁涔嬪墠鍜屽煎悗銆佸湪datareader涓婅皟鐢ㄤ换浣旼etXXX鏂规硶鏃朵笉鑳芥姏鍑烘伆褰撳紓甯哥殑缂洪櫡锛堟劅璋uca Morelli morelli.luca@iol.it锛夈
路 鍦╬arameter.cs涓鍔犱簡TimeSpan浠g爜锛屼互渚胯兘鎭板綋鍦板皢timespan瀵硅薄澶勭悊涓簃ysql鏃堕棿鏍煎紡锛堟劅璋ianluca Colombo g.colombo@alfi.it锛夈
路 涓哄弬鏁板簭鍒楀寲浠g爜澧炲姞浜員imeStamp銆傞槻姝ataAdatper涓嶆甯哥殑鏇存柊锛堟劅璋Ichael King锛夈
路 鏇存浜哅ySqlHelper.cs涓殑鎷煎啓閿欒锛堟劅璋atrick Kristiansen锛夈
路 椹卞姩绋嬪簭鐜板湪鑳戒娇鐢ㄦ彙鎵嬪崗璁腑缁欏畾鐨勫瓧绗﹂泦缂栧彿鍒涘缓缂栫爜銆
路 鏇存敼浜嗗懡浠ょ紪杈戝櫒锛屼娇涔嬫寚鍚慚ySqlClient.Design銆
路 鏇存浜哣ersion.isAtLeast涓殑缂洪櫡銆
路 鏇存敼浜咲BConnectionString锛屼娇涔嬭兘澶熸敮鎸佸MySqlConnectionString鎵浣滅殑鏇存敼銆
路 鍒犻櫎浜哠qlCommandEditor鍜孌ataAdapterPreviewDialog銆
路 鍦ㄥ緢澶氬湴鏂归噰鐢ㄤ簡鏂扮殑Long杩斿洖鍊笺
路 闆嗘垚浜嗘柊鐨凜ompressedStream绫汇
路 鏇存敼浜咰onnectionString骞跺鍔犱簡澶氶」灞炴э紝浠庤屼娇涔嬭兘澶熷湪MySqlClient.Design涓娇鐢ㄣ
路 鏇存敼浜唒acket.cs锛屼互鏀寔ReadLenInteger涓殑杈冩柊闀垮害銆
路 鏇存敼浜嗗叾浠栫被锛屼互浣跨敤MySqlConnectionString鐨勬柊灞炴у拰瀛楁銆
路 鐜板湪锛孋onnectionInternal鑳藉浣跨敤PING鍛戒护鏌ョ湅鏈嶅姟鍣ㄦ槸鍚﹀彲鐢ㄣ
路 灏嗗伐鍏风浣嶅浘绉诲埌浜唕esource/涓嬨
路 鏇存敼field.cs锛屽厑璁稿肩洿鎺ユ潵鑷缂撳啿鍣ㄣ
路 杩涜浜嗙浉搴旂殑鏇存敼锛屼互浣跨敤鏂扮殑driver.Send璇硶銆
路 浣跨敤浜嗘柊鐨勪俊鎭寘鎺掗槦绯荤粺銆
路 寮濮嬬潃鎵嬭繘琛屸滄崯鍧忕殑鈥濆帇缂╀俊鎭寘澶勭悊銆
路 鏇存浜哠treamCreator涓殑缂洪櫡锛屾棤娉曡繛鎺ュ埌涓绘満灏嗗鑷存棤闄愬惊鐜紙鎰熻阿Kevin Casella锛夈
路 鏀瑰杽浜哻onnectstring澶勭悊銆
路 灏嗚璁″櫒绉诲埌浜哖ro浜у搧涓
路 浠巆ommand.cs鍒犻櫎浜嗕竴浜涙棫鐨勩佽娉ㄩ噴鎺夌殑浠g爜銆
路 鏇存浜嗕笌鍘嬬缉鏈夊叧鐨1涓棶棰樸
路 鏇存浜嗚繛鎺ュ璞★紝鎵撳紑杩炴帴鍓嶆姏鍑虹殑寮傚父涓嶄細浣胯繛鎺ヤ繚鎸佸湪杩炴帴鐘舵侊紙鎰熻阿Chris Cline锛夈
路 澧炲姞浜咷UID鏀寔銆
路 鏇存浜嗗簭鍒楁贩涔辩己闄凤紙鎰熻阿Mark Reay锛夈
路 鐜板湪锛屽彲灏咵num鍊间綔涓哄弬鏁板煎姞浠ユ敮鎸侊紙鎰熻阿Philipp Sumi锛夈
路 鏀寔Year鏁版嵁绫诲瀷銆
路 鏇存浜嗗帇缂╅棶棰樸
路 鏇存浜嗕互TimeSpan浣滀负鍊肩殑鍙傛暟鏃犳硶鎭板綋搴忓垪鍖栫殑缂洪櫡銆
路 鏇存浜嗛粯璁tor涓嶈兘璁剧疆榛樿杩炴帴瀛楃涓插肩殑缂洪櫡銆
路 涓轰竴浜涙柊鎴愬憳澧炲姞浜嗕竴浜沊ML娉ㄩ噴銆
路 鐫鎵嬫洿姝o紡鏀瑰杽鍘嬬缉澶勭悊浜嬪疁銆
路 鏀瑰杽浜咰onnectionString澶勭悊鍔熻兘锛屼娇涔嬭兘澶熶笌SqlClient璁惧畾鐨勬爣鍑嗘洿濂藉湴鍖归厤銆
路 濡傛灉鐢ㄦ埛鍚嶆湭鍖呭惈鍦ㄨ繛鎺ュ瓧绗︿覆涓紝灏嗘姏鍑篗ySqlException銆
路 濡傛灉鍦ㄨ繛鎺ュ瓧绗︿覆涓湭鎸囧畾锛屾湰鍦颁富鏈哄皢鐢ㄤ綔榛樿涓绘満銆
路 濡傛灉鍦ㄨ繛鎺ユ墦寮鐨勫悓鏃惰瘯鍥捐缃繛鎺ュ瓧绗︿覆锛屽皢鎶涘嚭寮傚父銆
路 瀵笴onnectionString鏂囨。杩涜浜嗗皬鐨勪慨鏀广
路 鍒犻櫎浜哅ultiHostStream鍜孧ySqlStream銆傞噰鐢–ommon/StreamCreator鍙栬屼唬涔嬨
路 澧炲姞浜嗗鈥淯se Pipe鈥濊繛鎺ュ瓧绗︿覆鍊肩殑鏀寔銆
路 澧炲姞浜哖latform绫伙紝浠ヤ究鑳芥洿瀹规槗鍦拌闂钩鍙扮殑瀹炵敤宸ュ叿鍔熻兘銆
路 鏇存浜嗗皬鐨勮繛鎺ユ睜缂洪櫡锛屽嵆锛屽湪IsAlive澶辫触鍚庯紝涓嶈兘鍒涘缓鏂扮殑杩炴帴銆
路 澧炲姞浜哖latform.cs鍜孲treamCreator.cs銆
路 鏇存浜咶ield.cs锛屼互渚胯兘鎭板綋澶勭悊4.1鐗堝垎鏍肩殑鏃堕棿鎴炽
路 灏咰ommon.Version鏇存敼涓篊ommon.DBVersion锛屼互閬垮厤鍚嶇О鍐茬獊銆
路 鏇存浜唂ield.cs锛屼粠鑰屼娇寰楁枃鏈垪鑳借繑鍥炴纭殑瀛楁绫诲瀷锛堟劅璋eni27@gmx.net锛夈
路 澧炲姞浜哅ySqlError绫伙紝浠ユ彁渚涘閿欒浠g爜鐨勪竴浜涘紩鐢紙鎰熻阿Geert Veenstra锛夈
路 澧炲姞浜哢nix濂楁帴瀛楁敮鎸侊紙鎰熻阿Mohammad DAMT [md@mt.web.id]锛夈
路 娌℃湁鍙敤鏁版嵁鏃讹紝浠呰皟鐢═hread.Sleep銆
路 璇ヤ簳浜嗗弬鏁版暟鎹腑寮曠敤瀛楃鐨勮浆涔夌壒鎬с
路 鍒犻櫎浜唒arameter.cs涓槗閫犳垚璇В鐨勬敞閲娿
路 鏇存浜嗚繛鎺ユ睜缂洪櫡銆
路 鍐嶆鏇存浜嗙浉鍚岀殑杩炴帴姹犵己闄凤紒锛 ;-)
路 鏇存浜咰onnectionSTring缂栬緫鍣ㄥ璇濇锛堟劅璋arco p (pomarc)锛夈
路 鐜板湪锛屽湪杩炴帴瀛楃涓蹭腑鏀寔UserId锛堟劅璋eff Neeley锛夈
路 鍒涘缓闈炶緭鍏ュ弬鏁版椂鎶涘嚭寮傚父锛堟劅璋yan Gregg锛夈
路 澧炲姞浜嗘洿澶氭枃妗c
路 鎻愪緵浜嗘柊鐨凪ultiHostStream鑳藉姏銆傝瘹鎸氭劅璋an Guisinger瀵规鐨勮础鐚傛槸浠栭娆℃彁渚涗簡鍦ㄨ繛鎺ュ瓧绗︿覆涓婃敮鎸佸鍙版満鍣ㄧ殑浠g爜鍜岃蹇点
路 澧炲姞浜嗗ぇ閲忔枃妗c備粛鏈夊緢澶氭枃妗i渶瑕佸鍔犮
路 鏇存浜嗕笌0.73鏈夊叧鐨勯熷害浜嬪疁銆
路 鏇存敼浜哅ySqlDataStream涓殑Thread.Sleep(0)锛屼互渚垮湪涓嶉渶瑕佺瓑寰呮椂浼樺寲鎬ц兘锛堟劅璋odd German锛夈
路 棰勫厛灏唅dlepools濉厖鍒颁簡MinPoolSize銆
路 涓珮璐ㄩ噺MySqlPool姝婚攣鏉′欢浠ュ強鎰氳牏鐨勭己闄凤紝鍏朵腑锛孋reateNewPooledConnection浠庝笉涓鸿繛鎺ユ睜娣诲姞鏂拌繛鎺ャ傛澶栵紝杩樻洿姝d簡MySqlStream.ReadBytes鍜孯eadByte锛屼粠鑰屼笉鍐嶄娇鐢ㄥ苟闈炲缁堟纭殑TicksPerSecond銆傦紙鎰熻阿Matthew J. Peddlesden锛夈
路 淇浜嗙簿搴﹀拰鏍囧害锛堟劅璋atthew J. Peddlesden锛夈
路 涓烘祦璇诲彇鏂规硶澧炲姞浜員hread.Sleep(1)锛屼娇涔嬪CPU鏇村弸濂斤紙鎰熻阿Sean McGinnis锛夈
路 鏇存浜咵xecuteReader鏈夋椂浼氳繑鍥濶ull鐨勯棶棰橈紙鎰熻阿Lloyd Dupont锛夈
路 鏇存浜嗕笌Null瀛楁澶勭悊鏈夊叧鐨勪富瑕佺己闄凤紙鎰熻阿Naucki锛夈
路 灏佽浜嗛拡瀵筸ax_allowed_packet鐨勬煡璇紝浠ュ強Try Catch涓殑瀛楃闆嗭紙骞惰缃负榛樿锛夈
路 鏇存浜嗗鎺ュ瓧鏈兘鎭板綋鍏抽棴鐨勯棶棰橈紙鎰熻阿Steve锛夈
路 鏇存浜咵xecuteNonQuery涓嶈兘濮嬬粓杩斿洖姝g‘鍊肩殑闂銆
路 鏇存浜咺nternalConnection锛屼笉浣跨敤@@session.max_allowed_packet锛岃屾槸浣跨敤@@max_allowed_packet銆傦紙鎰熻阿Miguel锛夈
路 澧炲姞浜嗗緢澶氭柊XML鏂囨。琛屻
路 鏇存浜哠QL瑙f瀽鍔熻兘锛屼笉鍙戦佹帶鏌ヨ锛堟劅璋ory锛夈
路 鏇存浜嗛槄璇诲櫒鍦ㄥ叧闂椂涓嶈兘unpeeking淇℃伅鍖呯殑闂銆
路 鏇存浜嗕笉鑳藉鐞嗙敤鎴峰彉閲忕殑闂锛堟劅璋ami Vaaraniemi锛夈
路 鏇存浜哅ySqlPool涓殑寰幆妫鏌ュ姛鑳斤紙鎰熻阿Steve M. Brown锛夈
路 鏇存浜哖arameterCollection.Add鏂规硶锛屼互涓嶴qlClient鍖归厤锛堟劅璋oshua Mouch锛夈
路 鏇存浜咰onnectionSTring瑙f瀽鍔熻兘锛屼互澶勭悊甯冨皵绫诲瀷鐨凬O鍜孻ES锛屼互鍙婇潪灏忓啓鍊硷紙鎰熻阿Naucki锛夈
路 澧炲姞浜咺nternalConnection绫伙紝淇敼浜嗚繛鎺ユ睜鍔熻兘銆
路 瀹炵幇浜哖ersist Security Info锛堟寔缁у畨鍏ㄤ俊鎭級銆
路 涓洪」鐩鍔犱簡security.cs鍜寁ersion.cs銆
路 鏇存浜哖arameter.cs涓殑DateTime澶勭悊鍔熻兘锛堟劅璋urkhard Perkens-Golomb锛夈
路 鏇存浜嗘煇浜涚被鍨嬫姏鍑篶ast寮傚父鐨勫弬鏁板簭鍒楀寲闂銆
路 鏇存浜咲ataReader锛岃浆鎹㈡墍鏈夌殑杩斿洖鍊间互闃叉鎶涘純閿欒锛堟劅璋eith Murray锛夈
路 涓篊ommand.ExecuteReader澧炲姞浜嗕唬鐮侊紝濡傛灉鍒濆SQL鍛戒护鎶涘嚭寮傚父锛屽皢杩斿洖Null锛堟劅璋urkhard Perkens-Golomb锛夈
路 鏋勯犱簡涓庨噸缁勪竴璧峰紩鍏xecuteScalar缂洪櫡銆
路 杩涜浜嗛噸鏂版瀯閫狅紝鍏佽LOCAL DATA INFILE锛屼互鍙婃洿濂界殑淇℃伅鍖呮帓搴忋
路 鏇存浜嗕笌閲嶇粍鏈夊叧鐨勬暟涓己闄枫
路 瀹屾垚浜嗗墠鏈熷伐浣滐紝鏀寔Mysql 4.1涓洿瀹夊叏鐨勫瘑鐮併備笉鍐嶆敮鎸4.1鐗堜腑鐨勬棫瀵嗙爜銆
路 姝g‘澶勭悊绯荤粺鍙傛暟鍚庢樉绀哄弬鏁帮紙Adam M. (adammil)锛夈
路 鐜板湪锛屽彲灏嗗瓧绗︿覆鐩存帴璧嬬粰blob瀛楁锛圓dam M.锛夈
路 鏇存浜嗘诞鐐瑰弬鏁帮紙鎰熻阿Pent锛夈
路 鏀瑰杽浜嗗弬鏁癱tor鍜孭arameterCollection.Add鏂规硶锛屼互鏇村ソ鍦板尮閰峉qlClient锛堟劅璋oshua Mouch锛夈
路 鏇存浜咰onnection.CreateCommand浠ヨ繑鍥濵ySqlCommand绫诲瀷銆
路 鏇存浜嗚繛鎺ュ瓧绗︿覆璁捐鍣ㄧ殑瀵硅瘽妗嗛棶棰橈紙鎰熻阿Abraham Guyt锛夈
路 鏇存浜嗕笌鍙戦佸懡浠ゆ棤娉曟绘槸璇诲彇鍝嶅簲淇℃伅鍖呮湁鍏崇殑闂锛堟劅璋oshua Mouch锛夈
路 鏇存浜嗘煇浜汢lob绫诲瀷鏃犳硶琚鐞嗙殑鍙傛暟搴忓垪鍖栭棶棰橈紙鎰熻阿Sean McGinnis锛夈
路 浠嶥ataReader浠g爜涓垹闄や簡浼狹essageBox.show锛堟劅璋oshua Mouch锛夈
路 鏇存浜唖plit sql浠g爜涓殑涓戦檵缂洪櫡锛堟劅璋㈡墍鏈変汉锛 :-) )
路 鏇存浜哅ySqlStream涓殑缂洪櫡锛屽嵆鍙兘浼氳鍙栬繃澶氭暟鎹紙鎰熻阿Peter Belbin锛夈
路 瀹炵幇浜咹asRows锛堟劅璋ash Pherson锛夈
路 鏇存浜嗗ぇ浜256鍒楃殑琛ㄤ細瀵艰嚧寮傚父鐨勯棶棰橈紙鎰熻阿Joshua Kessler锛夈
路 鏇存浜嗕互鈥;鈥濈粨鏉熺殑SQL璇彞浼氬鑷撮棶棰樼殑缂洪櫡锛堟劅璋hane Krueger锛夈
路 鏇存浜嗛┍鍔ㄤ腑鐨勭己闄凤紝鍗筹紝閿欒娑堟伅琚埅鍘1涓瓧绗︼紙鎰熻阿Shane Krueger锛夈
路 浣垮緱MySqlException鎴愪负鍙簭鍒楀寲鐨勶紙鎰熻阿Mathias Hasselmann锛夈
路 鏇存柊浜嗕竴浜涘瓧绗︿唬鐮侀〉锛屼娇涔嬫洿鍔犲噯纭
路 鏇存浜嗛槄璇诲櫒鑳藉鍦ㄥ凡鏈夋墦寮闃呰鍣ㄧ殑杩炴帴涓婃墦寮鐨勯棶棰樸
路 鍙戝竷浜0.70銆
路 灏嗘祴璇曠Щ鑷冲崟鐙殑MySqlClientTests涓嬨
路 鏇存浜嗛┍鍔ㄧ▼搴忓簭鍒楁贩涔辩殑鎰氳牏闂锛堟劅璋eter Belbin锛夈
路 澧炲姞浜嗕竴浜涚閬撴祴璇曘
路 灏嗛粯璁ゆ渶澶ф睜澶у皬澧炲姞鍒50銆
路 涓嶮ono 0-24涓璧疯繘琛屼簡缂栬瘧銆
路 鏇存浜嗚繛鎺ュ拰鏁版嵁闃呰鍣ㄥ鐞嗛棶棰樸
路 涓哄弬鏁板簭鍒楀寲澧炲姞浜嗗瓧绗︿覆鏁版嵁绫诲瀷澶勭悊鍔熻兘銆
路 鏇存浜嗘姏鍑哄紓甯稿悗鍦ㄩ┍鍔ㄧ▼搴忎腑鍑虹幇鐨勯『搴忛棶棰橈紙鎰熻阿Burkhard Perkens-Golomb锛夈
路 澧炲姞浜嗗CommandBehavior.SingleRow鍒癉ataReader鐨勬敮鎸併
路 鏇存浜嗗懡浠ql鐨勫鐞嗗姛鑳斤紝浠ヤ究鑳芥洿濂藉湴澶勭悊寮曠敤锛堟劅璋heo Spears锛夈
路 鏇存浜哾ouble銆乻ingle鍜宒ecimal鍊肩殑瑙f瀽闂锛屼互瑙i噴闈炶嫳鏂囧垎闅旂銆傚鏋滀綘姝d娇鐢ㄧ‖缂栫爜sql锛屼粛椤讳娇鐢ㄦ纭殑璇硶锛屼絾鏄紝濡傛灉浣犱娇鐢ㄥ弬鏁帮紝浠g爜灏嗚浆鎹㈡诞鐐圭被鍨嬶紝浠ヤ究鍦ㄨ繘鍑烘湇鍔″櫒鐨勮繃绋嬩腑鎭板綋鍦板湪鍐呴儴浣跨敤鈥.鈥濄俒鎰熻阿鍖垮悕浜篯銆
路 澧炲姞浜哅ySqlStream绫伙紝浠ョ畝鍖栬秴鏃跺拰椹卞姩缂栫爜銆
路 鏇存浜咲ataReader锛屼互渚垮湪鐩稿叧杩炴帴鍏抽棴鏃舵伆褰撳湴鍏抽棴瀹冦俒鎰熻阿smishra]銆
路 浣垮緱瀹㈡埛绔洿鍏煎SqlClient锛屽湪杩炴帴鑳藉鐢ㄤ簬杩愯鍙︿竴鍛戒护鍓嶅叧闂璂ataReaders銆
路 鏀硅繘浜嗗瓧娈典腑鐨凞BNull.Value澶勭悊鍔熻兘銆
路 澧炲姞浜嗘暟涓崟鍏冩祴璇曘
路 鏇存浜哅ySqlException锛屼互渚胯兘璋冪敤鍩烘湰绫伙細-o
路 鏀硅繘浜嗛┍鍔ㄧ紪鐮併
路 鏇存浜哊extResult鍦ㄦ渶鍚1涓粨鏋滈泦涓婅繑鍥炩滃亣鈥濈殑缂洪櫡銆
路 涓篗ySQL澧炲姞浜嗗涓祴璇曘
路 閫氳繃绛夊寲鏃犵鍙32bit鍊煎拰Int64锛屼互鍙婃棤绗﹀彿16bit鍊煎拰Int32绛夛紝鏀硅繘浜嗘姏寮冮棶棰樸
路 涓篗ySqlParameter澧炲姞浜嗘柊鐨刢tor锛堝悕绉般佺被鍨嬨佸ぇ灏忋乻rccol锛夈
路 鏇存浜哅ySqlDataReader涓瓨鍦ㄧ殑闂锛屽嵆锛屽湪杩斿洖瀛楁璁℃暟鍓嶏紝涓嶈兘妫鏌ョ┖鐨勫瓧娈靛垪琛ㄣ
路 寮濮嬪鍔犱簡MySqlClient鍗曞厓娴嬭瘯锛堝鍔犱簡MySqlClient/Tests鏂囦欢澶逛互鍙婁竴浜涙祴璇曡寖渚嬶級銆
路 鏇存浜嗚繛鎺ュ瓧绗︿覆澶勭悊涓殑涓浜涢棶棰樸
路 灏咺NIT_DB绉诲埌MySqlPool銆傚彲鎴栬浼氬湪姝ょЩ鍔ㄥ畠锛岃繖鏄湪鍗忓晢鐨勫噯澶囪繃绋嬩腑銆
路 鏇存浜咰ommandBuilder涓瓨鍦ㄧ殑缂洪櫡锛岃缂洪櫡浼氶樆姝㈡彃鍏ユ纭嚭鐜般
路 鏀瑰啓浜嗕竴浜涘唴閮ㄦ瀯浠讹紝浠庤屼娇寰桟ommand鐨勬墍鏈変笁绉嶆墽琛屾柟娉曞潎鑳芥纭伐浣溿
路 鏇存浜嗗湪鍩哄噯娴嬭瘯杩囩▼涓彂鐜扮殑涓浜涘皬闂銆
路 CoonectionPooling鐨勯娆℃埅闄ゅ伐浣滄伆褰撱備繚鐣欎簡鈥渕in pool size鈥濆拰鈥渕ax pool size鈥濄
路 杩涜澶勭悊锛屽厑璁歌繑鍥炲涓粨鏋滈泦銆
路 鐜板湪锛屽瓧绗﹂泦鐨勫鐞嗘洿涓烘櫤鑳藉寲銆傚惎鍔ㄦ椂锛岄┍鍔ㄧ▼搴忔煡璇ySQL锛屽鎵鹃粯璁ょ殑瀛楃闆嗐傞殢鍚庯紝濡傛灉鑳藉鍔犺浇浠g爜椤碉紝璇ュ瓧绗﹂泦灏嗙敤浜庤浆鎹€傚涓嶇劧锛屽皢浣跨敤褰撳墠鎿嶄綔绯荤粺鐨勯粯璁や唬鐮侀〉銆
路 澧炲姞浜嗕唬鐮侊紝浠ヤ究灏嗘帹鏂殑绫诲瀷淇濆瓨鍦ㄥ悕绉帮紝浠ュ強鍙傛暟鐨勫糲tor涓
路 姝ゅ锛屽鏋滀娇鐢╒alue灞炴ф洿鏀逛簡绌哄弬鏁扮殑鍊硷紝杩樿兘鎺ㄦ柇绫诲瀷銆
路 杞崲浜嗘墍鏈夌殑鏂囦欢浠ヤ娇鐢ㄦ伆褰撶殑Camel鑼冧緥銆傜幇鍦紝鍦ㄦ墍鏈夋枃浠朵腑锛孧ySQL鏄疢ySql銆侾gSQL鐜板湪鏄疨gSql銆
路 涓篜gSql浠g爜澧炲姞浜嗗睘鎬э紝浠ラ槻姝㈣璁″櫒鏄剧ず瀹冦
路 涓哄弬鏁板璞″鍔犱簡MySQLDbType灞炴э紝骞朵负浠嶥bType鍒癕ySQLDbType鐨勮浆鎹㈠鍔犱簡鎭板綋鐨勮浆鎹唬鐮併
路 浠嶮ySQLParameter.cs涓垹闄や簡浠庢湭浣跨敤鐨凮bjectToString鏂规硶銆
路 鏇存浜哖arameterCollection涓殑Add(..)鏂规硶锛屼笉蹇呬娇鐢ˋdd(name, value)鍙栬屼唬涔嬨
路 鏇存浜哖arameterCollection涓殑IndexOf鍜孋ontains锛屼娇涔嬫竻妤氫繚瀛樺弬鏁板悕鏃朵笉闇瑕丂銆
路 鏇存浜咰ommand.ConvertSQLToBytes锛屼粎鍏佽鑳藉鏋勫嚭鐜板湪MySQL鍙橀噺鍚嶄腑鐨勫瓧绗︺
路 鏇存浜咲ataReader鍜屽瓧娈碉紝浠庤屼娇寰桞lob瀛楁鑳藉浠嶧ield.cs璇诲彇鍏舵暟鎹紝鑰屼笖GetBytes宸ヤ綔姝g‘銆
路 涓篗ySQLCommand鐨凜ommandText灞炴у鍔犱簡绠鍗曠殑鏋勯犲櫒缂栬緫鍣ㄣ
路 鏇存浜咰ommandBuilder鍜孭arameter搴忓垪鍖栵紝鎸囨槑鍦ㄥ弬鏁板悕绉颁腑涓嶄繚瀛楡銆
路 浠嶧ield.cs鍒犻櫎浜哅ySQLFieldType enum锛岀幇浣跨敤MySQLDbType enum銆
路 涓烘暟涓被澧炲姞浜咲esigner灞炴э紝闃叉浜嗕娇鐢╒S.Net鏃剁殑璁捐鍣ㄨ鍥俱
路 鏇存浜咰onnectionString璁捐鍣ㄤ腑鐨勫垵濮嬬洰褰曠被鍨嬨
路 鍒犻櫎浜嗕笌锛堝悕绉般佺被鍨嬨佸硷級鍐茬獊鐨3绉峂ySQLParameter鍙傛暟ctor銆
路 鏇存敼浜哅ySQLParameter锛岀幇鍦ㄨ兘澶熶繚瀛榩aramName鑰屾棤闇鍓嶅@锛堣繖淇浜嗕娇鐢ㄨ璁″櫒鏄殑Null鎻掑叆闂锛夈
路 鏇存敼浜嗙敤浜嶮ySQLParameter鐨凾ypeConverter锛屼互渚胯兘澶熶笌鎵鏈夊睘鎬т竴璧蜂娇鐢╟tor銆
路 鏇存浜嗛┍鍔ㄧ▼搴忎腑鐨勯『搴忛棶棰樸
路 澧炲姞浜咲bParametersEditor锛屼娇寰楀弬鏁扮紪杈戞洿鍍廠qlClient銆
路 鏇存浜咰ommand绫伙紝浠ヤ究鑳藉浣跨敤璁捐鍣ㄧ紪杈戝弬鏁般
路 鏇存柊浜嗚繛鎺ュ瓧绗︿覆璁捐鍣紝鏀寔浣跨敤鍘嬬缉鏍囧織銆
路 鏇存浜嗗瓧绗︿覆缂栫爜鍔熻兘锛屼粠鑰屼娇寰楁娲插瓧绗︼紙濡盲锛夎兘澶熸纭伐浣溿
路 鍒涘缓浜嗗熀鏈被锛屼互甯姪鍒涘缓鏂扮殑鏁版嵁Provider銆
路 鍦ㄨ繛鎺ュ瓧绗︿覆涓鍔犱簡瀵筓ID鍏抽敭瀛楃殑鏀寔銆
路 瀛楁銆佸弬鏁板拰鍛戒护鐜板湪閮借兘浣跨敤DBNull.Value锛岃屼笉鏄痭ull銆
路 浣跨敤DBNull.Value鐨凜ommandBuilder銆
路 鏈嚭鐜癮uto_insert瀛楁鏃讹紝CommandBuilder鐜板湪鑳芥纭垱寤烘彃鍏ュ懡浠ゃ
路 鐜板湪锛屽瓧娈典娇鐢╰ypeof鍏抽敭瀛楁潵杩斿洖System.Types锛堟ц兘锛夈
路 鐩墠瀹炵幇浜哅ySQLCommandBuilder銆
路 鐩墠瀹炵幇浜嗕簨鍔℃敮鎸侊紙骞堕潪鎵鏈夌殑琛ㄧ被鍨嬪潎鏀寔瀹冿級銆
路 鏇存浜咷etSchemaTable锛屼笉鍐嶄娇鐢▁sd锛堝浜嶮ono锛夈
路 椹卞姩绋嬪簭鍏堣兘鍏煎Mono锛侊紒
路 鐜板湪鏀寔TIME鏁版嵁绫诲瀷銆
路 闇瑕佹洿澶氬伐浣滀互鏀瑰杽Timestamp鏁版嵁绫诲瀷澶勭悊銆
路 鏇存敼浜嗘墍鏈夌被鐨勭壒寰佷互鍖归厤瀵瑰簲鐨凷qlClient绫汇
路 閲囩敤SharpZipLib鐨勫崗璁帇缂╋紙www.icsharpcode.net锛夈
路 Windows骞冲彴涓婄殑鍛藉悕绠¢亾鐜板伐浣滄甯搞
路 瀹屾垚浜嗘洿澶氬伐浣滐紝鏀瑰杽浜員imestamp鏁版嵁绫诲瀷澶勭悊銆
路 鍦―ataReader涓婂疄鐜颁簡Ienumerable锛屼互浣緿ataGrid鑳芥伆褰撳伐浣溿
閫氳繃JDBC椹卞姩锛孧ySQL鎻愪緵浜嗕笌浣跨敤Java缂栫▼璇█寮鍙戠殑瀹㈡埛绔簲鐢ㄧ▼搴忕殑杩為氭э紝璇ラ┍鍔ㄧО涓篗ySQL Connector/J銆
MySQL Connector/J鏄竴绉岼DBC-3.0鈥滅被鍨4鈥濋┍鍔紝杩欐剰鍛崇潃瀹冩槸涓绉嶇函Java绋嬪簭锛屽疄鏂戒簡3.0鐗圝DBC瑙勮寖锛屽苟鑳戒娇鐢∕ySQL鍗忚涓嶮ySQL鏈嶅姟鍣ㄧ洿鎺ラ氫俊銆
鏈枃妗f槸涓哄垵绾DBC寮鍙戜汉鍛樺噯澶囧拰瀹夋帓鐨勩傚鏋滀綘宸叉湁浜嗕娇鐢↗DBC鏂归潰鐨勭粡楠岋紝鍙洿鎺ヤ粠瀹夎 Connector/J寮濮嬨
灏界JDBC鏈韩寰堟湁鐢紝浣嗘垜浠笇鏈涳紝濡傛灉浣犲湪闃呰瀹屾湰鎵嬪唽鐨勫墠鍑犺妭鍚庡皻鏈啛鎮塉DBC锛岄櫎浜嗘渶骞冲父鐨勯棶棰樺搴旈伩鍏嶅叏闈娇鐢ㄢ滆8鈥滼DBC锛屽簲鑰冭檻浣跨敤娴佽鐨勬灦鏋勶紝濡Hibernate銆Spring鐨JDBC妯℃澘鎴Ibatis SQL Maps绛夛紝浣跨敤瀹冧滑鏉ュ畬鎴愬ぇ澶氭暟閲嶅鎬у伐浣滐紝浠ュ強鍦ㄦ煇浜涙椂渚渶瑕佺敤鍒癑DBC鐨勭箒閲嶄换鍔°
鏈妭涓嶆槸浣滀负瀹屾暣鐨凧DBC鏁欑▼鑰岃璁$殑銆傚鏋滈渶瑕佷簡瑙d娇鐢↗DBC鏂归潰鐨勬洿澶氫俊鎭紝鎴栬浼氬涓嬭堪鍦ㄧ嚎鏁欑▼鎰熷叴瓒o紝涓庤繖閲屾彁渚涚殑淇℃伅鐩告瘮锛屽畠浠粙缁嶇殑鏇翠负璇︾粏鍜屾洿鍏锋繁搴︺
路 JDBC鍩虹锛孲un鍏徃鎻愪緵鐨勬暀绋嬶紝娑电洊浜咼DBC鐨勫熀鏈富棰樸傘
路 JDBC绠鏄庤绋锛孲un鍜孞Guru鎻愪緵浜嗘洿娣辩殑鏁欑▼銆
闇瑕佸憡璇塂riverManager搴斾笌鍝釜JDBC椹卞姩寤虹珛杩炴帴銆傚畬鎴愯浠诲姟鐨勬渶绠鍗曟柟娉曟槸锛氬湪瀹炴柦浜唈ava.sql.Driver鎺ュ彛鐨勭被涓婁娇鐢–lass.forName()銆傚浜嶮ySQL Connector/J锛岃绫荤殑鍚嶇О鏄痗om.mysql.jdbc.Driver銆傞噰鐢ㄨ鏂规硶锛屽彲浣跨敤澶栭儴閰嶇疆鏂囦欢鏉ユ彁渚涜繛鎺ュ埌鏁版嵁搴撴椂灏嗕娇鐢ㄧ殑椹卞姩绫诲悕鍜岄┍鍔ㄥ弬鏁般
鍦ㄤ笅闈㈢殑Java浠g爜涓紝浠嬬粛浜嗗湪搴旂敤绋嬪簭鐨刴ain()鏂规硶涓敞鍐孧ySQL Connector/J鐨勬柟寮忥細
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
// Notice, do not import com.mysql.jdbc.*
// or you will have problems!锛堟敞鎰忥紝涓嶈瀵煎叆com.mysql.jdbc.*锛屽惁鍒// 灏嗗嚭鐜伴棶棰橈紒锛
public class LoadDriver {
public static void main(String[] args) {
try {
// The newInstance() call is a work around for some
// broken Java implementations
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (Exception ex) {
// handle the error
}
}
鍦―riverManager涓敞鍐屼簡椹卞姩鍚庯紝閫氳繃璋冪敤DriverManager.getConnection()锛岃兘澶熻幏寰椾笌鐗规畩鏁版嵁搴撶浉杩炵殑杩炴帴瀹炰緥銆
绀轰緥26.1锛氫粠DriverManager鑾峰緱杩炴帴
鍦ㄦ湰绀轰緥涓紝浠嬬粛浜嗕粠DriverManager鑾峰緱杩炴帴瀹炰緥鐨勬柟娉曘傚浜巊etConnection()鏂规硶锛屾湁涓浜涗笉鍚岀殑鐗规с傚叧浜庡浣曚娇鐢ㄥ畠浠殑鏇村淇℃伅锛岃鍙傞槄涓嶫DK涓璧锋彁渚涚殑API鏂囨。銆
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
... try {
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/test?user=monty&password=greatsqldb");
// Do something with the Connection
....
} catch (SQLException ex) {
// handle any errors
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
}
涓鏃﹀缓绔嬩簡杩炴帴锛屽畠鍙鐢ㄤ簬鍒涘缓璇彞鍜孭reparedStatements锛屽苟妫绱㈠叧浜庢暟鎹簱鐨勫厓鏁版嵁銆傚湪涓嬮潰鏁拌妭鍐咃紝缁欏嚭浜嗚繘涓姝ョ殑瑙i噴銆
浣跨敤璇彞锛屽彲鎵ц鍩烘湰鐨凷QL鏌ヨ锛屽苟閫氳繃涓嬮潰浠嬬粛鐨凴esultSet绫绘绱㈢粨鏋溿
瑕佹兂鍒涘缓璇彞瀹炰緥锛屽簲閫氳繃鍓嶉潰浠嬬粛鐨凞riverManager.getConnection()鎴朌ataSource.getConnection()鏂规硶涔嬩竴锛屽湪妫绱㈢殑杩炴帴瀵硅薄涓婅皟鐢╟reateStatement()鏂规硶銆
涓鏃︽嫢鏈変簡璇彞瀹炰緥锛屽彲浠ヤ笌甯屾湜浣跨敤鐨凷QL涓璧烽氳繃璋冪敤executeQuery(String)鏂规硶鎵цSELECT鏌ヨ銆
瑕佹兂鏇存柊鏁版嵁搴撲腑鐨勬暟鎹紝鍙娇鐢╡xecuteUpdate(String SQL)鏂规硶銆傝鏂规硶灏嗚繑鍥炲彈鏇存柊璇彞褰卞搷鐨勮鏁般
濡傛灉浣犱簨鍏堜笉娓呮SQL璇彞鏄疭ELECT鎴朥PDATE/INSERT锛屽簲浣跨敤execute(String SQL)鏂规硶銆傚鏋淪QL鏌ヨ鏄疭ELECT锛屾湰鏂规硶灏嗚繑鍥炩滅湡鈥濓紝濡傛灉SQL鏌ヨ鏄疷PDATE/INSERT/DELETE锛屾湰鏂规硶灏嗚繑鍥炩滃亣鈥濄傚鏋滄槸SELECT鏌ヨ锛岃兘澶熼氳繃璋冪敤getResultSet()鏂规硶妫绱㈢粨鏋溿傚鏋滄槸UPDATE/INSERT/DELETE鏌ヨ锛岃兘澶熼氳繃鍦ㄨ鍙ュ疄渚嬩笂璋冪敤getUpdateCount()妫绱㈠彈褰卞搷鐨勮璁℃暟銆
绀轰緥26.2锛氫娇鐢╦ava.sql.Statement鎵цSELECT鏌ヨ
// assume conn is an already created JDBC connection Statement stmt = null; ResultSet rs = null; try { stmt = conn.createStatement(); rs = stmt.executeQuery("SELECT foo FROM bar"); // or alternatively, if you don't know ahead of time that // the query will be a SELECT... if (stmt.execute("SELECT foo FROM bar")) { rs = stmt.getResultSet(); } // Now do something with the ResultSet .... } finally { // it is a good idea to release // resources in a finally{} block // in reverse-order of their creation // if they are no-longer needed if (rs != null) { try { rs.close(); } catch (SQLException sqlEx) { // ignore } rs = null; } if (stmt != null) { try { stmt.close(); } catch (SQLException sqlEx) { // ignore } stmt = null; } }
浠嶮ySQL鏈嶅姟鍣5.0鐗堝紑濮嬶紝涓嶤onnector/J 3.1.1鎴栨洿鏂扮増鏈竴璧蜂娇鐢ㄦ椂锛屽彲瀹屽叏瀹炵幇java.sql.CallableStatement鎺ュ彛锛浣getParameterMetaData()鏂规硶渚嬪銆
鍦∕ySQL鍙傝冩墜鍐岀殑鈥瀛樺偍绋嬪簭鍜屽嚱鏁鈥濅竴鑺備腑锛屼粙缁嶄簡MySQL瀛樺偍绋嬪簭鐨勮娉曘
閫氳繃JDBC鐨CallableStatement鎺ュ彛锛Connector/J鎸囨槑浜嗗瓨鍌ㄧ▼搴忕殑鍔熻兘銆
鍦ㄤ笅闈㈢殑绀轰緥涓紝缁欏嚭浜1涓瓨鍌ㄧ▼搴忥紝瀹冭繑鍥炲閲忎负1鐨inOutParam鐨勫硷紝骞堕氳繃inputParam浼犻掍簡浣滀负ResultSet鐨勫瓧绗︿覆銆
绀轰緥26.3. 瀛樺偍绋嬪簭绀轰緥
CREATE PROCEDURE demoSp(IN inputParam VARCHAR(255), INOUT inOutParam INT)
BEGIN
DECLARE z INT;
SET z = inOutParam + 1;
SET inOutParam = z;
SELECT inputParam;
SELECT CONCAT('zyxw', inputParam);
END
瑕佹兂涓嶤onnector/J涓璧蜂娇鐢demoSp锛屽彲閲囧彇涓嬭堪姝ラ锛
1. 浣跨敤Connection.prepareCall()鍑嗗鍙皟鐢ㄨ鍙ャ
娉ㄦ剰锛屽繀椤讳娇鐢↗DBC杞箟璇硶锛岃屼笖蹇呴』浣跨敤鍖呭惈鍗犱綅绗︾殑鍦嗘嫭鍙凤細
绀轰緥26.4. 浣跨敤Connection.prepareCall()
瀵煎叆java.sql.CallableStatement锛
...
//
// Prepare a call to the stored procedure 'demoSp'
// with two parameters
//
// Notice the use of JDBC-escape syntax ({call ...})
//
CallableStatement cStmt = conn.prepareCall("{call demoSp(?, ?)}");
cStmt.setString(1, "abcdefg");
Connection.prepareCall()鏄竴绉嶅紑閿寰堝ぇ鐨勬柟娉曪紝鍘熷洜鍦ㄤ簬椹卞姩绋嬪簭鎵ц鐨勬敮鎸佽緭鍑哄弬鏁扮殑鍏冩暟鎹绱€傚嚭浜庢ц兘鏂归潰鐨勫師鍥狅紝搴斿湪浣犵殑浠g爜涓啀娆′娇鐢CallableStatement瀹炰緥锛岄氳繃璇ユ柟寮忥紝浣垮Connection.prepareCall()鐨勪笉蹇呰璋冪敤闄嶈嚦鏈浣庛
2. 娉ㄥ唽杈撳嚭鍙傛暟锛堝鏋滄湁鐨勮瘽锛
涓轰簡妫绱㈣緭鍑哄弬鏁扮殑鍊硷紙鍒涘缓瀛樺偍绋嬪簭鏃舵寚瀹氫负OUT鎴朓NOUT鐨勫弬鏁帮級锛JDBC瑕佹眰鍦CallableStatement鎺ュ彛涓娇鐢ㄥ悇绉峳egisterOutputParameter()鏂规硶鏉ユ墽琛岃鍙ヤ箣鍓嶆寚瀹氬畠浠細
绀轰緥26.5. 娉ㄥ唽杈撳嚭鍙傛暟
瀵煎叆java.sql.Types锛
...
//
// Connector/J supports both named and indexed
// output parameters. You can register output
// parameters using either method, as well
// as retrieve output parameters using either
// method, regardless of what method was
// used to register them.
//
// The following examples show how to use
// the various methods of registering
// output parameters (you should of course
// use only one registration per parameter).
//
//
// Registers the second parameter as output
//
cStmt.registerOutParameter(2);
//
// Registers the second parameter as output, and
// uses the type 'INTEGER' for values returned from
// getObject()
//
cStmt.registerOutParameter(2, Types.INTEGER);
//
// Registers the named parameter 'inOutParam'
//
cStmt.registerOutParameter("inOutParam");
//
// Registers the named parameter 'inOutParam', and
// uses the type 'INTEGER' for values returned from
// getObject()
//
cStmt.registerOutParameter("inOutParam", Types.INTEGER);
...
3. 璁剧疆杈撳叆鍙傛暟锛堝鏋滄湁鐨勮瘽锛
杈撳叆浠ュ強杈撳叆锛忚緭鍑哄弬鏁版槸浣滀负PreparedStatement瀵硅薄鑰岃缃殑銆浣嗘槸锛CallableStatement涔熸敮鎸佹寜鍚嶇О璁剧疆鍙傛暟锛
绀轰緥26.6. 璁剧疆CallableStatement杈撳叆鍙傛暟
...
//
// Set a parameter by index
//
cStmt.setString(1, "abcdefg");
//
// Alternatively, set a parameter using
// the parameter name
//
cStmt.setString("inputParameter", "abcdefg");
//
// Set the 'in/out' parameter using an index
//
cStmt.setInt(2, 1);
//
// Alternatively, set the 'in/out' parameter
// by name
//
cStmt.setInt("inOutParam", 1);
...
4. 鎵цCallableStatement锛屽苟妫绱换浣曠粨鏋滈泦鎴栬緭鍑哄弬鏁般
灏界CallableStatement鏀寔璋冪敤浠讳綍璇彞鎵ц鏂规硶锛executeUpdate()锛executeQuery()鎴execute()锛夛紝鏈鐏垫椿鐨勬柟娉曟槸璋冪敤execute()锛岃繖鏄洜涓猴紝閲囩敤璇ユ柟娉曪紝浣犳棤闇浜嬪厛鐭ラ亾瀛樺偍绋嬪簭鏄惁灏嗚繑鍥炵粨鏋滈泦锛
绀轰緥26.7. 妫绱㈢粨鏋滃拰杈撳嚭鍙傛暟鍊
...
boolean hadResults = cStmt.execute();
//
// Process all returned result sets
//
while (hadResults) {
ResultSet rs = cStmt.getResultSet();
// process result set
...
hadResults = cStmt.getMoreResults();
}
//
// Retrieve output parameters
//
// Connector/J supports both index-based and
// name-based retrieval
//
int outputValue = cStmt.getInt(1); // index-based
outputValue = cStmt.getInt("inOutParam"); // name-based
...
绀轰緥26.8. 浣跨敤Statement.getGeneratedKeys()妫绱UTO_INCREMENT鍒楃殑鍊
Statement stmt = null; ResultSet rs = null; try { // // Create a Statement instance that we can use for // 'normal' result sets assuming you have a // Connection 'conn' to a MySQL database already // available stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_UPDATABLE); // // Issue the DDL queries for the table for this example // stmt.executeUpdate("DROP TABLE IF EXISTS autoIncTutorial"); stmt.executeUpdate( "CREATE TABLE autoIncTutorial (" + "priKey INT NOT NULL AUTO_INCREMENT, " + "dataField VARCHAR(64), PRIMARY KEY (priKey))"); // // Insert one row that will generate an AUTO INCREMENT // key in the 'priKey' field // stmt.executeUpdate( "INSERT INTO autoIncTutorial (dataField) " + "values ('Can I Get the Auto Increment Field?')", Statement.RETURN_GENERATED_KEYS); // // Example of using Statement.getGeneratedKeys() // to retrieve the value of an auto-increment // value // int autoIncKeyFromApi = -1; rs = stmt.getGeneratedKeys(); if (rs.next()) { autoIncKeyFromApi = rs.getInt(1); } else { // throw an exception from here } rs.close(); rs = null; System.out.println("Key returned from getGeneratedKeys():" + autoIncKeyFromApi); } finally { if (rs != null) { try { rs.close(); } catch (SQLException ex) { // ignore } } if (stmt != null) { try { stmt.close(); } catch (SQLException ex) { // ignore } } }
绀轰緥26.9. 浣跨敤SELECT LAST_INSERT_ID()妫绱UTO_INCREMENT鍒楃殑鍊
Statement stmt = null; ResultSet rs = null; try { // // Create a Statement instance that we can use for // 'normal' result sets. stmt = conn.createStatement(); // // Issue the DDL queries for the table for this example // stmt.executeUpdate("DROP TABLE IF EXISTS autoIncTutorial"); stmt.executeUpdate( "CREATE TABLE autoIncTutorial (" + "priKey INT NOT NULL AUTO_INCREMENT, " + "dataField VARCHAR(64), PRIMARY KEY (priKey))"); // // Insert one row that will generate an AUTO INCREMENT // key in the 'priKey' field // stmt.executeUpdate( "INSERT INTO autoIncTutorial (dataField) " + "values ('Can I Get the Auto Increment Field?')"); // // Use the MySQL LAST_INSERT_ID() // function to do the same thing as getGeneratedKeys() // int autoIncKeyFromFunc = -1; rs = stmt.executeQuery("SELECT LAST_INSERT_ID()"); if (rs.next()) { autoIncKeyFromFunc = rs.getInt(1); } else { // throw an exception from here } rs.close(); System.out.println("Key returned from " + "'SELECT LAST_INSERT_ID()': " + autoIncKeyFromFunc); } finally { if (rs != null) { try { rs.close(); } catch (SQLException ex) { // ignore } } if (stmt != null) { try { stmt.close(); } catch (SQLException ex) { // ignore } } }
绀轰緥26.10. 鍦ㄥ彲鏇存柊鐨凴esultSets涓绱UTO_INCREMENT鍒楃殑鍊
Statement stmt = null; ResultSet rs = null; try { // // Create a Statement instance that we can use for // 'normal' result sets as well as an 'updatable' // one, assuming you have a Connection 'conn' to // a MySQL database already available // stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_UPDATABLE); // // Issue the DDL queries for the table for this example // stmt.executeUpdate("DROP TABLE IF EXISTS autoIncTutorial"); stmt.executeUpdate( "CREATE TABLE autoIncTutorial (" + "priKey INT NOT NULL AUTO_INCREMENT, " + "dataField VARCHAR(64), PRIMARY KEY (priKey))"); // // Example of retrieving an AUTO INCREMENT key // from an updatable result set // rs = stmt.executeQuery("SELECT priKey, dataField " + "FROM autoIncTutorial"); rs.moveToInsertRow(); rs.updateString("dataField", "AUTO INCREMENT here?"); rs.insertRow(); // // the driver adds rows at the end // rs.last(); // // We should now be on the row we just inserted // int autoIncKeyFromRS = rs.getInt("priKey"); rs.close(); rs = null; System.out.println("Key returned for inserted row: " + autoIncKeyFromRS); } finally { if (rs != null) { try { rs.close(); } catch (SQLException ex) { // ignore } } if (stmt != null) { try { stmt.close(); } catch (SQLException ex) { // ignore } } }
鐢变簬瀹炵幇浜唈ava.sql.Savepoint锛孋onnector/J 3.1.0鍜屾洿鏂扮増鏈笉浼氳繍琛屽湪鏃╀簬1.4鐗堢殑JDK涓婏紝闄ら潪鍏抽棴浜嗙被楠岃瘉鍣紙-Xverify:none锛夛紝杩欐槸鍥犱负锛岀被楠岃瘉鍣ㄥ皢璇曞浘鍔犺浇鐢ㄤ簬java.sql.Savepoint鐨勭被瀹氫箟锛岄櫎闈炰娇鐢ㄤ簡savepoint鍔熻兘锛屽惁鍒欓┍鍔ㄧ▼搴忎笉浼氳闂被楠岃瘉鍣ㄣ
鏃╀簬1.4.x鐗堢殑JVM涓婏紝涓嶈兘浣跨敤Connector/J 3.1.0鎴栨洿楂樼増鏈彁渚涚殑鏂扮紦鍐插姛鑳斤紝杩欐槸鍥犱负璇ュ姛鑳戒緷璧鍦JDK-1.4.0涓棣栨鎻愪緵鐨java.util.LinkedHashMap銆
涓嶮ySQL鏈嶅姟鍣4.1鐗堟垨鏇撮珮鐗堟湰寤虹珛杩炴帴鏃讹紝鏈濂戒娇鐢∕ySQL Connector/J 3.1鐗堬紝杩欐槸鍥犱负瀹冨叏闈㈡敮鎸佽緝鏂扮増鏈殑鏈嶅姟鍣ㄦ彁渚涚殑鐗规э紝鍖呮嫭Unicode瀛楃銆佽鍥俱佸瓨鍌ㄧ▼搴忓拰鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ャ
灏界3.0鐗圕onnector/J鑳藉涓嶮ySQL鏈嶅姟鍣4.1鎴栨洿楂樼増鏈缓绔嬭繛鎺ワ紝浣嗙敱浜庡疄鐜颁簡Unicode瀛楃鍜屾柊鐨勯壌瀹氭満鍒讹紝灏嗘棤娉曟洿鏂癈onnector/J 3.0浠ユ敮鎸佸綋鍓嶅拰鏈潵鏈嶅姟鍣ㄧ増鏈腑鎻愪緵鐨勬柊鐗规с
浠嶤onnector/J 3.1.9寮濮嬶紝鎴戜滑涓嶅啀鍗曠嫭鎻愪緵.class鏂囦欢锛屼粎鍦ㄤ笌椹卞姩绋嬪簭涓璧锋彁渚涚殑JAR鏂囦欢涓彁渚涘畠浠
涓嶅簲浣跨敤椹卞姩绋嬪簭鐨勨滆皟璇曠増鈥濓紝闄ら潪鏄湪鍚慚ySQL AB閫氭姤闂鎴栫己闄锋椂闇瑕佺敤鍒板畠锛岃繖鏄洜涓衡滆皟璇曠増鈥濅笉鏄负鐢熶骇鐜涓嬬殑杩愯鑰岃璁$殑锛屽鏋滀娇鐢ㄥ畠锛屼細瀵规ц兘閫犳垚璐熼潰褰卞搷銆備簩杩涘埗浠g爜鐨勮皟璇曞彇鍐充簬Aspect/J杩愯鏃跺簱锛岃搴撲綅浜庝笌Connector/J鍒嗗彂鐗堜竴璧锋彁渚涚殑src/lib/aspectjrt.jar鏂囦欢涓
闇瑕佷娇鐢ㄦ伆褰撶殑GUI鎴栧懡浠よ浣跨敤宸ュ叿鏉ヨВ寮鍒嗗彂鏂囦欢锛堜緥濡傦紝鐢ㄤ簬.zip鏂囦欢鐨刉inZip锛屼互鍙婄敤浜.tar.gz鏂囦欢鐨勨渢ar鈥濓級銆傜敱浜庡湪鍒嗗彂鐗堜腑鍙兘瀛樺湪闀挎枃浠跺悕锛屾垜浠噰鐢ㄤ簡GNU tar妗f鏍煎紡銆傞渶瑕佷娇鐢℅NU tar锛堟垨鑳界悊瑙NU tar妗f鏍煎紡鐨勫叾浠栧簲鐢ㄧ▼搴忥級鏉ヨВ寮鍒嗗彂鐗堢殑.tar.gz鏂囦欢銆
涓鏃﹁В鍖呬簡鍒嗗彂鐗堟。妗堟枃浠讹紝鍙互灏唌ysql-connector-java-[version]-bin.jar鏀惧湪浣犵殑绫昏矾寰勪腑锛屾垨鏄湪浣犵殑CLASSPATH鐜鍙橀噺涓坊鍔犲畠鐨勫畬鏁磋矾寰勶紝鎴栨槸鍦ㄥ惎鍔↗VM锛圝ava铏氭嫙鏈猴級鏃剁敤鍛戒护琛屽紑鍏斥-cp鈥濈洿鎺ユ寚瀹氬畠锛岄氳繃璇ユ柟寮忓畨瑁呴┍鍔ㄣ
濡傛灉浣犳墦绠楃敤JDBC DriverManager鏉ヤ娇鐢ㄩ┍鍔紝鍙娇鐢ㄢ渃om.mysql.jdbc.Driver鈥濓紝灏嗗叾鐢ㄤ綔瀹炴柦浜嗏渏ava.sql.Driver鈥濈被銆
绀轰緥26.11. 璁剧疆Unix鐜涓嬬殑CLASSPATH
鍦║nix鐜涓嬶紝涓嬭堪鍛戒护鐢ㄤ簬鈥渃sh鈥濓細
$ setenv CLASSPATH /path/to/mysql-connector-java-[version]-bin.jar:$CLASSPATH
鍙互灏嗕笂杩板懡浠ゆ坊鍔犲埌鎭板綋鐨勩佺敤浜庣櫥褰晄hell鐨勫惎鍔ㄦ枃浠朵腑锛屼粠鑰屼娇寰楁墍鏈夌殑Java搴旂敤绋嬪簭鍧囪兘浣跨敤MySQL Connector/J銆
濡傛灉甯屾湜涓庤濡俆omcat鎴朖boss绛夊簲鐢ㄦ湇鍔″櫒涓璧蜂娇鐢∕ySQL Connector/J锛屽簲浠旂粏闃呰渚涘簲鍟嗘彁渚涚殑鏂囨。锛屼互浜嗚В濡備綍閰嶇疆绗笁鏂圭被搴撶殑鏇村淇℃伅锛岃繖鏄洜涓哄ぇ澶氭暟搴旂敤鏈嶅姟鍣ㄥ潎浼氬拷鐣LASSPATH鐜鍙橀噺銆傚湪鈥涓嶫2EE鍜屽叾浠朖ava妗嗘灦涓璧蜂娇鐢 Connector/J鈥濅竴鑺備腑锛岀粰鍑轰簡閽堝涓浜汮2EE搴旂敤鏈嶅姟鍣ㄧ殑閰嶇疆绀轰緥锛屼絾鏄紝瀵逛簬鐗瑰畾鐨勫簲鐢ㄦ湇鍔″櫒锛孞DBC杩炴帴姹犻厤缃俊鎭殑鏉冨▉淇℃伅婧愭槸璇ュ簲鐢ㄦ湇鍔″櫒鐨勬枃妗c
濡傛灉浣犲噯澶囧紑鍙戝皬鏈嶅姟绋嬪簭鍜岋紡鎴朖SP锛岃屼笖浣犵殑搴旂敤鏈嶅姟鍣ㄦ槸J2EE鍏煎鐨勶紝鍙互灏嗛┍鍔ㄧ殑.jar鏂囦欢鏀惧埌webapp鐨刉EB-INF/lib瀛愮洰褰曚笅锛屽湪J2EE Web搴旂敤绋嬪簭涓紝杩欐槸绗笁鏂圭被搴撶殑鏍囧噯浣嶇疆銆
濡傛灉浣犵殑J2EE搴旂敤鏈嶅姟鍣ㄦ敮鎸佹垨瑕佹眰锛屼篃鍙互浣跨敤com.mysql.jdbc.jdbc2.optional鍙夎蒋浠跺寘涓殑MysqlDataSource鎴朚ysqlConnectionPoolDataSource绫汇傚绉峂ysqlDataSource绫诲潎鏀寔涓嬭堪鍙傛暟锛堥氳繃鏍囧噯鐨勨淪et鈥濆瓨鍙栧櫒锛夛細
路 user
路 password
路 serverName锛堝弬瑙佸墠闈㈠叧浜庢晠闅滃垏鎹富鏈虹殑绔犺妭锛
路 databaseName
路 port
璁捐Connector/J 3.1鏃讹紝灏介噺浣垮畠鑳藉悜鍚庡吋瀹笴onnector/J 3.0銆傚ぇ鐨勫彉鍖栬鍗曠嫭浣滀负MySQL-4.1鍜屾洿鏂扮増涓殑鏂板姛鑳斤紝鍖呮嫭Unicode瀛楃闆嗐佹湇鍔″櫒绔澶勭悊璇彞銆佺敱鏈嶅姟鍣ㄨ繑鍥炵殑閿欒淇℃伅涓殑SQLState浠g爜銆佷互鍙婂悇绉嶆ц兘澧炲己鐗规э紙鍙氳繃閰嶇疆灞炴у惎鐢ㄦ垨绂佹锛夈
路 Unicode瀛楃闆嗭細鍏充簬MySQL鏂扮壒鎬х殑鏇村淇℃伅锛岃鍙傝涓嬩竴鑺傦紝浠ュ強鏈嶅姟鍣ㄦ墜鍐屼腑鐨勨滃瓧绗﹂泦鈥濅竴鑺傘傚鏋滄湁浜涗簨椤归厤缃笉褰擄紝閫氬父浼氭樉绀洪敊璇紝鍚屾椂缁欏嚭閿欒娑堟伅锛屽鈥滈潪娉曟牎瀵圭粍鍚堚濄
路 鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ワ細Connector/J 3.1灏嗚嚜鍔ㄦ娴嬫湇鍔″櫒绔澶勭悊璇彞锛屽苟鍦ㄥ彲鐢ㄦ椂鑷姩浣跨敤瀹冧滑锛圡ySQL鏈嶅姟鍣4.1.0鐗堟垨鏇存柊锛夈
浠3.1.7鐗堝紑濮嬶紝椹卞姩绋嬪簭鑳介氳繃鍚勭Connection.prepareStatement()鍙樹綋鎵弿SQL锛屼互鍒ゆ柇瀹冩槸鍚︽槸鑳藉鍦ㄦ湇鍔″櫒绔敮鎸佺殑璇彞绫诲瀷锛屽鏋滀笉琚湇鍔″櫒绔敮鎸侊紝浼氬皢鍏朵綔涓哄鎴风鐨勬ā鎷熼澶勭悊璇彞杩涜澶勭悊銆涔熷彲浠ラ氳繃鍦↗DBC URL涓紶閫掆emulateUnsupportedPstmts=false鈥濈姝㈣鐗规с
濡傛灉搴旂敤绋嬪簭閬囧埌涓庢湇鍔″櫒绔澶勭悊璇彞鏈夊叧鐨勯棶棰橈紝鍙皢鍏跺洖澶嶄负鏃х殑瀹㈡埛绔ā鎷熼澶勭悊璇彞浠g爜锛屽湪鏃╀簬4.1.0鐗堢殑MySQL鏈嶅姟鍣ㄤ腑浠嶄娇鐢ㄨ浠g爜锛岃繛鎺ュ睘鎬у涓嬶細
useServerPrepStmts=false
路 鍏锋湁鍏0缁勫垎鐨凞atetimes锛0000-00-00 ...锛夛細鍦↗ava涓紝鏃犳硶鍙潬鍦拌〃绀鸿繖浜涘笺備粠缁撴灉闆嗚鍙栧畠浠椂锛孋onnector/J 3.0.x鎬绘槸浼氬皢鍏惰浆鎹负NULL銆
榛樿鎯呭喌涓嬶紝閬囧埌杩欑被鍊兼椂锛孋onnector/J 3.1灏嗘姏鍑哄紓甯革紝杩欐槸鍥犱负锛屾牴鎹甁DBC鍜孲QL鏍囧噯锛岃繖鏄渶姝g‘鐨勮涓烘柟寮忋傚彲浠ヤ娇鐢ㄢzeroDateTimeBehavior鈥濋厤缃睘鎬ф敼鍙樿琛屼负銆傚厑璁哥殑鍊煎寘鎷細鈥渆xception鈥濓紝锛堥粯璁ゅ硷級锛岀敤浠g爜涓衡淪1009鈥濈殑SQLState鎶涘嚭SQLException锛涒渃onvertToNull鈥濓紝杩斿洖NULL鑰屼笉鏄暟鎹紱浠ュ強鈥渞ound鈥濓紝瀵规棩鏈熻繘琛岃垗鍏ュ鐞嗭紝浣夸箣鎴愪负鏈鎺ヨ繎鐨勫硷紝鍗斥0001-01-01鈥濄
浠嶤onnector/J 3.1.7寮濮嬶紝鑳藉浣跨敤鈥noDatetimeStringSync=true鈥濓紙榛樿鍊间负鈥滃亣鈥濓級锛屽皢ResultSet.getString()涓庤琛屼负鍒嗙寮锛屼粠鑰岃兘澶熶互瀛楃涓茬殑褰㈠紡鎻愬彇鏈鏀瑰彉鐨勫叏0鍊笺傝娉ㄦ剰锛岃繖涔熶細闃绘浣跨敤浠讳綍鏃跺尯杞崲鍔熻兘锛屽洜姝わ紝椹卞姩绋嬪簭灏嗙姝㈠悓鏃跺惎鐢noDatetimeStringSync鍜useTimezone銆
路 鏂癝QLState浠g爜锛欳onnector/J 3.1閲囩敤MySQL杩斿洖鐨凷QL:1999 SQLState浠g爜锛堝鏋滄敮鎸佺殑璇濓級锛屽畠涓嶅悓浜嶤onnector/J 3.0浣跨敤鐨勨滀紶缁熲漍/Open鐘舵佺爜銆傚鏋滆繛鎺ュ埌浜嗙増鏈綆浜嶮ySQL-4.1.0锛堣兘澶熷皢SQLStates浣滀负閿欒浠g爜缁勬垚閮ㄥ垎杩斿洖鐨勬渶鏃╃増鏈級鐨凪ySQL鏈嶅姟鍣紝椹卞姩绋嬪簭灏嗕娇鐢ㄥ唴缃殑鏄犲皠鍔熻兘銆備綘涔熷彲浠ヤ娇鐢ㄤ笅杩伴厤缃夐」锛岄噰鐢ㄦ棫鐨勬槧灏勩
useSqlStateCodes=false
路 鍦˙LOB鍒椾笂璋冪敤ResultSet.getString()灏嗚繑鍥炰唬琛ㄥ畠鐨勫瓧鑺俒]鏁扮粍鐨勫湴鍧锛岃屼笉鏄疊LOB鐨勫瓧绗︿覆褰㈠紡銆侭LOB娌℃湁瀛楃闆嗭紝鍥犳锛屽湪涓嶉犳垚鏁版嵁涓㈠け鎴栨崯鍧忕殑鎯呭喌涓嬶紝涓嶈兘灏嗗畠浠浆鎹负java.lang.Strings銆
瑕佹兂浠LOB鏂瑰紡灏嗗瓧绗︿覆淇濆瓨鍦∕ySQL涓紝鍙娇鐢ㄤ竴绉峊EXT绫诲瀷锛岄┍鍔ㄧ▼搴忎細灏嗗叾褰撲綔java.sql.Clob瀵瑰緟銆
路 浠嶤onnector/J 3.1.8寮濮嬶紝椹卞姩鐨勨滆皟璇曠増鈥濓紙鍦ㄥ悕涓衡mysql-connector-java-[version]-bin-g.jar鈥鐨勬枃浠朵腑涓庢甯哥殑鈥浜岃繘鍒鈥jar鏂囦欢鈥鍚嶄负mysql-connector-java-[version]-bin.jar鈥涓璧锋彁渚銆
浠嶤onnector/J 3.1.9寮濮嬶紝鎴戜滑涓嶅啀鍗曠嫭鎻愪緵.class鏂囦欢锛屼粎鍦ㄤ笌椹卞姩绋嬪簭涓璧锋彁渚涚殑JAR鏂囦欢涓彁渚涘畠浠
涓嶅簲浣跨敤椹卞姩绋嬪簭鐨勨滆皟璇曠増鈥濓紝闄ら潪鏄湪鍚慚ySQL AB閫氭姤闂鎴栫己闄锋椂闇瑕佺敤鍒板畠锛岃繖鏄洜涓衡滆皟璇曠増鈥濅笉鏄负鐢熶骇鐜涓嬬殑杩愯鑰岃璁$殑锛屽鏋滀娇鐢ㄥ畠锛屼細瀵规ц兘閫犳垚璐熼潰褰卞搷銆備簩杩涘埗浠g爜鐨勮皟璇曞彇鍐充簬Aspect/J杩愯鏃跺簱锛岃搴撲綅浜庝笌Connector/J鍒嗗彂鐗堜竴璧锋彁渚涚殑src/lib/aspectjrt.jar鏂囦欢涓
路 浣跨敤UTF-8瀛楃缂栫爜锛氬湪4.1鐗圡ySQL鏈嶅姟鍣ㄤ箣鍓嶏紝鏈嶅姟鍣ㄤ笉鏀寔UTF-8瀛楃缂栫爜锛屼絾JDBC椹卞姩鑳戒娇鐢ㄥ畠锛屼粠鑰屽厑璁稿湪鏈嶅姟鍣ㄤ笂鐨刲atin1涓繚瀛樺涓瓧绗﹂泦銆
浠嶮ySQL-4.1鐗堝紑濮嬶紝璇ュ姛鑳借鏀惧純銆傚鏋滀綘鏈変緷璧栬鍔熻兘鐨勫簲鐢ㄧ▼搴忥紝鑰屼笖鏃犳硶鍗囩骇瀹冧滑浠ヤ娇鐢∕ySQL鏈嶅姟鍣4.1鐗堟垨鏇撮珮鐗堟湰涓敮鎸佺殑姝f槸Unicode瀛楃闆嗭紝搴斿湪杩炴帴URL涓鍔犱笅杩板睘鎬э細
useOldUTF8Behavior=true
路 鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ワ細Connector/J 3.1灏嗚嚜鍔ㄦ娴嬫湇鍔″櫒绔澶勭悊璇彞锛屽苟鍦ㄥ彲鐢ㄦ椂鑷姩浣跨敤瀹冧滑锛圡ySQL鏈嶅姟鍣4.1.0鐗堟垨鏇存柊锛夈傚鏋滃簲鐢ㄧ▼搴忛亣鍒颁笌鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ユ湁鍏崇殑闂锛屽彲灏嗗叾鍥炲涓烘棫鐨勫鎴风妯℃嫙棰勫鐞嗚鍙ヤ唬鐮侊紝鍦ㄦ棭浜4.1.0鐗堢殑MySQL鏈嶅姟鍣ㄤ腑浠嶄娇鐢ㄨ浠g爜锛岃繛鎺ュ睘鎬у涓嬶細
useServerPrepStmts=false
鐢ㄤ簬MySQL Connector/J鐨凧DBC URL鏍煎紡濡備笅锛屾柟鎷彿鈥淸, ]鈥濈殑椤逛负鍙夐」锛
jdbc:mysql://[host][,failoverhost...][:port]/[database][?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...
濡傛灉鏈寚瀹氫富鏈哄悕锛岄粯璁や负鈥127.0.0.1鈥濄傚鏋滄湭鎸囧畾绔彛锛岄粯璁や负鈥3306鈥濓紝瀹冩槸MySQL鏈嶅姟鍣ㄧ殑榛樿绔彛鍙枫
jdbc:mysql://[host:port],[host:port].../[database][?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...
濡傛灉鏈寚瀹氭暟鎹簱锛屽皢浣跨敤鏃犫滃綋鍓嶁濇暟鎹簱杩涜杩炴帴銆傚湪杩欑鎯呭喌涓嬶紝闇瑕佸湪杩炴帴瀹炰緥涓婅皟鐢ㄢ渟etCatalog()鈥濇柟娉曪紝鎴栧湪SQL涓娇鐢ㄦ暟鎹簱鍚嶆寚瀹氬畬鏁寸殑琛ㄥ悕锛堝嵆鈥淪ELECT dbname.tablename.colname FROM dbname.tablename...鈥濓級銆備笉鎸囧畾杩炴帴鏃朵娇鐢ㄧ殑鏁版嵁搴擄紝璇ラ夐」閫氬父浠呭湪鍒涘缓鐢ㄤ簬澶勭悊澶氫釜鏁版嵁搴撶殑宸ュ叿鏃舵墠鏈夌敤锛屼緥濡侴UI鏁版嵁搴撶鐞嗗櫒銆
MySQL Connector/J鏀寔鏁呴殰鍒囨崲鍔熻兘銆傝繖鏍凤紝灏卞厑璁搁┍鍔ㄧ▼搴忓垏鎹㈣嚦鈥滀粠鈥濅富鏈轰笂锛屽苟浠嶈兘鎵ц鍙鏌ヨ銆備粎褰撹繛鎺ュ浜巃utoCommit(true)鐘舵佹椂锛屾墠浼氬嚭鐜版晠闅滃垏鎹紝杩欐槸鍥犱负褰撲簨鍔℃鍦ㄨ繘琛屾椂锛屾棤娉曞彲闈犲湴淇濊瘉鏁呴殰鍒囨崲銆傚湪浜嬪姟/杩炴帴缁撴潫鍚庯紝澶у鏁板簲鐢ㄦ湇鍔″櫒鍜岃繛鎺ユ睜鍧囦細灏哸utoCommit璁剧疆涓衡滅湡鈥濄
鏁呴殰鍒囨崲鍔熻兘鍏锋湁涓嬭堪琛屼负鏂瑰紡锛
濡傛灉URL灞炴р渁utoReconnect鈥濅负鈥滃亣鈥濓細鏁呴殰鍒囨崲浠呬細鍦ㄨ繛鎺ュ垵濮嬪寲杩囩▼涓嚭鐜帮紝褰撻┍鍔ㄧ▼搴忓垽鏂1鍙颁富鏈哄啀娆″彲鐢ㄦ椂锛屽皢杩斿洖銆
濡傛灉URL灞炴р渁utoReconnect鈥濅负鈥滅湡鈥濓細褰撻┍鍔ㄧ▼搴忓垽鏂繛鎺ュけ璐ユ椂锛堝湪浠绘剰鏌ヨ涔嬪墠锛夛紝灏嗗嚭鐜版晠闅滃垏鎹紝鑰屼笖褰撻┍鍔ㄧ▼搴忓垽鏂1鍙颁富鏈哄啀娆″彲鐢ㄦ椂锛堝彂鍑簈ueriesBeforeRetryMaster鏌ヨ涔嬪悗锛夛紝灏嗚繑鍥炵1鍙颁富鏈恒
鍦ㄤ换浣曚竴绉嶆儏鍐典笅锛屽綋浣犺繛鎺ュ埌缁忚繃鏁呴殰鍒囨崲鐨勬湇鍔″櫒鏃讹紝浼氬皢杩炴帴璁剧疆涓哄彧璇荤姸鎬侊紝鍥犳锛屽浜庝細鏇存敼鏁版嵁鐨勬煡璇㈡潵璇达紝灏嗘姏鍑哄紓甯革紙MySQL鏈嶅姟鍣ㄤ笉浼氬鐞嗚鏌ヨ锛夈
閰嶇疆灞炴у畾涔変簡Connector/J涓嶮ySQL鏈嶅姟鍣ㄨ繘琛岃繛鎺ョ殑鏂瑰紡銆傞櫎闈炰綔浜嗗叾浠栬鏄庯紝鍚﹀垯鍙互涓篋ataSource瀵硅薄鎴朇onnection瀵硅薄璁剧疆灞炴с
鍙噰鐢ㄤ笅杩版柟寮忕殑涓绉嶈缃瓹onfiguration锛堥厤缃級灞炴э細
路 鍦╦ava.sql.DataSource鐨凪ySQL瀹炴柦瀹炰緥涓婁娇鐢╯et*()鏂规硶锛堝畠鏄娇鐢╦ava.sql.DataSource瀹炴柦瀹炰緥鏃剁殑棣栭夋柟娉曪級锛
o com.mysql.jdbc.jdbc2.optional.MysqlDataSource
o com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
路 浣滀负浼犻掔粰DriverManager.getConnection()鎴朌river.connect()鐨刯ava.util.Properties瀹炰緥涓殑 閿/鍊煎銆
路 浣滀负URL涓殑JDBC URL鍙傛暟锛屼互浼犻掔粰java.sql.DriverManager.getConnection()銆乯ava.sql.Driver.connect()銆佹垨javax.sql.DataSource鐨剆etURL()鏂规硶鐨凪ySQL瀹炴柦瀹炰緥銆
濡傛灉浣犵敤鏉ラ厤缃甁DBC URL鐨勬柟娉曟槸鍩轰簬XML鐨勶紝闇瑕佷娇鐢╔ML瀛楃鈥&鈥濇潵闅斿紑閰嶇疆鍙傛暟锛屸&鈥濇槸XML鐨勪繚鐣欏瓧绗︺
鍦ㄤ笅闈㈢殑琛ㄥ悇涓紝鍒楀嚭浜嗚繖浜涘睘鎬э細
琛26.1. 杩炴帴灞炴
灞炴у悕 |
瀹氫箟 |
瑕佹眰锛 |
榛樿鍊 |
鐗堟湰 |
Connection/Authentication锛堣繛鎺ワ紡閴村畾锛 |
||||
user |
杩炴帴鐨勭敤鎴 |
No |
|
鍏ㄩ儴 |
password |
杩炴帴鏃朵娇鐢ㄧ殑瀵嗙爜銆 |
No |
|
鍏ㄩ儴 |
socketFactory |
椹卞姩绋嬪簭鐢ㄤ簬鍒涘缓涓庢湇鍔″櫒濂楁帴瀛楄繛鎺ョ殑绫荤殑鍚嶇О銆傝绫诲繀椤诲疄鐜颁簡鎺ュ彛鈥渃om.mysql.jdbc.SocketFactory鈥濓紝骞舵湁鍏叡鏃犲弬閲忔瀯閫犲嚱鏁般 |
No |
com.mysql.jdbc.StandardSocketFactory |
3.0.3 |
connectTimeout |
濂楁帴瀛楄繛鎺ョ殑瓒呮椂锛堝崟浣嶄负姣锛夛紝0琛ㄧず鏃犺秴鏃躲備粎瀵笿DK-1.4鎴栨洿鏂扮増鏈湁鏁堛傞粯璁ゅ间负鈥0鈥濄 |
No |
0 |
3.0.1 |
socketTimeout |
缃戠粶濂楁帴瀛楄繛鎺ョ殑瓒呮椂锛堥粯璁ゅ0琛ㄧず鏃犺秴鏃讹級銆 |
No |
0 |
3.0.1 |
useConfigs |
鍦ㄨВ鏋怳RL灞炴ф垨搴旂敤鐢ㄦ埛鎸囧畾鐨勫睘鎬т箣鍓嶏紝鍔犺浇鐢遍楀彿鈥,鈥濆垎闅旂殑閰嶇疆灞炴у垪琛ㄣ傚湪鏂囨。鐨勨滈厤缃濋儴鍒嗕腑瑙i噴浜嗚繖浜涢厤缃 |
No |
|
3.1.5 |
interactiveClient |
璁剧疆CLIENT_INTERACTIVE鏍囧織锛屾牴鎹甀NTERACTIVE_TIMEOUT鑰屼笉鏄疻AIT_TIMEOUT鍚慚ySQL閫氭姤瓒呮椂杩炴帴銆 |
No |
false |
3.1.0 |
propertiesTransform |
com.mysql.jdbc.ConnectionPropertiesTransform鐨1涓疄鏂藉疄渚嬶紝鍦ㄥ皾璇曡繛鎺ヤ箣鍓嶏紝椹卞姩绋嬪簭灏嗕娇鐢ㄥ畠鏉ユ洿鏀逛紶閫掔粰椹卞姩鐨刄RL灞炴с |
No |
|
3.1.4 |
useCompression |
涓庢湇鍔″櫒杩涜閫氫俊鏃堕噰鐢▃lib鍘嬬缉锛堢湡锛忓亣锛夛紵 榛樿鍊间负鈥滃亣鈥濄 |
No |
false |
3.0.17 |
High Availability and Clustering锛堥珮鍙敤鎬у拰绨囬泦锛 |
||||
autoReconnect |
椹卞姩绋嬪簭鏄惁搴斿皾璇曞啀娆″缓绔嬪け鏁堢殑鍜岋紡鎴栨杩炴帴锛 濡傛灉鍏佽锛屽浜庡湪澶辨晥鎴栨杩炴帴涓婂彂鍑虹殑鏌ヨ锛堝睘浜庡綋鍓嶄簨鍔★級锛岄┍鍔ㄧ▼搴忓皢鎶涘嚭寮傚父锛屼絾鍦ㄦ柊浜嬪姟鐨勮繛鎺ヤ笂鍙戝嚭涓嬩竴涓煡璇㈡椂锛屽皢灏濊瘯鍐嶈繛鎺ャ備笉鎺ㄨ崘浣跨敤璇ョ壒鎬э紝杩欐槸鍥犱负锛屽綋搴旂敤绋嬪簭涓嶈兘鎭板綋澶勭悊SQLExceptions鏃讹紝瀹冧細閫犳垚涓庝細璇濈姸鎬佸拰鏁版嵁涓鑷存ф湁鍏崇殑鍓綔鐢紝璁捐瀹冪殑鐩殑浠呯敤浜庝笅杩版儏鍐碉紝鍗筹紝褰撲綘鏃犳硶閰嶇疆搴旂敤绋嬪簭鏉ユ伆褰撳鐞嗗洜姝昏繛鎺ュ拰锛忔垨鏃犳晥杩炴帴瀵艰嚧鐨凷QLExceptions鏃躲備綔涓哄彲閫夋柟寮忥紝鍙皢MySQL鏈嶅姟鍣ㄥ彉閲忊渨ait_timeout鈥濊缃负杈冮珮鐨勫硷紝鑰屼笉鏄粯璁ょ殑8灏忔椂銆 |
No |
false |
1.1 |
autoReconnectForPools |
浣跨敤閫傚悎浜庤繛鎺ユ睜鐨勫啀杩炴帴绛栫暐锛堥粯璁ゅ间负鈥滃亣鈥濓級銆 |
No |
false |
3.1.3 |
failOverReadOnly |
鍦╝utoReconnect妯″紡涓嬪嚭鐜版晠闅滃垏鎹㈡椂锛屾槸鍚﹀簲灏嗚繛鎺ヨ缃负鈥滃彧璇烩濓紵 |
No |
true |
3.0.12 |
reconnectAtTxEnd |
濡傛灉灏哸utoReconnect璁剧疆涓衡滅湡鈥濓紝鍦ㄦ瘡娆′簨鍔$粨鏉熷悗椹卞姩绋嬪簭鏄惁搴斿皾璇曞啀杩炴帴锛 |
No |
false |
3.0.10 |
roundRobinLoadBalance |
鍚敤浜哸utoReconnect鑰屼笖failoverReadonly涓衡滃亣鈥濇椂锛屾槸鍚﹀簲鎸夌収寰幆鏂瑰紡鎸戦夎杩炴帴鐨勪富鏈猴紵 |
No |
false |
3.1.2 |
queriesBeforeRetryMaster |
鍑虹幇鏁呴殰鍒囨崲锛堜娇鐢ㄥ涓绘満鏁呴殰鍒囨崲锛夊苟杩斿洖涓绘満涔嬪墠鍙戝嚭鐨勬煡璇㈡暟銆傛棤璁洪鍏堟弧瓒充簡鍝釜鏉′欢锛屸渜ueriesBeforeRetryMaster鈥濇垨鈥渟econdsBeforeRetryMaster鈥濓紝鍧囦細鍐嶆涓庝富鏈鸿繘琛岃繛鎺ャ傞粯璁ゅ间负鈥50鈥濄 |
No |
50 |
3.0.2 |
secondsBeforeRetryMaster |
鍑虹幇鏁呴殰鍒囨崲鍚庯紝鍦ㄥ皾璇曞啀娆¤繛鎺ュ埌涓绘湇鍔″櫒涔嬪墠锛岄┍鍔ㄧ▼搴忓簲绛夊緟鐨勬椂闂达紵 鏃犺棣栧厛婊¤冻浜嗗摢涓潯浠讹紝鈥渜ueriesBeforeRetryMaster鈥濇垨鈥渟econdsBeforeRetryMaster鈥濓紝鍧囦細鍐嶆涓庝富鏈鸿繘琛岃繛鎺ャ傚崟浣嶄负绉掞紝榛樿鍊间负30銆 |
No |
30 |
3.0.2 |
enableDeprecatedAutoreconnect |
鑷3.2鐗堝紑濮嬶紝鑷姩鍐嶈繛鎺ュ姛鑳藉彈鍒板喎钀斤紝鍦3.3鐗堜腑灏嗗垹闄よ鍔熻兘銆傚皢璇ュ睘鎬ц缃负鈥滅湡鈥濆彲绂佹妫鏌ラ厤缃殑鐗规с |
No |
false |
3.2.1 |
Security锛堝畨鍏級 |
||||
allowMultiQueries |
鍦ㄤ竴鏉¤鍙ヤ腑锛屽厑璁镐娇鐢ㄢ;鈥濇潵鍒嗛殧澶氭潯鏌ヨ锛堢湡锛忓亣锛岄粯璁ゅ间负鈥滃亣鈥濓級銆 |
No |
false |
3.1.1 |
useSSL |
涓庢湇鍔″櫒杩涜閫氫俊鏃朵娇鐢⊿SL锛堢湡锛忓亣锛夛紝榛樿鍊间负鈥滃亣鈥濄 |
No |
false |
3.0.2 |
requireSSL |
瑕佹眰SSL杩炴帴锛寀seSSL=true锛 榛樿鍊间负鈥滃亣鈥濄 |
No |
false |
3.1.0 |
allowUrlInLocalInfile |
椹卞姩绋嬪簭鍦ㄦ槸鈥淟OAD DATA LOCAL INFILE鈥濊鍙ヤ腑鍚﹀厑璁窾RL锛 |
No |
false |
3.1.4 |
paranoid |
閲囧彇鎺柦锛岄槻姝㈠湪閿欒淇℃伅涓硠婕忔晱鎰熶俊鎭紝骞跺彲鍙兘鏃舵竻闄や繚瀛樻晱鎰熸暟鎹殑鏁版嵁缁撴瀯锛 榛樿鍊间负鈥滃亣鈥濄 |
No |
false |
3.0.1 |
Performance Extensions锛堟ц兘鎵╁睍锛 |
||||
metadataCacheSize |
濡傛灉灏哻acheResultSetMetaData璁剧疆涓衡滅湡鈥濓紝瀵筩acheResultSetMetadata鐨勬煡璇㈡鏁帮紙榛樿鍊间负50锛夈 |
No |
50 |
3.1.1 |
prepStmtCacheSize |
濡傛灉鍏佽棰勫鐞嗚鍙ョ紦鍐插姛鑳斤紝搴旂紦鍐插鐞嗗灏戞潯棰勫鐞嗚鍙ワ紵 |
No |
25 |
3.0.10 |
prepStmtCacheSqlLimit |
濡傛灉鍏佽棰勫鐞嗚鍙ョ紦鍐插姛鑳斤紝椹卞姩绋嬪簭灏嗘墽琛岃В鏋愮紦鍐插鐞嗙殑鏈澶QL鏄粈涔堬紵 |
No |
256 |
3.0.10 |
maintainTimeStats |
椹卞姩绋嬪簭鏄惁搴旂淮鎸佸悇绉嶅唴閮ㄥ畾鏃跺櫒锛屼互鍏佽绌洪棽鏃堕棿璁$畻锛屼互鍙婁笌鏈嶅姟鍣ㄧ殑杩炴帴澶辫触鏃跺厑璁告彁渚涙洿璇︾粏鐨勯敊璇秷鎭紵 灏嗚灞炴ц缃负鈥滃亣鈥濓紝瀵逛簬姣忔鏌ヨ锛岃嚦灏戣兘鍑忓皯涓ゆ瀵筍ystem.getCurrentTimeMillis()鐨勮皟鐢ㄣ |
No |
true |
3.1.9 |
blobSendChunkSize |
缁勫潡锛屽綋閫氳繃ServerPreparedStatements鍙戦丅LOB/CLOB鏃朵娇鐢ㄣ |
No |
1048576 |
3.1.9 |
cacheCallableStmts |
椹卞姩绋嬪簭鏄惁搴斿CallableStatements鐨勮В鏋愯繃绋嬫墽琛岀紦鍐插鐞嗐 |
No |
false |
3.1.2 |
cachePrepStmts |
椹卞姩绋嬪簭鏄惁搴斿瀹㈡埛绔澶勭悊璇彞鐨凱reparedStatements鐨勮В鏋愯繃绋嬫墽琛岀紦鍐插鐞嗭紝鏄惁搴旀鏌ユ湇鍔″櫒绔澶勭悊璇彞鐨勯傜敤鎬т互鍙婃湇鍔″櫒绔澶勭悊璇彞鏈韩锛 |
No |
false |
3.0.10 |
cacheResultSetMetadata |
椹卞姩绋嬪簭鏄惁搴斿鐢ㄤ簬Statements鍜孭reparedStatements鐨凴esultSetMetaData鎵ц缂撳啿澶勭悊锛 瑕佹眰 JDK-1.4+锛岀湡锛忓亣锛岄粯璁や负鈥滃亣鈥濄 |
No |
false |
3.1.1 |
cacheServerConfiguration |
椹卞姩绋嬪簭鏄惁搴旀牴鎹瘡鏉RL瀵光淗OW VARIABLES鈥濆拰鈥淪HOW COLLATION鈥濈殑缁撴灉鎵ц缂撳啿澶勭悊锛 |
No |
false |
3.1.5 |
dontTrackOpenResources |
JDBC瑙勮寖瑕佹眰椹卞姩绋嬪簭鑷姩璺熻釜鍜屽叧闂祫婧愶紝浣嗘槸锛屽鏋滀綘鐨勫簲鐢ㄧ▼搴忎笉鑳芥槑纭皟鐢ㄤ綔鐢ㄥ湪璇彞鎴栫粨鏋滈泦涓婄殑close()锛屽彲鑳戒細瀵艰嚧鍐呭瓨娉勬紡銆傚皢璇ュ睘鎬ц缃负鈥滅湡鈥濓紝鍙斁瀹借闄愬埗锛屽浜庢煇浜涘簲鐢ㄧ▼搴忥紝浼氭彁渚涙洿楂樼殑鍐呭瓨鏁堢巼銆 |
No |
false |
3.1.7 |
dynamicCalendars |
闇瑕佹椂锛岄┍鍔ㄧ▼搴忔槸鍚﹀簲妫绱㈤粯璁ゆ棩鍘嗭紝鎴栨牴鎹繛鎺ワ紡浼氳瘽瀵瑰叾杩涜缂撳啿澶勭悊锛 |
No |
false |
3.1.5 |
elideSetAutoCommits |
濡傛灉浣跨敤MySQL-4.1鎴栨洿楂樼増鏈紝褰撴湇鍔″櫒鐨勭姸鎬佷笌Connection.setAutoCommit(boolean)璇锋眰鐨勭姸鎬佷笉鍖归厤鏃讹紝椹卞姩绋嬪簭鏄惁浠呭簲鍙戝嚭鈥渟et autocommit=n鈥濇煡璇紵 |
No |
false |
3.1.3 |
holdResultsOpenOverStatementClose |
椹卞姩绋嬪簭鏄惁搴旀寜鐓DBC瑙勮寖鐨勮姹傚叧闂璖tatement.close()涓婄殑缁撴灉闆嗭紵 |
No |
false |
3.1.7 |
locatorFetchBufferSize |
濡傛灉灏嗏渆mulateLocators鈥濋厤缃负鈥滅湡鈥濓紝褰撹幏鍙栧叧浜巊etBinaryInputStream鐨凚LOB鏁版嵁鏃讹紝缂撳啿鍖虹殑澶у皬搴旀槸澶氬皯锛 |
No |
1048576 |
3.2.1 |
useFastIntParsing |
鏄惁浣跨敤鍐呴儴鈥淪tring->Integer鈥濊浆鎹㈠瓙绋嬪簭鏉ラ伩鍏嶅垱寤鸿繃澶氬璞★紵 |
No |
true |
3.1.4 |
useLocalSessionState |
椹卞姩绋嬪簭鏄惁搴斿紩鐢╝utocommit鐨勫唴閮ㄥ硷紝浠ュ強鐢盋onnection.setAutoCommit()鍜孋onnection.setTransactionIsolation()璁剧疆鐨勪簨鍔¢殧绂伙紝鑰屼笉鏄煡璇㈡暟鎹簱锛 |
No |
false |
3.1.7 |
useNewIO |
椹卞姩绋嬪簭鏄惁搴斿皢java.nio.* interfaces鐢ㄤ簬缃戠粶閫氫俊锛堢湡锛忓亣锛夛紝榛樿涓衡滃亣鈥濄 |
No |
false |
3.1.0 |
useReadAheadInput |
浠庢湇鍔″櫒璇诲彇鏁版嵁鏃讹紝鏄惁浣跨敤杈冩柊鐨勩佷紭鍖栫殑闈炴垚缁勭紦鍐茶緭鍏ユ祦锛 |
No |
true |
3.1.5 |
Debuging/Profiling锛堣皟璇/浠垮舰锛 |
||||
logger |
瀹炵幇浜哻om.mysql.jdbc.log.Log鐨勭被鐨勫悕绉帮紝com.mysql.jdbc.log.Log鐢ㄤ簬璁板綍娑堟伅锛堥粯璁や负鈥渃om.mysql.jdbc.log.StandardLogger鈥濓紝瀹冧細灏嗘棩蹇楄褰曞埌STDERR锛夈 |
No |
com.mysql.jdbc.log.StandardLogger |
3.1.1 |
profileSQL |
璺熻釜鏌ヨ浠ュ強瀹冧滑瀵瑰凡閰嶅埗璁板綍鍣ㄧ殑鎵ц/鑾峰彇娆℃暟锛堢湡锛忓亣锛夛紝榛樿涓衡滃亣鈥濄 |
No |
false |
3.1.0 |
reportMetricsIntervalMillis |
濡傛灉鍏佽鈥済atherPerfMetrics鈥濓紝璁板綍瀹冧滑鐨勯鐜囨槸澶氬皯锛堝崟浣嶆绉掞級锛 |
No |
30000 |
3.1.2 |
maxQuerySizeToLog |
璋冭瘯鎴栦豢褰㈡椂锛屾帶鍒跺皢璁板綍鐨勬煡璇㈢殑鏈澶ч暱搴︼紡澶у皬銆 |
No |
2048 |
3.1.3 |
packetDebugBufferSize |
褰撯渆nablePacketDebug鈥濅负鈥滅湡鈥濇椂锛岄渶瑕佷繚鐣欑殑鏈澶т俊鎭寘鏁扮洰銆 |
No |
20 |
3.1.3 |
slowQueryThresholdMillis |
濡傛灉鍏佽鈥渓ogSlowQueries鈥濓紝鍦ㄥ皢鏌ヨ璁板綍涓衡滄參鈥濅箣鍓嶇殑鏌ヨ鏃堕棿鏄灏戯紙姣锛夛紵 |
No |
2000 |
3.1.2 |
useUsageAdvisor |
椹卞姩绋嬪簭鏄惁搴斿彂鍑衡滀娇鐢ㄦ儏鍐碘濊鍛婏紝灏盌BC鍜孧ySQL Connector/J鐨勬伆褰撳拰楂樻晥浣跨敤缁欏嚭寤鸿锛堢湡锛忓亣锛岄粯璁や负鈥滃亣鈥濓級锛 |
No |
false |
3.1.1 |
autoGenerateTestcaseScript |
椹卞姩绋嬪簭鏄惁搴斿皢姝e湪鎵ц鐨凷QL锛堝寘鎷湇鍔″櫒绔澶勭悊璇彞锛夎浆鍌ㄥ埌STDERR锛 |
No |
false |
3.1.9 |
dumpQueriesOnException |
椹卞姩绋嬪簭鏄惁搴斿皢鍙戦佽嚦鏈嶅姟鍣ㄧ殑鏌ヨ鍐呭杞偍鍒癝QLExceptions涓紵 |
No |
false |
3.1.3 |
enablePacketDebug |
鍏佽鏃讹紝灏嗕繚鐣欌減acketDebugBufferSize鈥濅俊鎭寘鐨勭幆褰㈢紦鍐插尯锛屽苟褰撳湪椹卞姩绋嬪簭浠g爜鐨勫叧閿尯鍩熸姏鍑哄紓甯告椂杩涜杞偍銆 |
No |
false |
3.1.3 |
explainSlowQueries |
濡傛灉鍏佽浜嗏渓ogSlowQueries鈥濓紝椹卞姩绋嬪簭鏄惁搴斿湪鏈嶅姟鍣ㄤ笂鑷姩鍙戝嚭鈥淓XPLAIN鈥濓紝骞朵互WARN绾у埆灏嗙粨鏋滃彂閫佺粰閰嶇疆濂界殑鏃ュ織锛 |
No |
false |
3.1.2 |
logSlowQueries |
鏄惁瑕佽褰曟椂闂撮暱浜庘渟lowQueryThresholdMillis鈥濈殑鏌ヨ锛 |
No |
false |
3.1.2 |
traceProtocol |
鏄惁搴旇褰曡窡韪骇缃戠粶鍗忚锛 |
No |
false |
3.1.2 |
Miscellaneous锛堝叾浠栵級 |
||||
useUnicode |
澶勭悊瀛楃涓叉椂锛岄┍鍔ㄧ▼搴忔槸鍚﹀簲浣跨敤Unicode瀛楃缂栫爜锛 浠呭簲鍦ㄩ┍鍔ㄧ▼搴忔棤娉曠‘瀹氬瓧绗﹂泦鏄犲皠锛屾垨浣犳鍦ㄥ己鍒堕┍鍔ㄧ▼搴忎娇鐢∕ySQL涓嶆槸鍥烘湁鏀寔鐨勫瓧绗﹂泦鏃讹紙濡俇TF-8锛夋墠搴斾娇鐢ㄣ傜湡锛忓亣锛岄粯璁や负鈥滅湡鈥濄 |
No |
false |
1.1g |
characterEncoding |
濡傛灉鈥渦seUnicode鈥濊璁剧疆涓衡滅湡鈥濓紝澶勭悊瀛楃涓叉椂锛岄┍鍔ㄧ▼搴忓簲浣跨敤浠涔堝瓧绗︾紪鐮侊紵 榛樿涓衡渁utodetect鈥濄 |
No |
|
1.1g |
characterSetResults |
瀛楃闆嗭紝鐢ㄤ簬閫氱煡鏈嶅姟鍣ㄤ互浣曠瀛楃闆嗚繑鍥炵粨鏋溿 |
No |
|
3.0.13 |
connectionCollation |
濡傛灉璁剧疆浜嗗畠锛屽皢閫氱煡鏈嶅姟鍣ㄩ氳繃鈥渟et collation_connection鈥濅娇鐢ㄨ鏍″銆 |
No |
|
3.0.13 |
sessionVariables |
浠ラ楀彿闅斿紑鐨勨滃悕绉帮紡鍊尖濆鍒楄〃锛屽綋椹卞姩绋嬪簭寤虹珛浜嗚繛鎺ュ悗锛屼互鈥淪ET SESSION ...鈥濈殑鏂瑰紡灏嗗叾鍙戦佺粰鏈嶅姟鍣ㄣ |
No |
|
3.1.8 |
allowNanAndInf |
椹卞姩绋嬪簭鏄惁搴斿湪PreparedStatement.setDouble()涓厑璁窷aN鎴+/- INF鍊硷紵 |
No |
false |
3.1.5 |
autoDeserialize |
椹卞姩绋嬪簭鏄惁搴旇嚜鍔ㄦ娴嬪苟涓插苟杞崲淇濆瓨鍦˙LOB瀛楁涓殑瀵硅薄锛 |
No |
false |
3.1.5 |
capitalizeTypeNames |
鏄惁灏咲atabaseMetaData涓殑绫诲瀷鍚嶈浆鎹负澶у啓锛 閫氬父浠呭湪浣跨敤WebObjects鏃舵湁鐢紝鐪燂紡鍋囥傞粯璁や负鈥滃亣鈥濄 |
No |
false |
2.0.7 |
clobberStreamingResults |
杩欎細浣库滄祦寮忊濈粨鏋滈泦琚嚜鍔ㄥ叧闂紝濡傛灉鍦ㄦ墍鏈夋暟鎹皻鏈粠鏈嶅姟鍣ㄤ腑璇诲彇瀹屼箣鍓嶏紝鎵ц浜嗗彟涓鏌ヨ锛屾鍦ㄤ粠鏈嶅姟鍣ㄦ祦鍑虹殑浠讳綍鏈畬鎴愭暟鎹潎灏嗕涪澶便 |
No |
false |
3.0.9 |
continueBatchOnError |
濡傛灉涓鏉¤鍙ュけ璐ワ紝椹卞姩绋嬪簭鏄惁搴旂户缁鐞嗘壒鍛戒护锛 JDBC瑙勮寖鍏佽浠讳綍涓绉嶆柟寮忥紙榛樿涓衡滅湡鈥濓級銆 |
No |
true |
3.0.3 |
createDatabaseIfNotExist |
濡傛灉涓嶅瓨鍦紝鍒涘缓URL涓粰瀹氱殑鏁版嵁搴撱傚亣瀹氱敤鎴峰叿鏈夊垱寤烘暟鎹簱鐨勬潈闄愩 |
No |
false |
3.1.9 |
emptyStringsConvertToZero |
椹卞姩绋嬪簭鏄惁搴斿厑璁镐粠绌哄瓧绗︿覆瀛楁鍒版暟鍊尖0鈥濈殑杞崲锛 |
No |
true |
3.1.8 |
emulateLocators |
N/A |
No |
false |
3.1.0 |
emulateUnsupportedPstmts |
椹卞姩绋嬪簭鏄惁搴旀娴嬩笉琚湇鍔″櫒鏀寔鐨勯澶勭悊璇彞锛屽苟鐢ㄥ鎴风妯℃嫙鐗堟浛鎹㈠畠浠紵 |
No |
true |
3.1.7 |
ignoreNonTxTables |
鏄惁蹇界暐鍏充簬鍥為鐨勯潪浜嬪姟琛紵 榛樿鍊间负鈥滃亣鈥濄 |
No |
false |
3.0.9 |
jdbcCompliantTruncation |
杩炴帴鍒版敮鎸佸憡璀︾殑鏈嶅姟鍣ㄦ椂锛圡ySQL 4.1.0鍜屾洿楂樼増鏈級锛屽綋鎸夌収JDBC鐨勮姹傛埅鐭暟鎹椂锛岄┍鍔ㄧ▼搴忔槸鍚﹀簲鎶涘嚭java.sql.DataTruncation寮傚父锛 |
No |
true |
3.1.2 |
maxRows |
杩斿洖鐨勬渶澶ц鏁帮紙0锛岄粯璁ゅ艰〃绀鸿繑鍥炴墍鏈夎锛夈 |
No |
-1 |
all versions |
noDatetimeStringSync |
涓嶄繚璇丷esultSet.getDatetimeType().toString().equals(ResultSet.getString()銆 |
No |
false |
3.1.7 |
nullCatalogMeansCurrent |
褰揇atabaseMetadataMethods璇锋眰鈥滅洰褰曗濆弬鏁版椂锛屽尖淣ull鈥濇槸鍚︽剰鍛崇潃浣跨敤褰撳墠鐩綍锛 瀹冧笉鍏煎JDBC锛屼絾绗﹀悎椹卞姩绋嬪簭鏃╂湡鐗堟湰鐨勪紶缁熻涓恒 |
No |
true |
3.1.8 |
nullNamePatternMatchesAll |
鎺ュ彈*pattern鍙傛暟鐨凞atabaseMetaData鏂规硶鏄惁搴斿皢null鎸夊寰呪滐紖鈥濈殑鐩稿悓鏂瑰紡澶勭悊锛堜笉鍏煎JDBC锛屼絾椹卞姩绋嬪簭鐨勬棭鏈熺増鏈兘鎺ュ彈涓庤鑼冪殑杩欑被鍋忕锛夈 |
No |
true |
3.1.8 |
pedantic |
涓ユ牸閬靛畧JDBC瑙勮寖銆 |
No |
false |
3.0.0 |
relaxAutoCommit |
濡傛灉椹卞姩绋嬪簭鎵杩炴帴鐨凪ySQL鏈嶅姟鍣ㄧ殑鐗堟湰涓嶆敮鎸佷簨鍔★紝浠嶅厑璁歌皟鐢╟ommit()銆乺ollback()鍜宻etAutoCommit()锛熺湡锛忓亣锛岄粯璁や负鈥滃亣鈥濄 |
No |
false |
2.0.13 |
retainStatementAfterResultSetClose |
璋冪敤ResultSet.close()鍚庯紝椹卞姩绋嬪簭鏄惁搴斿皢璇彞寮曠敤淇濆瓨鍦ㄧ粨鏋滈泦涓紵 鍦↗DBC-4.0鍚庯紝涓嶫DBC涓嶅吋瀹广 |
No |
false |
3.1.11 |
rollbackOnPooledClose |
褰撹繛鎺ユ睜涓殑閫昏緫杩炴帴鍏抽棴鏃讹紝椹卞姩绋嬪簭鏄惁搴斿彂鍑簉ollback()锛 |
No |
true |
3.0.15 |
runningCTS13 |
鍏佽鍦⊿un涓嶫DBC鍏煎鐨則estsuite 1.3鐗堜腑澶勭悊缂洪櫡銆 |
No |
false |
3.1.7 |
serverTimezone |
瑕嗙洊鏃跺尯鐨勬娴/鏄犲皠銆傚綋鏈嶅姟鍣ㄧ殑鏃跺尯涓烘槧灏勫埌Java鏃跺尯鏃朵娇鐢ㄣ |
No |
|
3.0.2 |
strictFloatingPoint |
浠呭湪鍏煎鎬ф祴璇曠殑鏃╂湡鐗堟湰涓娇鐢ㄣ |
No |
false |
3.0.0 |
strictUpdates |
椹卞姩绋嬪簭鏄惁搴斿鍙洿鏂扮粨鏋滈泦杩涜涓ユ牸妫鏌ワ紙閫夋嫨鎵鏈夌殑涓婚敭锛夛紵鐪燂紡鍋囷紝榛樿涓衡滅湡鈥濄 |
No |
true |
3.0.4 |
tinyInt1isBit |
椹卞姩绋嬪簭鏄惁搴斿皢鏁版嵁绫诲瀷TINYINT(1)褰撲綔BIT绫诲瀷瀵瑰緟锛熷垱寤鸿〃鏃讹紝鏈嶅姟鍣ㄤ細鎵цBIT -> TINYINT(1)鎿嶄綔銆 |
No |
true |
3.0.16 |
transformedBitIsBoolean |
濡傛灉椹卞姩绋嬪簭灏員INYINT(1)杞崲涓轰笉鍚岀殑绫诲瀷锛屼负浜嗕笌MySQL-5.0鍏煎锛岄┍鍔ㄧ▼搴忔槸鍚﹀簲浣跨敤BOOLEAN鍙栦唬BIT锛熻繖鏄洜涓篗ySQL-5.0鍏锋湁BIT绫诲瀷銆 |
No |
false |
3.1.9 |
ultraDevHack |
鐢变簬UltraDev宸叉崯鍧忥紝骞朵负鎵鏈夎鍙ュ彂鍑轰簡prepareCall()锛岄渶瑕佹椂锛屾槸鍚﹁涓簆repareCall()鍒涘缓PreparedStatements? 鐪燂紡鍋囷紝榛樿鍊间负鈥滃亣鈥濄 |
No |
false |
2.0.3 |
useHostsInPrivileges |
鍦―atabaseMetaData.getColumn/TablePrivileges()涓负鐢ㄦ埛娣诲姞鈥淍hostname鈥濄傜湡锛忓亣锛岄粯璁や负鈥滅湡鈥濄 |
No |
true |
3.0.2 |
useOldUTF8Behavior |
涓4.0鍜屾洿鏃╃増鏈殑鏈嶅姟鍣ㄨ繘琛岄氫俊鏃讹紝浣跨敤UTF-8銆 |
No |
false |
3.1.6 |
useOnlyServerErrorMessages |
瀵规湇鍔″櫒杩斿洖鐨勯敊璇秷鎭紝涓嶄簨鍏堣瀹氣滄爣鍑嗙殑鈥漇QLState閿欒娑堟伅銆 |
No |
true |
3.0.15 |
useServerPrepStmts |
濡傛灉鏈嶅姟鍣ㄦ敮鎸侊紝鏄惁浣跨敤鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ワ紵 榛樿鍊间负鈥滅湡鈥濄 |
No |
true |
3.1.0 |
useSqlStateCodes |
浣跨敤SQL鏍囧噯鐘舵佺爜鍙栦唬鈥滀紶缁熺殑鈥漍/Open/SQL鐘舵佺爜锛岀湡锛忓亣锛岄粯璁や负鈥滅湡鈥濄 |
No |
true |
3.1.3 |
useStreamLengthsInPrepStmts |
鏄惁閲囩敤PreparedStatement/ResultSet.setXXXStream()鏂规硶璋冪敤涓殑娴侀暱搴﹀弬鏁帮紵鐪燂紡鍋囷紝榛樿涓衡滅湡鈥濄 |
No |
true |
3.0.2 |
useTimezone |
鏄惁鍦ㄥ鎴风鍜屾湇鍔″櫒鏃跺尯闂磋浆鎹㈡椂闂达紡鏃ユ湡绫诲瀷锛堢湡锛忓亣锛岄粯璁や负鈥滃亣鈥濓級锛 |
No |
false |
3.0.2 |
useUnbufferedInput |
涓嶄娇鐢˙ufferedInputStream鏉ヤ粠鏈嶅姟鍣ㄨ鍙栨暟鎹 |
No |
true |
3.0.11 |
yearIsDateType |
JDBC椹卞姩绋嬪簭鏄惁搴斿皢MySQL绫诲瀷鈥淵EAR鈥濆綋浣渏ava.sql.Date鎴朣HORT瀵瑰緟锛 |
No |
true |
3.1.9 |
zeroDateTimeBehavior |
褰撻┍鍔ㄧ▼搴忛亣鍒板叏鐢0缁勬垚鐨凞ATETIME鍊兼椂锛屽簲鍑虹幇浠涔堬紵MySQL浣跨敤瀹冩潵琛ㄧず鏃犳晥鏃ユ湡銆傛湁鏁堝兼槸鈥渆xception鈥濄佲渞ound鈥濆拰鈥渃onvertToNull鈥濄 |
No |
exception |
3.1.4 |
閫氳繃鈥渟ocketFactory鈥濆睘鎬э紝浣跨敤NamedPipeSocketFactory锛屽湪Windows NT/2000/XP骞冲彴涓婏紝閫氳繃鍛藉悕绠¢亾锛孋onnector/J涔熸敮鎸佸MySQL鐨勮闂傚鏋滀笉浣跨敤namedPipePath灞炴э紝灏嗕娇鐢\\.\pipe\MySQL鐨勯粯璁ゅ笺傚鏋滀娇鐢∟amedPipeSocketFactory锛屽皢蹇界暐JDBC url涓殑涓绘満鍚嶅拰绔彛鍙枫
鍦║RL涓坊鍔犱笅杩板睘鎬у彲鍚敤NamedPipeSocketFactory锛
socketFactory=com.mysql.jdbc.NamedPipeSocketFactory
鍛藉悕绠¢亾浠呰兘褰撹繛鎺ュ埌浣嶄簬鐩稿悓鐗╃悊鏈哄櫒涓婄殑MySQL鏃舵墠鑳芥甯稿伐浣滐紝璇ユ満鍣ㄤ笂搴斾娇鐢ㄤ簡JDBC椹卞姩绋嬪簭銆傚湪绠鍗曠殑鎬ц兘娴嬭瘯涓紝鍛藉悕绠¢亾鐨勮闂熷害姣旀爣鍑嗙殑TCP/IP璁块棶鍧30锝50锛呫
浣跨敤com.mysql.jdbc.NamedPipeSocketFactory鎴com.mysql.jdbc.StandardSocketFactory涓殑绀轰緥浠g爜锛屽彲鍒涘缓浣犺嚜宸辩殑濂楁帴瀛椾唬鐞嗐
鍦ㄦ湰鑺備腑锛屽氨鐗瑰畾瀹炴柦鏂规灏嗗浣曞奖鍝峂ySQL Connector/J鐨勪娇鐢ㄦ柟寮忥紝缁欏嚭浜嗘帴鍙e眰闈笂鐨勮缁嗕粙缁嶃
路 Blob
Blob瀹炴柦涓嶅厑璁糕滃師鍦扳濊皟鏁达紙瀹冧滑鏄滃壇鏈濓紝姝eDatabaseMetaData.locatorsUpdateCopies()鏂规硶鎵鎸囨槑鐨勯偅鏍凤級銆傚洜姝わ紝搴斾娇鐢ㄥ搴旂殑PreparedStatement.setBlob()鎴朢esultSet.updateBlob()锛堝浜庡彲鏇存柊缁撴灉闆嗭級鏂规硶锛屽皢鍙樺寲淇濆瓨鍒版暟鎹簱涓
鑷狢onnector/J version 3.1.0寮濮嬶紝閫氳繃鍦↗DBC URL涓坊鍔犲睘鎬р渆mulateLocators=true鈥濓紝鑳藉浣跨敤瀹氫綅鍣ㄦā鎷烞lob銆傞殢鍚庯紝蹇呴』浣跨敤甯︽湁鍒楀肩殑鍒楀埆鍚嶏紝鍦ㄤ綘缂栧啓鐨勭敤浜庢绱lob鐨凷ELECT涓紝灏嗗垪鍊艰涓築lob鍒楃殑涓栫邯鍚嶇О銆係ELECT杩樺繀椤讳粎寮曠敤1涓〃锛岃琛ㄥ繀椤绘湁1涓富閿紝鑰屼笖SELECT蹇呴』娑电洊鏋勬垚涓婚敭鐨勬墍鏈夊垪銆傞殢鍚庯紝椹卞姩绋嬪簭灏嗗欢鏈熷姞杞藉疄闄呯殑Blob鏁版嵁锛岀洿鑷虫绱簡Blob骞跺湪鍏朵笂璋冪敤浜嗘绱㈡柟娉曚负姝紙getInputStream(), getBytes(),绛夛級銆
路 CallableStatement
鑷狢onnector/J 3.1.1寮濮嬶紝褰撻氳繃CallableStatement鎺ュ彛杩炴帴鍒癕ySQL 5.0鎴栨洿楂樼増鏈椂锛屽彲鏀寔瀛樺偍绋嬪簭銆鐩墠锛屼笉鏀寔CallableStatement鐨刧etParameterMetaData()鏂规硶銆
路 Clob
Clob瀹炴柦涓嶅厑璁糕滃師鍦扳濊皟鏁达紙瀹冧滑鏄滃壇鏈濓紝姝eDatabaseMetaData.locatorsUpdateCopies()鏂规硶鎵鎸囨槑鐨勯偅鏍凤級銆傚洜姝わ紝搴斾娇鐢≒reparedStatement.setClob()鏂规硶灏嗗彉鏇翠繚瀛樺埌鏁版嵁搴撲腑銆侸DBC API娌℃湁ResultSet.updateClob()鏂规硶銆
路 Connection
涓嶮M.MySQL鐨勬棭鏈熺増鏈笉鍚岋紝鈥渋sClosed()鈥濅笉浼氬鏈嶅姟鍣ㄥ嵆琛孭ing鎿嶄綔浠ョ‘瀹氭湇鍔″櫒鏄惁鏈夋晥銆傛寜鐓DBC瑙勮寖锛屽鏋滃湪杩炴帴涓婅皟鐢ㄤ簡鈥渃losed()鈥濓紝瀹冧粎杩斿洖鈥滅湡鈥濄傚鏋滈渶瑕佺‘瀹氳繛鎺ユ槸鍚︿緷鐒舵湁鏁堬紝搴斿彂鍑虹畝鍗曟煡璇紝濡傗淪ELECT 1鈥濄傚鏋滆繛鎺ヤ笉鍐嶆湁鏁堬紝椹卞姩绋嬪簭灏嗘姏鍑哄紓甯搞
路 DatabaseMetaData
瀵逛簬澶栭敭淇℃伅锛坓etImported/ExportedKeys()鍜実etCrossReference()锛夛紝浠呭湪鈥淚nnoDB鈥濈被鎬х殑琛ㄤ腑鍙敤銆備絾鏄紝椹卞姩绋嬪簭浼氫娇鐢ㄢ淪HOW CREATE TABLE鈥濇潵妫绱㈣淇℃伅锛屽洜姝わ紝褰撳叾浠栬〃绫诲瀷鏀寔澶栭敭鏃讹紝椹卞姩绋嬪簭涔熻兘鏀寔瀹冧滑銆
路 Driver
路 PreparedStatement
PreparedStatements鏄敱椹卞姩绋嬪簭瀹炵幇鐨勶紝杩欐槸搴斾负MySQL鏈彁渚涢澶勭悊璇彞鍔熻兘銆傚嚭浜庤鍘熷洜锛岄┍鍔ㄧ▼搴忎笉瀹炴柦getParameterMetaData()鎴杇etMetaData()锛岃繖鏄洜涓猴紝瀹冭姹傞┍鍔ㄧ▼搴忓湪瀹㈡埛绔笂鍏锋湁瀹屾暣鐨凷QL璇硶鍒嗘瀽绋嬪簭銆
浠3.1.0鐗圡ySQL Connector/J寮濮嬶紝褰撴湇鍔″櫒鏀寔鏃讹紝灏嗕娇鐢ㄦ湇鍔″櫒绔澶勭悊璇彞鍜屸滀簩杩涘埗缂栫爜鈥濈殑缁撴灉闆嗐
浣跨敤甯︽湁鈥渓arge鈥濆弬鏁帮紙杩欑被鍙傛暟鏄氳繃setBinaryStream()銆乻etAsciiStream()銆乻etUnicodeStream()銆乻etBlob()鎴杝etClob()璁剧疆鐨勶級鐨勬湇鍔″櫒绔澶勭悊璇彞鏃跺簲璋ㄦ厧銆傚鏋滄墦绠楀啀娆℃墽琛屽凡灏嗕换浣曗渓arge鈥濆弬鏁版洿鏀逛负闈炩渓arge鈥濆弬鏁扮殑璇彞锛岄渶瑕佽皟鐢╟learParameters()锛屽苟鍐嶆璁剧疆鎵鏈夊弬鏁般傚叾鍘熷洜濡備笅锛
o 璁剧疆浜嗗弬鏁版椂锛岄┍鍔ㄧ▼搴忎細灏嗏渓arge鈥濇暟鎹渙ut-of-band鈥濆彂閫佺粰鏈嶅姟鍣ㄧ鐨勯澶勭悊璇彞锛堟墽琛岄澶勭悊璇彞涔嬪墠锛夈
o 涓鏃﹀畬鎴愶紝灏嗗叧闂敤浜庤鍙栧鎴风涓婃暟鎹殑娴侊紙鏍规嵁JDBC瑙勮寖锛夛紝鑰屼笖涓嶈兘鍐嶆璇诲彇娴併
o 濡傛灉鍙傛暟浠庘渓arge鈥濆彉涓洪潪鈥渓arge鈥濓紝椹卞姩绋嬪簭蹇呴』澶嶄綅棰勫鐞嗚鍙ョ殑鏈嶅姟鍣ㄧ鐘舵侊紝浠ヤ究鍏佽宸叉洿鏀圭殑鍙傛暟鍖哄甫浠ュ墠鐨勨渓arge鈥濆笺傝繖灏嗗垹闄ゅ凡鍙戦佺粰鏈嶅姟鍣ㄧ殑鎵鏈夆渓arge鈥濇暟鎹紝鍥犺岄渶瑕侀氳繃setBinaryStream()銆乻etAsciiStream()銆乻etUnicodeStream()銆乻etBlob()鎴杝etClob()鏂规硶鍐嶆鍙戦佹暟鎹
鍥犺岋紝濡傛灉浣犳墦绠楀皢鍙傛暟绫诲瀷鏇存敼涓洪潪鈥渓arge鈥濈被鍨嬶紝蹇呴』璋冪敤clearParameters()锛屽苟鍦ㄩ噸鏂版墽琛岄澶勭悊璇彞涔嬪墠鍐嶆璁剧疆棰勫鐞嗚鍙ョ殑鎵鏈夊弬鏁般
路 ResultSet
鍦ㄩ粯璁ゆ儏鍐典笅锛孯esultSets锛堢粨鏋滈泦锛夋槸鍙畬鍏ㄦ绱㈢殑锛屽苟琚繚瀛樺湪鍐呭瓨涓傚浜庡ぇ澶氭暟鎯呭喌锛岃繖鏄渶鏈夋晥鐨勬搷浣滄柟寮忥紝鑰屼笖杩樺簲褰掑洜浜庢洿瀹规槗瀹炴柦鐨凪ySQL缃戠粶鍗忚璁捐銆傚鏋滀綘姝e湪澶勭悊鍏锋湁澶ч噺琛屾垨澶ф暟鎹殑ResultSets锛岃屼笖鏃犳硶鍦↗VM鍐呬负鎵闇鍐呭瓨鍒嗛厤澶ч噺绌洪棿锛屽彲浠ラ氱煡椹卞姩绋嬪簭浠モ滄祦鈥濇柟寮忚繑鍥炵粨鏋滐紝涓娆′竴琛屻
瑕佹兂鍏佽璇ュ姛鑳斤紝闇瑕佷互涓嬭堪鏂瑰紡鍒涘缓1涓鍙ュ疄渚嬶細
stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,
java.sql.ResultSet.CONCUR_READ_ONLY);
stmt.setFetchSize(Integer.MIN_VALUE);
姝e悜銆佸彧璇荤粨鏋滈泦锛屼互鍙奍nteger.MIN_VALUE鐨勭粍鍚堢敤浜庢寚绀洪┍鍔ㄧ▼搴忎互鈥滄祦鈥濇柟寮忔寜琛屽鐞嗙粨鏋滈泦銆傛鍚庯紝瀵逛簬璇ヨ鍙ュ垱寤虹殑缁撴灉闆嗭紝灏嗘寜琛屾绱€
瀵逛簬璇ユ柟寮忥紝鏈変竴浜涢渶娉ㄦ剰鐨勪簨椤广傝兘澶熷湪杩炴帴涓婂彂鍑轰换浣曞叾浠栨煡璇箣鍓嶏紝搴旇鍙栫粨鏋滈泦涓殑鎵鏈夎锛堟垨鍏抽棴缁撴灉闆嗭級锛屽惁鍒欏皢鎶涘嚭寮傚父銆
鑳藉閲婃斁杩欎簺閿佸畾璇彞锛堟棤璁哄畠浠槸MyISAM琛ㄧ骇閿佸畾锛岃繕鏄煇浜涘叾浠栧瓨鍌ㄥ紩鎿庡InnoDB涓殑琛岀骇閿佸畾锛夌殑鏈鏃╂椂鍒绘槸瀹屾垚璇彞鏃躲
濡傛灉璇彞鍦ㄤ簨鍔$殑鑼冨洿鍐咃紝褰撲簨鍔″畬鎴愬悗灏嗛噴鏀鹃攣瀹氾紙瀹冩剰鍛崇潃璇彞闇棣栧厛瀹屾垚锛夈備笌澶у鏁板叾浠栨暟鎹簱涓鏍凤紝鍦ㄨ鍙栦簡璇彞涓婃墍鏈夌殑鏈喅缁撴灉闆嗘垨鍏抽棴浜嗚鍙ョ殑娲诲姩缁撴灉闆嗕箣鍓嶏紝璇彞涓嶄細缁撴潫銆
鍥犳锛屽鏋滄鍦ㄤ娇鐢ㄢ滄祦寮忊濈粨鏋滐紝濡傛灉甯屾湜淇濇寔瀵圭壒瀹氳〃鐨勫悓鏃惰闂紝鑰岃繖浜涜〃琚敓鎴愮粨鏋滈泦鐨勮鍙ユ墍寮曠敤锛屽氨搴斿敖蹇湴澶勭悊鈥滄祦寮忊濈粨鏋溿
路 ResultSetMetaData
浠呭綋浣跨敤MySQL鏈嶅姟鍣4.0鎴栨洿楂樼増鏈椂锛屸渋sAutoIncrement()鈥濇柟娉曟墠鑳芥纭伐浣溿
路 Statement
浣跨敤鐗堟湰浣庝簬3.2.1鐨凧DBC椹卞姩绋嬪簭锛岃屼笖鎵杩炴帴鐨勬湇鍔″櫒鐗堟湰浣庝簬5.0.3鏃讹紝闄や簡鍍忓墠闈粙缁嶇殑閭f牱鍒囨崲缁撴灉闆嗗锛屸渟etFetchSize()鈥濇柟娉曚笉璧蜂綔鐢ㄣ
MySQL涓嶆敮鎸丼QL鍏夋爣锛岃屼笖JDBC椹卞姩绋嬪簭涔熶笉鑳芥ā鎷熷畠浠紝鍥犳鈥渟etCursorName()鈥濇病鏈夋晥鏋溿
MySQL Connector/J鍦ㄥ鐞哅ySQL鏁版嵁绫诲瀷鍜孞ava鏁版嵁绫诲瀷鐨勮浆鎹㈠鐞嗘柟闈㈠崄鍒嗙伒娲汇
灏界鍙兘浼氬嚭鐜拌垗鍏ャ佹孩鍑烘垨绮惧害鎹熷け锛屽綋鍦ㄩ氬父鎯呭喌涓嬶紝鑳藉灏嗕换浣昅ySQL鏁版嵁绫诲瀷杞崲涓簀ava.lang.String锛屽苟鑳藉皢浠讳綍鏁板肩被鍨嬭浆鎹负Java鏁板肩被鍨嬨
浠嶤onnector/J 3.1.0寮濮嬶紝鎸夌収JDBC瑙勮寖鐨勮姹傦紝JDBC椹卞姩绋嬪簭灏嗗彂鍑鸿鍛婃垨鎶涘嚭DataTruncation寮傚父锛岄櫎闈為氳繃浣跨敤鈥渏dbcCompliantTruncation鈥濆睘鎬у苟灏嗗叾璁句负鈥滃亣鈥濓紝瀵硅繛鎺ヨ繘琛岀浉搴旈厤缃彇娑堜簡鍓嶈堪瑕佹眰銆
鍦ㄤ笅闈㈢殑琛ㄦ牸涓紝鍒楀嚭鑳藉彲闈犲伐浣滅殑杞崲锛
琛26.2. 杞崲琛
涓嬭堪MySQL鏁版嵁绫诲瀷 |
鎬昏兘杞崲涓轰笅杩癑ava绫诲瀷 |
CHAR, VARCHAR, BLOB, TEXT, ENUM, and SET |
java.lang.String, java.io.InputStream, java.io.Reader, java.sql.Blob, java.sql.Clob |
FLOAT, REAL, DOUBLE PRECISION, NUMERIC, DECIMAL, TINYINT, SMALLINT, MEDIUMINT, INTEGER, BIGINT |
java.lang.String, java.lang.Short, java.lang.Integer, java.lang.Long, java.lang.Double, java.math.BigDecimal 娉ㄩ噴锛涓庡笇鏈涜浆鎹㈢殑MySQL鏁版嵁绫诲瀷鐩告瘮锛屽鏋滈夋嫨浜嗙簿搴﹁緝浣庣殑Java鏁板肩被鍨嬶紝鍙兘浼氬嚭鐜拌垗鍏ャ佹孩鍑烘垨绮惧害鎹熷け銆 |
DATE, TIME, DATETIME, TIMESTAMP |
java.lang.String, java.sql.Date, java.sql.Timestamp |
鍦∕ySQL绫诲瀷鍜孞ava绫诲瀷涔嬮棿锛孯esultSet.getObject()鏂规硶閲囩敤浜嗕笅杩扮被鍨嬭浆鎹㈡柟寮忥紝鍦ㄥ彲鑳界殑鎯呭喌涓嬮伒浠嶫DBC瑙勮寖锛
琛26.3. 鐢ㄤ簬ResultSet.getObject()鐨凪ySQL绫诲瀷鍜孞ava绫诲瀷
MySQL绫诲瀷鍚嶇О |
浠Java绫昏繑鍥 |
BIT(1) (new in MySQL-5.0) |
java.lang.Boolean |
BIT( > 1) (new in MySQL-5.0) |
byte[] |
TINYINT |
java.lang.Boolean锛屽鏋滃皢閰嶇疆灞炴鈥tinyInt1isBit鈥濊涓衡滅湡鈥濓紙榛樿鍊硷級锛屽苟灏嗗瓨鍌ㄥぇ灏忚涓衡1鈥濓紱鎴java.lang.Integer锛屽鏋滀笉鏄殑璇濄 |
BOOL , BOOLEAN |
璇峰弬瑙佷笂闈㈢殑TINYINT锛屽畠浠洰鍓嶆槸TINYINT(1)鐨勫埆鍚嶃 |
SMALLINT[(M)] [UNSIGNED] |
java.lang.Integer锛堟棤璁烘槸鍚︿负UNSIGNED锛 |
MEDIUMINT[(M)] [UNSIGNED] |
java.lang.Integer锛堟棤璁烘槸鍚︿负UNSIGNED锛 |
INT,INTEGER[(M)] [UNSIGNED] |
java.lang.Integer锛屽鏋滄槸UNSIGNED锛java.lang.Long |
BIGINT[(M)] [UNSIGNED] |
java.lang.Long锛屽鏋滄槸UNSIGNED锛java.math.BigInteger |
FLOAT[(M,D)] |
java.lang.Float |
DOUBLE[(M,B)] |
java.lang.Double |
DECIMAL[(M[,D])] |
java.math.BigDecimal |
DATE |
java.sql.Date |
DATETIME |
java.sql.Timestamp |
TIMESTAMP[(M)] |
java.sql.Timestamp |
TIME |
java.sql.Time |
YEAR[(2|4)] |
java.sql.Date锛堟棩鏈熻涓2鏈1鏃ユ櫄涓2鐐癸級 |
CHAR(M) |
java.lang.String锛堥櫎闈炲垪鐨勫瓧绗﹂泦鏄BINARY锛夛紝鐒跺悗杩斿洖瀛楄妭[] |
VARCHAR(M) [BINARY] |
java.lang.String锛堥櫎闈炲垪鐨勫瓧绗﹂泦鏄BINARY锛夛紝鐒跺悗杩斿洖瀛楄妭[] |
BINARY(M) |
byte[] |
VARBINARY(M) |
byte[] |
TINYBLOB |
byte[] |
TINYTEXT |
java.lang.String |
BLOB |
byte[] |
TEXT |
java.lang.String |
MEDIUMBLOB |
byte[] |
MEDIUMTEXT |
java.lang.String |
LONGBLOB |
byte[] |
LONGTEXT |
java.lang.String |
ENUM('value1','value2',...) |
java.lang.String |
SET('value1','value2',...) |
java.lang.String |
瀵逛簬浠嶫DBC椹卞姩绋嬪簭鍙戝線鏈嶅姟鍣ㄧ殑鎵鏈夊瓧绗︿覆锛屽潎灏嗚嚜鍔ㄥ湴浠庡浐鏈夋斁鐑璊ava Unicode褰㈠紡杞崲涓哄鎴风瀛楃缂栫爜锛屽寘鎷氳繃Statement.execute()銆Statement.executeUpdate()鍜孲tatement.executeQuery()鍙戝嚭鐨勬墍鏈夋煡璇紝浠ュ強闄や簡鐢setBytes()銆乻etBinaryStream()銆setAsiiStream()銆setUnicodeStream()鍜setBlob()鎺掗櫎鐨勫弬璇曚箣澶栫殑鎵鏈塒reparedStatement鍜CallableStatement鍙傛暟銆
鍦∕ySQL鏈嶅姟鍣4.1涔嬪墠锛孋onnector/J鏀寔姣忚繛鎺ュ崟涓瀛楃缂栫爜锛岃兘澶熶粠鏈嶅姟鍣ㄩ厤缃嚜鍔ㄦ娴嬪埌瀹冿紝涔熻兘鐢辩敤鎴烽氳繃浣跨敤useUnicode鍜characterEncoding灞炴ч厤缃畠銆
浠嶮ySQL鏈嶅姟鍣4.1鐗堣捣锛孋onnector/J鏀寔瀹㈡埛绔拰鏈嶅姟鍣ㄤ箣闂寸殑浣嗕互瀛楃缂栫爜锛屼互鍙婇拡瀵圭粨鏋滈泦涓粠鏈嶅姟鍣ㄨ繑鍥炶嚦瀹㈡埛绔殑鏁版嵁鐨勪换鎰忔暟鐩瓧绗︾紪鐮併
杩炴帴鏃跺皢鑷姩妫娴嬪鎴风鍜屾湇鍔″櫒涔嬮棿鐨勫瓧绗︾紪鐮併傚浜庣敱椹卞姩绋嬪簭浣跨敤鐨勭紪鐮佹潵璇达紝瀹冩槸鍦ㄦ湇鍔″櫒涓婇氳繃浣跨敤閰嶇疆鍙橀噺鈥character_set鈥濓紙浣庝簬4.1.0鐨勬湇鍔″櫒鐗堟湰锛夊拰鈥character_set_server鈥濓紙4.1.0鍜屾洿楂樼殑鏈嶅姟鍣ㄧ増鏈級鎸囧畾鐨勩傛洿澶氫俊鎭紝璇峰弬瑙丮ySQL鏈嶅姟鍣ㄦ墜鍐屼腑鐨鏈嶅姟鍣ㄥ瓧绗﹂泦鍜屾牎瀵涓鑺傘
瑕佹兂瑕嗙洊瀹㈡埛绔笂鐨勮嚜鍔ㄦ娴嬬紪鐮佸姛鑳斤紝鍙湪鐢ㄤ簬杩炴帴鍒版湇鍔″櫒鐨刄RL涓娇鐢ㄢcharacterEncoding鈥濆睘鎬с
鍦ㄥ鎴风涓婃寚瀹氬瓧绗︾紪鐮佹椂锛屽簲浣跨敤Java椋庢牸鍚嶇О銆傚湪涓嬮潰鐨勮〃鏍间腑锛屽垪鍑轰簡鐢ㄤ簬MySQL瀛楃闆嗙殑Java椋庢牸鍚嶇О锛
琛26.4. MySQL瀵笿ava缂栫爜鍚嶇О鐨勭炕璇
MySQL瀛楃闆嗗悕绉 | Java椋庢牸瀛楃缂栫爜鍚嶇О |
---|---|
usa7 | US-ASCII |
big5 | Big5 |
gbk | GBK |
sjis | SJIS |
gb2312 | EUC_CN |
ujis | EUC_JP |
euc_kr | EUC_KR |
latin1 | ISO8859_1 |
latin1_de | ISO8859_1 |
german1 | ISO8859_1 |
danish | ISO8859_1 |
latin2 | ISO8859_2 |
czech | ISO8859_2 |
hungarian | ISO8859_2 |
croat | ISO8859_2 |
greek | ISO8859_7 |
hebrew | ISO8859_8 |
latin5 | ISO8859_9 |
latvian | ISO8859_13 |
latvian1 | ISO8859_13 |
estonia | ISO8859_13 |
dos | Cp437 |
pclatin2 | Cp852 |
cp866 | Cp866 |
koi8_ru | KOI8_R |
tis620 | TIS620 |
win1250 | Cp1250 |
win1250ch | Cp1250 |
win1251 | Cp1251 |
cp1251 | Cp1251 |
win1251ukr | Cp1251 |
cp1257 | Cp1257 |
macroman | MacRoman |
macce | MacCentralEurope |
utf8 | UTF-8 |
ucs2 | UnicodeBig |
涓嶈鐢–onnector/J鍙戝嚭鏌ヨ鈥渟et names鈥濓紝杩欐槸鍥犱负椹卞姩绋嬪簭涓嶄細妫娴嬪凡鍙樺寲鐨勫瓧绗﹂泦锛岃屾槸浼氱户缁娇鐢ㄥ湪鍒濆杩炴帴璁剧疆涓娴嬪埌鐨勫瓧绗﹂泦銆
涓轰簡鍏佽浠庡鎴风鍙戝嚭鐨勫涓瓧绗﹂泦锛屽簲浣跨敤鈥淯TF-8鈥濈紪鐮侊紝鏂瑰紡鏄紝灏唘tf8閰嶇疆涓洪粯璁ょ殑鏈嶅姟鍣ㄥ瓧绗﹂泦锛屾垨閫氳繃鈥characterEncoding鈥濆睘鎬ч厤缃甁DBC椹卞姩绋嬪簭浠ヤ娇鐢ㄢ淯TF-8鈥濄
瑕佹兂浣縎SL鏀寔鑳藉宸ヤ綔锛屽繀椤绘弧瓒充笅杩拌姹傦細
路 鍖呭惈JSSE锛圝ava瀹夊叏濂楁帴瀛楁墿灞曪級鐨凧DK锛屽JDK-1.4.1鎴栨洿楂樼増鏈係SL鐩墠涓嶈兘涓庤兘澶熶负鍏舵坊鍔燡SSE鐨凧DK涓璧峰伐浣滐紝濡侸DK-1.2.x鎴朖DK-1.3.x锛屽師鍥犲湪浜庝笅杩癑SSE缂洪櫡锛http://developer.java.sun.com/developer/bugParade/bugs/4273544.html
路 鏀寔SSL骞跺凡缂栬瘧鍜岄厤缃簡璇ュ姛鑳界殑MySQL鏈嶅姟鍣紝濡侻ySQL-4.0.4鍜屾洿楂樼増鏈紝璇峰弬瑙侊細http://www.mysql.com/doc/en/Secure_connections.html
路 瀹㈡埛绔瘉涔︼紙鍦ㄦ湰鑺傜◢鍚庝粙缁嶏級銆
棣栧厛锛岄渶瑕佸皢MySQL鏈嶅姟鍣–A璇佷功瀵煎叆鍒癑ava truststore銆傚湪MySQL婧愮爜鍒嗗彂鐗堢殑鈥淪SL鈥濆瓙鐩綍涓嬬粰鍑轰簡1涓ず渚婱ySQL鏈嶅姟鍣–A璇佷功銆係SL灏嗕娇鐢ㄥ畠鏉ョ‘瀹氭槸鍚︿笌瀹夊叏MySQL鏈嶅姟鍣ㄨ繘琛岄氫俊銆
瑕佹兂浣跨敤Java鐨勨渒eytool鈥濆湪褰撳墠鐩綍涓嬪垱寤簍ruststore锛屽苟瀵煎叆鏈嶅姟鍣ㄧ殑CA璇佷功锛堚渃acert.pem鈥濓級锛屽彲閲囧彇涓嬭堪鏂瑰紡锛堝亣瀹氣渒eytool鈥濅綅浜庤矾寰勪腑銆傚畠浣嶄簬JDK鎴朖RE鐨勨渂in鈥濆瓙鐩綍涓嬶級锛
shell> keytool -import -alias mysqlServerCACert -file cacert.pem -keystore truststore
Keytool灏嗙粰鍑轰笅杩板搷搴斾俊鎭細
Enter keystore password: *********
Owner: EMAILADDRESS=walrus@example.com, CN=Walrus, O=MySQL AB, L=Orenburg, ST=Some
-State, C=RU
Issuer: EMAILADDRESS=walrus@example.com, CN=Walrus, O=MySQL AB, L=Orenburg, ST=Som
e-State, C=RU
Serial number: 0
Valid from: Fri Aug 02 16:55:53 CDT 2002 until: Sat Aug 02 16:55:53 CDT 2003
Certificate fingerprints:
MD5: 61:91:A0:F2:03:07:61:7A:81:38:66:DA:19:C4:8D:AB
SHA1: 25:77:41:05:D5:AD:99:8C:14:8C:CA:68:9C:2F:B8:89:C3:34:4D:6C
Trust this certificate? [no]: yes
Certificate was added to keystore
闅忓悗锛岄渶瑕佺敓鎴愬鎴风璇佷功锛屼互渚縈ySQL鏈嶅姟鍣ㄧ煡閬撳畠姝d笌瀹夊叏瀹㈡埛绔繘琛岄氫俊锛
shell> keytool -genkey -keyalg rsa -alias mysqlClientCertificate -keystore keystore
Keytool灏嗙粰鍑轰笅杩版彁绀轰俊鎭紝骞跺湪褰撶洰褰曚笅鍒涘缓鍚嶄负鈥渒eystore鈥濈殑瀵嗛挜瀛樺偍鍣ㄣ
浣犲簲浣跨敤涓庡叿浣撴儏鍐电浉閫傚簲鐨勬柊浣滃嚭鍝嶅簲锛
Enter keystore password: *********
What is your first and last name?
[Unknown]: Matthews
What is the name of your organizational unit?
[Unknown]: Software Development
What is the name of your organization?
[Unknown]: MySQL AB
What is the name of your City or Locality?
[Unknown]: Flossmoor
What is the name of your State or Province?
[Unknown]: IL
What is the two-letter country code for this unit?
[Unknown]: US
Is <CN=Matthews, OU=Software Development, O=MySQL AB,
L=Flossmoor, ST=IL, C=US> correct?
[no]: y
杈撳叆<mysqlClientCertificate>鐨勫瘑鐮
濡傛灉涓巏eystore鐨勫瘑鐮佺浉鍚岋紝鎸夊洖杞︼級锛
鏈鍚庯紝瑕佹兂浣縅SSE鑳藉浣跨敤浣犵敓鎴愮殑keystore鍜宼ruststore锛屽惎鍔↗VM鏃讹紝闇瑕佽缃笅杩扮郴缁熷睘鎬э紝鐢ㄤ綘鎵鍒涘缓鐨刱eystore鏂囦欢瀹屾暣璺緞鏇挎崲鈥減ath_to_keystore_file鈥濓紝鐢ㄤ綘鎵鍒涘缓鐨則ruststore鏂囦欢瀹屾暣璺緞鏇挎崲鈥減ath_to_truststore_file鈥濓紝骞朵负姣忎釜灞炴т娇鐢ㄦ伆褰撶殑瀵嗙爜鍊笺
-Djavax.net.ssl.keyStore=path_to_keystore_file
-Djavax.net.ssl.keyStorePassword=*********
-Djavax.net.ssl.trustStore=path_to_truststore_file
-Djavax.net.ssl.trustStorePassword=*********
姝ゅ锛岃繕闇瑕佸湪鐢ㄤ簬MySQL Connector/J鐨勮繛鎺ュ弬鏁颁腑灏嗏渦seSSL鈥濊缃负鈥滅湡鈥濓紝鏂规硶鏄紝鍦║RL涓坊鍔犫渦seSSL=true鈥濓紝鎴栧湪鍑嗗浼犻掔粰DriverManager.getConnection()鐨刯ava.util.Properties瀹炰緥涓皢鈥渦seSSL鈥濊缃负鈥滅湡鈥濄
浣犲彲浠ユ墦寮JSSE璋冭瘯鍔熻兘鑳藉锛屾祴璇昐SL鏄惁宸ヤ綔锛堣鎯呭涓嬶級锛屽苟鏌ユ壘涓嬭堪鍏抽敭浜嬩欢锛
...
*** ClientHello, v3.1
RandomCookie: GMT: 1018531834 bytes = { 199, 148, 180, 215, 74, 12, 54, 244, 0, 168, 55, 103, 215, 64, 16, 138, 225, 190, 132, 153, 2, 217, 219, 239, 202, 19, 121, 78 }
Session ID: {}
Cipher Suites: { 0, 5, 0, 4, 0, 9, 0, 10, 0, 18, 0, 19, 0, 3, 0, 17 }
Compression Methods: { 0 }
***
[write] MD5 and SHA1 hashes: len = 59
0000: 01 00 00 37 03 01 3D B6 90 FA C7 94 B4 D7 4A 0C ...7..=.......J.
0010: 36 F4 00 A8 37 67 D7 40 10 8A E1 BE 84 99 02 D9 6...7g.@........
0020: DB EF CA 13 79 4E 00 00 10 00 05 00 04 00 09 00 ....yN..........
0030: 0A 00 12 00 13 00 03 00 11 01 00 ...........
main, WRITE: SSL v3.1 Handshake, length = 59
main, READ: SSL v3.1 Handshake, length = 74
*** ServerHello, v3.1
RandomCookie: GMT: 1018577560 bytes = { 116, 50, 4, 103, 25, 100, 58, 202, 79, 185, 178, 100, 215, 66, 254, 21, 83, 187, 190, 42, 170, 3, 132, 110, 82, 148, 160, 92 }
Session ID: {163, 227, 84, 53, 81, 127, 252, 254, 178, 179, 68, 63, 182, 158, 30, 11, 150, 79, 170, 76, 255, 92, 15, 226, 24, 17, 177, 219, 158, 177, 187, 143}
Cipher Suite: { 0, 5 }
Compression Method: 0
***
%% Created: [Session-1, SSL_RSA_WITH_RC4_128_SHA]
** SSL_RSA_WITH_RC4_128_SHA
[read] MD5 and SHA1 hashes: len = 74
0000: 02 00 00 46 03 01 3D B6 43 98 74 32 04 67 19 64 ...F..=.C.t2.g.d
0010: 3A CA 4F B9 B2 64 D7 42 FE 15 53 BB BE 2A AA 03 :.O..d.B..S..*..
0020: 84 6E 52 94 A0 5C 20 A3 E3 54 35 51 7F FC FE B2 .nR..\ ..T5Q....
0030: B3 44 3F B6 9E 1E 0B 96 4F AA 4C FF 5C 0F E2 18 .D?.....O.L.\...
0040: 11 B1 DB 9E B1 BB 8F 00 05 00 ..........
main, READ: SSL v3.1 Handshake, length = 1712
...
璁剧疆浜嗕笅杩扮郴缁熷睘鎬ф椂锛孞SSE鍙彁渚涜皟璇曞姛鑳斤紙涓篠TDOUT锛夛細-Djavax.net.debug=all銆傚畠鐢ㄤ簬璁惧畾瑕佷娇鐢ㄧ殑keystores鍜宼ruststores锛屼互鍙婂湪SSL鎻℃墜鍜岃瘉涔︿氦鎹㈣繃绋嬩腑灏嗗嚭鐜颁粈涔堛傚綋浣犲皾璇曡繘琛孲SL杩炴帴鏃讹紝濡傛灉鎵撶畻纭畾涓嶈兘宸ヤ綔鐨勯儴鍒嗭紝璇ヨ缃崄鍒嗘湁鐢ㄣ
浠嶤onnector/J 3.1.7寮濮嬶紝鎴戜滑鎻愪緵浜1涓┍鍔ㄧ▼搴忓彉浣擄紝瀹冭兘鑷姩鍙戝嚭璇伙紡鍐欎富鏈嶅姟鍣ㄧ殑鏌ヨ锛屾垨鏍规嵁Connection.getReadOnly()鐨勭姸鎬佸浠庝富鏈鸿繘琛屾晠闅滃垏鎹㈡垨寰幆璐熻浇骞宠 璁剧疆銆
搴旂敤绋嬪簭鍙戝嚭淇″彿锛岄氳繃璋冪敤Connection.setReadOnly(true)鎸囨槑浜嬪姟涓哄彧璇荤殑锛岃鍏锋湁鈥澶嶅埗鎰忚瘑鈥鐨勮繛鎺ュ皢浣跨敤浠庤繛鎺ヤ箣涓锛屼粠杩炴帴鏄噰鐢ㄤ簡寰幆鏂规鐨勮礋杞藉钩琛er-vm锛堢粰瀹氳繛鎺ヤ笌浠庤繛鎺ュ瘑鍒囩浉鍏筹紝闄ら潪鍦ㄦ湇鍔′腑鍒犻櫎浜嗕粠杩炴帴锛夈傚鏋滀綘鏈1椤瑰啓浜嬪姟锛屾垨1椤瑰鏃堕棿鏁忔劅鐨勮浜嬪姟锛堣浣忥紝鍦∕ySQL涓紝澶嶅埗鏄互寮傛鏂瑰紡杩涜鐨勶級锛岃璋冪敤Connection.setReadOnly(false)锛灏嗚繛鎺ヨ缃负闈炲彧璇荤殑锛岄┍鍔ㄧ▼搴忎細纭繚杩涗竴姝ョ殑璋冪敤鍧囧皢琚彂閫佸埌涓籑ySQL鏈嶅姟鍣ㄣ傞┍鍔ㄧ▼搴忚礋璐d紶鎾璦utocommit鐨勫綋鍓嶇姸鎬侊紝闅旂绾у埆锛屼互鍙婄敤浜庡畬鎴愯璐熻浇骞宠 鍔熻兘鐨勬墍鏈夎繛鎺ヤ箣闂寸殑鐩綍銆
瑕佹兂鍚敤璇ヨ鍔熻兘锛屽湪閰嶇疆搴旂敤鏈嶅姟鍣ㄧ殑杩炴帴姹犳椂锛屾垨涓虹嫭绔嬪簲鐢ㄧ▼搴忓垱寤篔DBC椹卞姩瀹炰緥鏃讹紝璇蜂娇鐢ㄢcom.mysql.jdbc.ReplicationDriver鈥濈被銆傜敱浜庡畠鑳芥帴鍙椾笌鏍囧噯MySQL JDBC椹卞姩鐩稿悓鐨刄RL鏍煎紡锛ReplicationDriver鐩墠涓嶈兘涓庡熀浜巎ava.sql.DriverManager鐨勮繛鎺ヤ竴璧蜂娇鐢紝闄ら潪瀹冩槸鐢―riverManager娉ㄥ唽鐨勫敮涓MySQL JDBC椹卞姩绋嬪簭銆
涓嬮潰缁欏嚭浜嗕竴涓畝鐭殑绠鍗曠ず渚嬶紝浠嬬粛浜嗗浣曞湪鐙珛搴旂敤绋嬪簭涓娇鐢≧eplicationDriver鐨勬柟娉曘
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.Properties;
import com.mysql.jdbc.ReplicationDriver;
public class ReplicationDriverDemo {
public static void main(String[] args) throws Exception {
ReplicationDriver driver = new ReplicationDriver();
Properties props = new Properties();
// We want this for failover on the slaves
props.put("autoReconnect", "true");
// We want to load balance between the slaves
props.put("roundRobinLoadBalance", "true");
props.put("user", "foo");
props.put("password", "bar");
//
// Looks like a normal MySQL JDBC url, with a comma-separated list
// of hosts, the first being the 'master', the rest being any number
// of slaves that the driver will load balance against
//
Connection conn =
driver.connect("jdbc:mysql://master,slave1,slave2,slave3/test",
props);
//
// Perform read/write work on the master
// by setting the read-only flag to "false"
//
conn.setReadOnly(false);
conn.setAutoCommit(false);
conn.createStatement().executeUpdate("UPDATE some_table ....");
conn.commit();
//
// Now, do a query from a slave, the driver automatically picks one
// from the list
//
conn.setReadOnly(true);
ResultSet rs = conn.createStatement().executeQuery("SELECT a,b,c FROM some_other_table");
.......
}
}
浜嬪疄涓婏紝褰撴煇涓绾跨▼闇瑕佺敤JDBC鍦∕ySQL鎴栧叾浠栨暟鎹簱涓婃墽琛屾搷浣滄椂锛岄渶瑕佺敤鍒扮敱杩炴帴姹犳彁渚涚殑杩炴帴銆備娇鐢ㄨ繛鎺ュ畬鎴愮嚎绋嬪悗锛岀嚎绋嬩細灏嗚繛鎺ヨ繑鍥炵粰杩炴帴姹狅紝浠ヤ究璇ヨ繛鎺ヨ兘澶熻鍏朵粬闇瑕佷娇鐢ㄨ繛鎺ョ殑绾跨▼浣跨敤銆
浠庤繛鎺ユ睜鈥滃熷嚭鈥濊繛鎺ユ椂锛岃杩炴帴浠呬緵璇锋眰瀹冪殑绾跨▼浣跨敤銆備粠缂栫▼瑙傜偣鐪嬶紝鍏舵晥鏋滅瓑鍚屼簬姣忔闇瑕丣DBC杩炴帴鏃惰皟鐢―riverManager.getConnection()锛屼絾鏄紝閲囩敤杩炴帴姹犳妧鏈紝鍙氳繃浣跨敤鏂扮殑鎴栧凡鏈夌殑杩炴帴缁撴潫绾跨▼銆
杩炴帴姹犳妧鏈兘鏄捐憲澧炲姞Java搴旂敤绋嬪簭鐨勬ц兘锛屽悓鏃惰繕鑳介檷浣庤祫婧愪娇鐢ㄧ巼銆傝繛鎺ユ睜鎶鏈殑涓昏浼樼偣鍖呮嫭锛
路 缂╃煭浜嗚繛鎺ュ垱寤烘椂闂
涓庡叾浠栨暟鎹簱鐩告瘮锛孧ySQL鎻愪緵浜嗗揩閫熺殑杩炴帴璁剧疆鍔熻兘锛岃繛鎺ユ椂闂撮氬父涓嶆槸闂锛屼絾鍒涘缓鏂扮殑JDBC杩炴帴浠嶄細瀵艰嚧鑱旂綉鎿嶄綔鍜屼竴瀹氱殑IDBC椹卞姩寮閿锛屽鏋滆繖绫昏繛鎺ユ槸鈥滃惊鐜濅娇鐢ㄧ殑锛屼娇鐢ㄨ鏂瑰紡锛屽彲閬垮厤杩欑被涓嶅埄鍥犵礌銆
路 绠鍖栫殑缂栫▼妯″瀷
浣跨敤杩炴帴姹犳妧鏈椂锛屾瘡涓崟鐙嚎绋嬭兘澶熷儚鍒涘缓浜嗚嚜宸辩殑JDBC杩炴帴閭f牱杩涜鎿嶄綔锛屼粠鑰屽厑璁镐娇鐢ㄧ洿鎺ョ殑JDBC缂栫▼鎶鏈
路 鍙楁帶鐨勮祫婧愪娇鐢
濡傛灉涓嶄娇鐢ㄨ繛鎺ユ睜鎶鏈紝鑰屾槸鍦ㄦ瘡娆¢渶瑕佹椂涓虹嚎绋嬪垱寤烘柊鐨勮繛鎺ワ紝閭d箞搴旂敤绋嬪簭鐨勮祫婧愪娇鐢ㄥ皢鍗佸垎娴垂锛岃屼笖鍦ㄨ礋杞借緝閲嶇殑鎯呭喌涓嬩細瀵艰嚧鏃犳硶棰勬湡鐨勭粨鏋溿
娉ㄦ剰锛屼笌MySQL鐨勬瘡涓繛鎺ュ潎浼氬湪瀹㈡埛绔拰鏈嶅姟鍣ㄧ閫犳垚涓瀹氱殑寮閿锛堟瘡瀵搞丆PU銆佸叧鑱旇浆鎹㈢瓑锛夈傛瘡涓繛鎺ュ潎浼氬搴旂敤绋嬪簭鍜孧ySQL鏈嶅姟鍣ㄧ殑鍙敤璧勬簮甯︽潵涓瀹氱殑闄愬埗銆傛棤璁鸿繛鎺ユ槸鍚︽墽琛屼换浣曟湁鐢ㄧ殑浠诲姟锛屼粛灏嗕娇鐢ㄨ繖浜涜祫婧愪腑鐨勭浉褰撲竴閮ㄥ垎銆
杩炴帴姹犺兘澶熶娇鎬ц兘鏈澶у寲锛屽悓鏃惰繕鑳藉皢璧勬簮鍒╃敤鎺у埗鍦ㄤ竴瀹氱殑姘村钩涔嬩笅锛屽鏋滆秴杩囪姘村钩锛屽簲鐢ㄧ▼搴忓皢宕╂簝鑰屼笉浠呬粎鏄彉鎱€
骞歌繍鐨勬槸锛孲un鍏徃閫氳繃JDBC-2.0鈥滃彲閫夆濇帴鍙o紝瀹屾垚浜咼DBC涓繛鎺ユ睜姒傚康鐨勬爣鍑嗗寲瀹炴柦锛屾墍鏈変富瑕佸簲鐢ㄦ湇鍔″櫒鍧囧疄鏂戒簡鑳藉涓嶮ySQL Connector/J涓璧疯壇濂藉伐浣滅殑杩欑被API銆
閫氬父锛屼綘鍙互鍦ㄥ簲鐢ㄦ湇鍔″櫒鐨勯厤缃枃浠朵腑閰嶇疆杩炴帴姹狅紝骞堕氳繃Java鍛藉悕鍜岀洰褰曟帴鍙o紙JNDI锛夎闂畠銆傚湪涓嬮潰鐨勪唬鐮佷腑锛屼粙缁嶄簡鍦↗2E搴旂敤鏈嶅姟鍣ㄤ笂杩愯鐨勫簲鐢ㄧ▼搴忎腑浣跨敤杩炴帴姹犵殑鏂规硶锛
绀轰緥26.12. 涓嶫2EE搴旂敤鏈嶅姟鍣ㄤ竴璧蜂娇鐢ㄨ繛鎺ユ睜
import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import javax.naming.InitialContext; import javax.sql.DataSource; public class MyServletJspOrEjb { public void doSomething() throws Exception { /* * Create a JNDI Initial context to be able to * lookup the DataSource * * In production-level code, this should be cached as * an instance or static variable, as it can * be quite expensive to create a JNDI context. * * Note: This code only works when you are using servlets * or EJBs in a J2EE application server. If you are * using connection pooling in standalone Java code, you * will have to create/configure datasources using whatever * mechanisms your particular connection pooling library * provides. */ InitialContext ctx = new InitialContext(); /* * Lookup the DataSource, which will be backed by a pool * that the application server provides. DataSource instances * are also a good candidate for caching as an instance * variable, as JNDI lookups can be expensive as well. */ DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/MySQLDB"); /* * The following code is what would actually be in your * Servlet, JSP or EJB 'service' method...where you need * to work with a JDBC connection. */ Connection conn = null; Statement stmt = null; try { conn = ds.getConnection(); /* * Now, use normal JDBC programming to work with * MySQL, making sure to close each resource when you're * finished with it, which allows the connection pool * resources to be recovered as quickly as possible */ stmt = conn.createStatement(); stmt.execute("SOME SQL QUERY"); stmt.close(); stmt = null; conn.close(); conn = null; } finally { /* * close any jdbc instances here that weren't * explicitly closed during normal code path, so * that we don't 'leak' resources... */ if (stmt != null) { try { stmt.close(); } catch (sqlexception sqlex) { // ignore -- as we can't do anything about it here } stmt = null; } if (conn != null) { try { conn.close(); } catch (sqlexception sqlex) { // ignore -- as we can't do anything about it here } conn = null; } } } }
濡備笂渚嬫墍绀猴紝鑾峰緱JNDI InitialContext骞舵煡鎵惧埌鏁版嵁搴撳悗锛屽叾浣欎唬鐮佷笌杩囧幓鍦↗DBC缂栫▼涓娇鐢ㄧ殑绫讳技銆
浣跨敤杩炴帴姹犳椂闇瑕佺墷璁扮殑鏈閲嶈浜嬮」鏄紝鏃犺鍦ㄤ唬鐮佷腑鍑虹幇浜嗕粈涔堬紙寮傚父銆佹帶鍒舵祦绛夛級锛岃繛鎺ヤ互鍙婄敱杩炴帴鍒涘缓鐨勪换浣曢儴鍒嗭紙璇彞銆佺粨鏋滈泦绛夛級鍧囧簲琚叧闂紝浠ヤ究鑳藉啀娆′娇鐢ㄥ畠浠傚涓嶇劧锛屽畠浠皢绾犵紶鍦ㄤ竴璧凤紝鍦ㄦ渶濂界殑鎯呭喌涓嬶紝鎰忓懗鐫瀹冧滑鎵浠h〃鐨凪ySQL鏈嶅姟鍣ㄨ祫婧愶紙缂撳啿鍖恒侀攣瀹氥佸鎺ュ瓧绛夛級鍙兘浼氭崋缁戜竴娈垫椂闂达紝鍦ㄦ渶鍧忕殑鎯呭喌涓嬶紝鍙兘浼氬鑷存案涔呮崋缁戙
杩炴帴姹犵殑鏈浣冲ぇ灏忔槸浠涔堬紵
涓庢墍鏈夊叾浠栭厤缃粡楠岃鍒欎竴鏍凤紝鍥炵瓟鏄滃畠鍙栧喅浜庡叿浣撴儏鍐碘濄傚敖绠℃渶浣冲ぇ灏忓彇鍐充笌棰勬湡鐨勮礋杞藉拰骞冲潎鐨勬暟鎹簱浜嬪姟鏃堕棿锛屾渶浣崇殑杩炴帴姹犲ぇ灏忓皬浜庝綘鐨勯鏈熴備緥濡傦紝濡傛灉浣跨敤鐨勬槸Sun鍏徃鐨凧ava Petstore Blueprint搴旂敤绋嬪簭锛屽浜庡寘鍚15锝20涓繛鎺ョ殑杩炴帴姹狅紝浣跨敤MySQL鍜孴omcat锛屽湪鍙帴鍙楃殑鐩稿簲鏃堕棿涓嬶紝鍙湇鍔′簬涓瓑绋嬪害鐨勮礋杞斤紙600涓苟鍙戠敤鎴凤級銆
瑕佹兂纭畾鐢ㄤ簬搴旂敤绋嬪簭鐨勮繛鎺ユ睜澶у皬锛屽簲浣跨敤璇稿Apache Jmeter鎴朤he Grinder绛夊伐鍏峰垱寤鸿礋杞芥祴璇曡剼鏈紝骞跺搴旂敤绋嬪簭杩涜璐熻浇娴嬭瘯銆
纭畾鍑哄彂鐐圭殑涓绉嶇畝鍗曟柟娉曟槸锛屽皢杩炴帴姹犵殑鏈澶ц繛鎺ユ暟閰嶇疆涓衡滄棤闄愨濓紝杩愯璐熻浇娴嬭瘯锛屽苟娴嬮噺鏈澶х殑骞跺彂杩炴帴鏁般傞殢鍚庯紝搴旇繘琛屽弽鍚戞搷浣滐紝纭畾鍑轰娇搴旂敤绋嬪簭鍏锋湁鏈浣虫ц兘鐨勮繛鎺ユ睜鐨勬渶灏忓拰鏈澶у笺
涓嬭堪鍐呭鍩轰簬鍏充簬Tomcat-5.x鐨勬寚绀鸿鏄庯紝http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html锛屽湪缂栧啓鏈枃妗f椂瀹冩槸鏈鏂扮殑銆
棣栧厛瀹夎涓嶤onnector/J in $CATALINA_HOME/common/lib涓璧锋彁渚涚殑.jar鏂囦欢锛屼互渚垮畠鑳界敤浜庡凡瀹夎鐨勬墍鏈夊簲鐢ㄧ▼搴忋
鍏舵锛屽湪瀹氫箟Web搴旂敤绋嬪簭鐨凜ontext锛堝満鏅級鍐咃紝閫氳繃涓$CATALINA_HOME/conf/server.xml澧炲姞澹版槑璧勬簮锛岄厤缃JNDI DataSource锛
<Context ....> ... <Resource name="jdbc/MySQLDB" auth="Container" type="javax.sql.DataSource"/> <!-- The name you used above, must match _exactly_ here! The connection pool will be bound into JNDI with the name "java:/comp/env/jdbc/MySQLDB" --> <ResourceParams name="jdbc/MySQLDB"> <parameter> <name>factory</name> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value> </parameter> <!-- Don't set this any higher than max_connections on your MySQL server, usually this should be a 10 or a few 10's of connections, not hundreds or thousands --> <parameter> <name>maxActive</name> <value>10</value> </parameter> <!-- You don't want to many idle connections hanging around if you can avoid it, only enough to soak up a spike in the load --> <parameter> <name>maxIdle</name> <value>5</value> </parameter> <!-- Don't use autoReconnect=true, it's going away eventually and it's a crutch for older connection pools that couldn't test connections. You need to decide if your application is supposed to deal with SQLExceptions (hint, it should), and how much of a performance penalty you're willing to pay to ensure 'freshness' of the connection --> <parameter> <name>validationQuery</name> <value>SELECT 1</value> </parameter> <!-- The most conservative approach is to test connections before they're given to your application. For most applications this is okay, the query used above is very small and takes no real server resources to process, other than the time used to traverse the network. If you have a high-load application you'll need to rely on something else. --> <parameter> <name>testOnBorrow</name> <value>true</value> </parameter> <!-- Otherwise, or in addition to testOnBorrow, you can test while connections are sitting idle --> <parameter> <name>testWhileIdle</name> <value>true</value> </parameter> <!-- You have to set this value, otherwise even though you've asked connections to be tested while idle, the idle evicter thread will never run --> <parameter> <name>timeBetweenEvictionRunsMillis</name> <value>10000</value> </parameter> <!-- Don't allow connections to hang out idle too long, never longer than what wait_timeout is set to on the server...A few minutes or even fraction of a minute is sometimes okay here, it depends on your application and how much spikey load it will see --> <parameter> <name>minEvictableIdleTimeMillis</name> <value>60000</value> </parameter> <!-- Username and password used when connecting to MySQL --> <parameter> <name>username</name> <value>someuser</value> </parameter> <parameter> <name>password</name> <value>somepass</value> </parameter> <!-- Class name for the Connector/J driver --> <parameter> <name>driverClassName</name> <value>com.mysql.jdbc.Driver</value> </parameter> <!-- The JDBC connection url for connecting to MySQL, notice that if you want to pass any other MySQL-specific parameters you should pass them here in the URL, setting them using the parameter tags above will have no effect, you will also need to use & to separate parameter values as the ampersand is a reserved character in XML --> <parameter> <name>url</name> <value>jdbc:mysql://localhost:3306/test</value> </parameter> </ResourceParams> </Context>
涓鑸岃█锛屽簲閬靛惊鍏充簬鐩稿簲Tomcat鐗堟湰鐨勫畨瑁呰鏄庯紝杩欐槸鍥犱负锛屽湪Tomcat涓厤缃暟鎹簮鐨勬柟寮忎細闅忔椂鍙樺寲锛屽緢涓嶅垢锛屽鏋滃湪XML鏂囦欢涓娇鐢ㄤ簡閿欒鐨勮娉曪紝寰堝彲鑳戒細浠ュ紓甯哥粨鏉燂紝濡備笅鎵绀猴細
Error: java.sql.SQLException: Cannot load JDBC driver class 'null ' SQL state: null
涓嬭堪璇存槑閫傜敤浜嶫Boss-4.x銆傝鎯充娇搴旂敤鏈嶅姟鍣ㄨ兘澶熶娇鐢↗DBC椹卞姩绫伙紝璇峰皢涓嶤onnector/J涓璧锋彁渚涚殑.jar鏂囦欢鎷疯礉鍒扮敤浜庢湇鍔″櫒閰嶇疆鐨刲ib鐩綍涓嬶紙閫氬父绉颁负鈥滈粯璁も濓級銆傞殢鍚庯紝鍦ㄧ浉鍚岀殑閰嶇疆鐩綍涓嬶紝鍦ㄥ悕涓衡渄eploy鈥濈殑瀛愮洰褰曚笅锛屽垱寤轰互鈥-ds.xml鈥濈粨灏剧殑鏁版嵁婧愰厤缃枃浠讹紝鐢ㄤ簬閫氱煡Jboss灏嗚鏂囦欢褰撲綔JDBC鏁版嵁婧愩傝鏂囦欢搴斿寘鍚笅杩板唴瀹癸細
<datasources> <local-tx-datasource> <!-- This connection pool will be bound into JNDI with the name "java:/MySQLDB" --> <jndi-name>MySQLDB</jndi-name> <connection-url>jdbc:mysql://localhost:3306/dbname</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>user</user-name> <password>pass</password> <min-pool-size>5</min-pool-size> <!-- Don't set this any higher than max_connections on your MySQL server, usually this should be a 10 or a few 10's of connections, not hundreds or thousands --> <max-pool-size>20</max-pool-size> <!-- Don't allow connections to hang out idle too long, never longer than what wait_timeout is set to on the server...A few minutes is usually okay here, it depends on your application and how much spikey load it will see --> <idle-timeout-minutes>5</idle-timeout-minutes> <!-- If you're using Connector/J 3.1.8 or newer, you can use our implementation of these to increase the robustness of the connection pool. --> <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name> <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</valid-connection-checker-class-name> </local-tx-datasource> </datasources>
瀵逛簬MySQL Connector/J鐢ㄦ埛锛屼細閬囧埌涓浜涘父瑙佺殑鍏卞悓闂銆傚湪鏈妭涓紝浠嬬粛浜嗗畠浠殑鐥囩姸鍜岀浉搴旂殑瑙e喅鏂规硶銆 鍏充簬鏇磋繘涓姝ョ殑淇℃伅锛岃鍙傝鈥滄敮鎸佲濅竴鑺傘
27.3.5.1.1:
闂锛
褰撴垜灏濊瘯鐢∕ySQL Connector/J杩炴帴鍒版暟鎹簱鏃讹紝閬囧埌涓嬭堪寮傚父锛
SQLException: Server configuration denies access to data source
SQLState: 08001
VendorError: 0
鍑虹幇浜嗕粈涔堥棶棰橈紵 浣跨敤MySQL鍛戒护琛屽鎴风鏃讹紝杩炴帴鑹ソ銆
鍥炵瓟锛
MySQL Connector/J蹇呴』浣跨敤TCP/IP濂楁帴瀛楁潵杩炴帴MySQL锛屽師鍥犲湪浜嶫ava涓嶆敮鎸乁nix Domain濂楁帴瀛椼傚洜姝わ紝褰揗ySQL Connector/J杩炴帴鍒癕ySQL鏃讹紝MySQL鏈嶅姟鍣ㄧ殑瀹夊叏绠$悊鍣ㄥ皢浣跨敤鍏舵巿鏉冭〃鍒ゆ柇鏄惁鍏佽杩炴帴銆傚繀椤绘坊鍔犳巿鏉冩墠鑳藉厑璁歌鎿嶄綔銆備笅闈㈢粰鍑轰簡涓涓墽琛岃鎿嶄綔鐨勭ず渚嬶紙浣嗗苟闈炴渶瀹夊叏鐨勶級銆
浠巑ysql鍛戒护琛屽鎴风浠ヨ兘澶熸巿鏉冪殑鐢ㄦ埛韬唤鐧诲綍锛屽苟鍙戝嚭涓嬭堪鍛戒护锛
GRANT ALL PRIVILEGES ON [dbname].* to
'[user]'@'[hostname]' identified by
'[password]'
鐢ㄤ綘鐨勬暟鎹簱鍚嶇О鏇挎崲[dbname]锛岀敤鐢ㄦ埛鍚嶆浛鎹user]锛岀敤MySQL Connector/J灏嗚繛鎺ョ殑涓绘満鏇挎崲[hostname]锛屽苟鐢ㄦ墦绠椾娇鐢ㄧ殑瀵嗙爜鏇挎崲[password]銆傛敞鎰忥紝瀵逛簬浠庢湰鍦颁富鏈鸿繘琛岃繛鎺ョ殑涓绘満鍚嶉儴鍒嗭紝RedHat Linux灏嗗け璐ャ傚湪杩欑鎯呭喌涓嬶紝瀵逛簬[hostname]鍊硷紝闇瑕佷娇鐢ㄢ渓ocalhost.localdomain鈥濄傞殢鍚庯紝鍙戝嚭FLUSH PRIVILEGES鍛戒护銆
闄ら潪娣诲姞浜嗏--host鈥濇爣蹇楋紝骞朵负涓绘満浣跨敤浜嗕笉鍚屼簬鈥渓ocalhost鈥濈殑鍏朵粬璁剧疆锛屽惁鍒欏皢鏃犳硶浣跨敤mysql鍛戒护琛屽鎴绔祴璇曡繛閫氭с傚鏋滀娇鐢ㄤ簡鐗规畩鐨勪富鏈哄悕鈥渓ocalhost鈥濓紝mysql鍛戒护琛屽鎴风灏嗕娇鐢║nix鍩熷鎺ュ瓧銆傚鏋滄鍦ㄦ祴璇曚笌鈥渓ocalhost鈥濈殑杩為氭э紝璇蜂娇鐢ㄢ127.0.0.1鈥濅綔涓轰富鏈哄悕銆
濡傛灉浣犱笉浜嗚В鈥淕RANT鈥濆懡浠ゆ槸骞蹭粈涔堢殑锛屾垨涓嶄簡瑙h鍛戒护鐨勫伐浣滄柟寮忥紝鍦ㄥ皾璇曟洿鏀规潈闄愪箣鍓嶏紝璇烽槄璇籑ySQL鎵嬪唽涓殑 涓鑸畨鍏ㄤ簨瀹滀互鍙MySQL璁块棶鏉冮檺浣撶郴涓鑺傘
濡傛灉鍦∕ySQL涓笉鎭板綋鍦版洿鏀逛簡鏉冮檺鍜岃鍙紝鍙兘浼氫娇鏈嶅姟鍣ㄤ笉浼氬叿鏈夋渶浣崇殑瀹夊叏鎬ц兘銆
27.3.5.1.2:
闂锛
鎴戠殑搴旂敤绋嬪簭鎶涘嚭SQLException鈥滄棤鎭板綋鐨勯┍鍔ㄧ▼搴忊濄備负浠涔堜細鍑虹幇璇ユ儏鍐碉紵
鍥炵瓟锛
鍑虹幇浜嗕袱绉嶆儏鍐典箣涓銆傛垨鏄1椹卞姩绋嬪簭鏈綅浜庝綘鐨凜LASSPATH涓紙璇峰弬瑙佸墠闈㈢殑鈥滃畨瑁呴儴鍒嗏濓級锛屾垨鏄疷RL鏍煎紡涓嶆纭紙璇峰弬瑙佺敤MySQL Connector/J寮鍙戝簲鐢ㄧ▼搴忥級銆
27.3.5.1.3:
闂锛
褰撴垜璇曞浘鍦↗ava绋嬪簭鎴栧簲鐢ㄧ▼搴忎腑浣跨敤MySQL Connector/J鏃讹紝閬囧埌绫讳技涓嬮潰鐨勫紓甯革細
SQLException: 鏃犳硶杩炴帴鍒癶ost:3306涓婄殑MySQL鏈嶅姟鍣ㄣ
鍦ㄤ綘灏濊瘯杩炴帴鐨勬満鍣紡绔彛涓婃槸鍚︽湁姝e湪杩愯鐨凪ySQL鏈嶅姟鍣紵
(java.security.AccessControlException)
SQLState: 08S01
VendorError: 0
鍥炵瓟锛
鎴栬鏄洜涓轰綘姝e湪杩愯Applet锛屼綘鐨凪ySQL鏈嶅姟鍣ㄦ槸閲囩敤鈥--skip-networking鈥濋夐」闆嗗畨瑁呯殑锛涙垨璁告槸鍥犱负MySQL鏈嶅姟鍣ㄤ綅浜庨槻鐏涔嬪悗銆
Applet浠呰兘浣跨綉缁滆繛鎺ヨ繑鍥炶繍琛學eb鏈嶅姟鍣ㄧ殑鏈哄櫒锛岃Web鏈嶅姟鍣ㄦ彁渚涗簡鐢ㄤ簬Applet鐨.class鏂囦欢銆傝繖鎰忓懗鐫锛岃鎯充娇鍏跺伐浣滐紝MySQL蹇呴』杩愯鍦ㄧ浉鍚岀殑鏈哄櫒涓婏紙鎴栧繀椤讳娇鏌愮被绔彛閲嶅畾鍚戯級銆傝繖杩樻剰鍛崇潃锛屼綘鏃犳硶閫氳繃浣犵殑鏈湴鏂囦欢绯荤粺鏉ユ祴璇旿ava绋嬪簭锛屼綘蹇呴』灏嗗畠浠斁鍦╓eb鏈嶅姟鍣ㄤ笂銆
MySQL Connector/J浠呰兘浣跨敤TCP/IP涓嶮ySQL杩涜閫氫俊锛岃繖鏄洜涓篔ava涓嶆敮鎸乁nix鍩熷鎺ュ瓧銆傚鏋淢ySQL鏄敤鈥--skip-networking鈥濇爣蹇楀惎鍔ㄧ殑锛屾垨閲囩敤浜嗛槻鐏锛孴CP/IP涓嶮ySQL鐨勯氫俊鍙兘浼氬彈鍒板奖鍝嶃
濡傛灉MySQL鏄敤鈥--skip-networking鈥濋夐」闆嗗惎鍔ㄧ殑锛堜緥濡侻ySQL鏈嶅姟鍣ㄧ殑Debian Linux鍖呭嵆鐢ㄤ簬璇ョ洰鐨勶級锛岄渶瑕佸湪鏂囦欢/etc/mysql/my.cnf鎴/etc/my.cnf涓皢鍏舵敞閲婃帀銆傚綋鐒讹紝my.cnf鏂囦欢涔熷彲鑳戒綅浜嶮ySQl鏈嶅姟鍣ㄧ殑鈥渄ata鈥濈洰褰曚笅鎴栧叾浠栧湴鏂癸紙鍙栧喅浜庣郴缁熶腑MySQL鐨勭紪璇戞柟寮忥級銆侻ySQL AB鍒涘缓鐨勪簩杩涘埗鏂囦欢鎬讳細鍦ㄦ煡鎵/etc/my.cnf鍜孾datadir]/my.cnf銆傚鏋滀负MySQL鏈嶅姟鍣ㄩ儴缃蹭簡闃茬伀澧欙紝闇瑕佸闃茬伀澧欒繘琛岄厤缃紝鍏佽浠庤繍琛孞ava浠g爜鐨勪富鏈哄湪MySQL鐩戝惉鐨勭鍙d笂锛堥粯璁や负3306锛夊缓绔嬩笌 MySQL鏈嶅姟鍣ㄧ殑TCP/IP杩炴帴銆
27.3.5.1.4:
闂锛
I鎴戠殑灏忔湇鍔$▼搴忥紡搴旂敤绋嬪簭鐧藉ぉ宸ヤ綔鑹ソ锛屼絾鍦ㄦ櫄涓婂嵈鍋滄宸ヤ綔銆
鍥炵瓟锛
涓嶅伐浣滄椂闂磋秴杩8灏忔椂鍚庯紝MySQL鍏抽棴浜嗚繛鎺ャ備綘鎴栬闇瑕佷娇鐢ㄨ兘澶勭悊澶辨晥杩炴帴鐨勮繛鎺ユ睜锛屾垨浣跨敤鈥渁utoReconnect鈥濆弬鏁帮紙璇峰弬瑙佺敤MySQL Connector/J寮鍙戝簲鐢ㄧ▼搴忥級銆
姝ゅ锛屼綘搴斿湪搴旂敤绋嬪簭涓繕鑾 SQLException骞跺鐞嗗畠浠紝鑰屼笉鏄湪搴旂敤绋嬪簭閫鍑哄墠涓鐩翠紶鎾畠浠紝杩欐槸1涓ソ鐨勭紪绋嬩範鎯傚湪鏌ヨ澶勭悊杩囩▼涓亣鍒扮綉缁滆繛閫氭ф柟闈㈢殑闂鏃讹紝MySQL Connector/J浼氬皢SQLState锛堝弬瑙丄PIDOCS涓殑java.sql.SQLException.getSQLState()锛夎缃负鈥08S01鈥濄傞殢鍚庯紝搴旂敤绋嬪簭浠g爜灏嗗皾璇曞啀娆¤繛鎺ュ埌MySQL銆
鍦ㄤ笅闈㈢殑绀轰緥锛坰implistic锛変腑锛岀粰鍑轰簡鑳藉澶勭悊杩欑被寮傚父鐨勪唬鐮侊細
绀轰緥26.13. 閲嶈瘯閫昏緫鐨勪簨鍔$ず渚
public void doBusinessOp() throws SQLException { Connection conn = null; Statement stmt = null; ResultSet rs = null; // // How many times do you want to retry the transaction // (or at least _getting_ a connection)? // int retryCount = 5; boolean transactionCompleted = false; do { try { conn = getConnection(); // assume getting this from a // javax.sql.DataSource, or the // java.sql.DriverManager conn.setAutoCommit(false); // // Okay, at this point, the 'retry-ability' of the // transaction really depends on your application logic, // whether or not you're using autocommit (in this case // not), and whether you're using transacational storage // engines // // For this example, we'll assume that it's _not_ safe // to retry the entire transaction, so we set retry count // to 0 at this point // // If you were using exclusively transaction-safe tables, // or your application could recover from a connection going // bad in the middle of an operation, then you would not // touch 'retryCount' here, and just let the loop repeat // until retryCount == 0. // retryCount = 0; stmt = conn.createStatement(); String query = "SELECT foo FROM bar ORDER BY baz"; rs = stmt.executeQuery(query); while (rs.next()) { } rs.close(); rs = null; stmt.close(); stmt = null; conn.commit(); conn.close(); conn = null; transactionCompleted = true; } catch (SQLException sqlEx) { // // The two SQL states that are 'retry-able' are 08S01 // for a communications error, and 41000 for deadlock. // // Only retry if the error was due to a stale connection, // communications problem or deadlock // String sqlState = sqlEx.getSQLState(); if ("08S01".equals(sqlState) || "41000".equals(sqlState)) { retryCount--; } else { retryCount = 0; } } finally { if (rs != null) { try { rs.close(); } catch (SQLException sqlEx) { // You'd probably want to log this . . . } } if (stmt != null) { try { stmt.close(); } catch (SQLException sqlEx) { // You'd probably want to log this as well . . . } } if (conn != null) { try { // // If we got here, and conn is not null, the // transaction should be rolled back, as not // all work has been done try { conn.rollback(); } finally { conn.close(); } } catch (SQLException sqlEx) { // // If we got an exception here, something // pretty serious is going on, so we better // pass it up the stack, rather than just // logging it. . . throw sqlEx; } } } } while (!transactionCompleted && (retryCount > 0)); }
27.3.5.1.5:
闂锛
鎴戞灏濊瘯浣跨敤JDBC-2.0鍙洿鏂扮粨鏋滈泦锛屼絾閬囧埌寮傚父锛岃鎴戠殑缁撴灉闆嗕笉鍙洿鏂般
鍥炵瓟锛
鐢变簬MySQL娌℃湁琛孖D锛孧ySQL Connector/J浠呰兘鏇存柊鏉ヨ嚜鏌ヨ涓斾綅浜庢湁鑷冲皯涓涓富閿殑琛ㄤ笂鐨勭粨鏋滈泦锛屾煡璇㈠繀椤婚夋嫨鎵鏈夌殑涓婚敭锛岃屼笖鏌ヨ鍗宠兘浣滅敤鍦1涓〃涓婏紙鍗充笉瀛樺湪鑱斿悎锛夈傚湪JDBC瑙勮寖涓粰鍑轰簡杩欐柟闈㈢殑浠嬬粛銆
濡傛灉鍙戠幇MySQL涓瓨鍦ㄦ晱鎰熺殑瀹夊叏缂洪櫡锛岃鍙戦佺數瀛愰偖浠惰嚦security@mysql.com銆
缂栧啓鑹ソ鐨勭己闄锋姤鍛婇渶瑕佽愬績锛屼絾鍦ㄧ1鏃堕棿姝g‘鍦板畬鎴愬畠涓嶄粎鑳借妭鐪佹垜浠殑鏃堕棿锛屼篃鑳借妭鐪佷綘鑷繁鐨勬椂闂淬傝壇濂界殑缂洪櫡鎶ュ憡搴斿寘鍚缂洪櫡鐨勫畬鏁存祴璇曟儏鍐碉紝浠ヤ究鎴戜滑浣犺兘澶熷湪涓嬩釜鐗堟湰涓洿姝h缂洪櫡銆
鏈妭浠嬬粛鐨勫唴瀹圭敤浜庡府鍔╀綘姝g‘鍦扮紪鍐欐姤鍛婏紝浠庨伩鍏嶅皢浣犵殑鏃堕棿娴垂鍦ㄥ鎴戜滑甯姪涓嶅ぇ鎴栨病鏈夊府鍔╃殑浜嬩笂锛
濡傛灉鏈1浠藉彲閲嶅鐨勭己闄锋姤鍛婏紝璇峰皢鍏舵彁浜ゅ埌缂洪櫡鏁版嵁搴擄紝http://bugs.mysql.com/銆
瀵逛簬浠讳綍鎴戜滑鑳藉啀鐜扮殑缂洪櫡锛屽湪涓嬩竴涓狹ySQL鐗堟湰涓慨姝e畠鐨勬満浼氬緢澶с
瑕佹兂閫氭姤鍏朵粬闂锛岃浣跨敤MySQL閭欢鍒楄〃銆
璇锋敞鎰忥紝鎴戜滑鍙兘浼氬鍖呭惈杩囧淇℃伅鐨勬秷鎭綔鍑哄搷搴旓紝浣嗕笉澶細瀵瑰寘鍚繃灏戜俊鎭殑娑堟伅浣滃嚭鍥炲簲銆備汉浠父浼氱渷鐣ユ帀涓浜涗簨瀹烇紝鍥犱负浠栦滑璁や负鑷繁鐭ラ亾浜嗘晠闅滅殑鍘熷洜锛屽苟鎯冲綋鐒跺湴璁や负杩欑被缁嗚妭鏃犲叧绱ц銆
鑹ソ鐨勫師鍒欐槸锛氬鏋滀綘瀵归檲杩版煇浜嬬姽璞笉瀹氾紝璇烽檲杩颁箣銆傚鏋滄垜浠姹備綘鎻愪緵鍒濆鎶ュ憡涓己灏戠殑淇℃伅锛屽湪鎶ュ憡涓紪鍐欏琛屼俊鎭簮姣旂瓑鍊欏洖澶嶈蹇紝楹荤儲涔熸洿灏忋
鍦ㄧ己闄锋姤鍛婏紝鏈甯哥姱鐨勯敊璇寘鎷細锛坅锛夋湭鍖呭惈鎵浣跨敤Connector/J鎴朚ySQL鐨勭増鏈彿锛屼互鍙婏紙b锛夋湭瀹屽叏鎻忚堪瀹夎浜咰onnector/J鐨勫钩鍙帮紙鍖呮嫭JVM鐗堟湰锛屽钩鍙扮被鍨嬶紝浠ュ強鎵瀹夎MySQL鏈韩鐨勭増鏈彿锛夈
杩欐槸楂樺害鐩稿叧鐨勪俊鎭紝濡傛灉娌℃湁瀹冿紝99锛呯殑缂洪櫡鎶ュ憡鏃犵敤銆傛垜浠亣鍒拌繖绫婚棶棰橈紝鈥滀负浣曞畠瀵规垜娌$敤鈥濓紵 闅忓悗锛屾垜浠彂鐜板湪璇ySQL鐗堟湰涓紝鎵璇锋眰鐨勭壒鎬у皻鏈疄鏂斤紝鎴栧湪杈冩柊鐨凪ySQL鐗堟湰涓凡鏇存浜嗘姤鍛婁腑鎻忚堪鐨勭己闄枫
鏈変簺鏃跺欙紝閿欒涓庡钩鍙扮浉鍏筹紝鍦ㄨ繖绫绘儏鍐典笅锛屽鏋滀笉鐭ラ亾鎿嶄綔绯荤粺鍜屽钩鍙扮殑鐗堟湰鍙凤紝鎴戜滑鍑犱箮涓嶅彲鑳芥洿姝d换浣曢棶棰樸
濡傛灉鍙兘锛屼綘搴斿垱寤1浠藉彲閲嶅鐨勩佷笉鍚换浣曠涓夋柟绫荤殑鐙珛娴嬭瘯妗堜緥銆
涓轰簡鏄杩涚▼娴佺嚎鍖栵紝鎴戜滑涓嶤onnector/J涓璧锋彁渚涗簡鐢ㄤ簬娴嬭瘯鐨勫熀鏈被锛屽悕涓com.mysql.jdbc.util.BaseBugReport銆瑕佹兂浣跨敤璇ョ被涓篊onnector/J鍒涘缓1涓祴璇曟渚嬶紝浣犲簲搴斿垱寤鸿嚜宸辩殑浠com.mysql.jdbc.util.BaseBugReport缁ф壙鐨勭被锛屽苟瑕嗙洊鏂规硶setUp()銆tearDown()鍜runTest()銆
鍦setUp()鏂规硶涓紝鍒涘缓鐢ㄤ簬鍒涘缓琛ㄧ殑浠g爜锛屽苟鐢ㄦ紨绀虹己闄锋墍闇鐨勬暟鎹~鍏呰〃銆
鍦runTest ()鏂规硶涓紝浣跨敤鍦ㄢ渟etUp鈥濇柟娉曚腑鍒涘缓鐨勮〃鍜屾暟鎹紝鍒涘缓鐢ㄤ簬婕旂ず缂洪櫡鐨勪唬鐮併
鍦tearDown()鏂规硶涓紝鎾ら攢鍦setUp()鏂规硶涓垱寤虹殑浠讳綍琛ㄣ
瀵逛簬涓婅堪涓夌鏂规硶涓殑浠讳綍涓绉嶏紝搴斾娇鐢getConnection ()鍚勭鍙樹綋涓殑涓绉嶅垱寤轰笌MySQL鐨凧DBC杩炴帴銆
路 getConnection()锛氭彁渚涗簡涓庡湪getUrl()涓寚瀹氱殑JDBC URL鐨勮繛鎺ャ傚鏋滆繛鎺ュ凡瀛樺湪锛岃繑鍥炶杩炴帴锛屽惁鍒欏皢鍒涘缓鏂扮殑杩炴帴銆
路 getNewConnection()锛氬鏋滈渶瑕佷负缂洪櫡鎶ュ憡鑾峰緱鏂扮殑杩炴帴锛堝嵆鍖呭惈1涓互涓婄殑杩炴帴锛夛紝搴斾娇鐢ㄥ畠銆
路 getConnection(String url)锛氫娇鐢ㄧ粰瀹氱殑URL杩斿洖杩炴帴銆
路 getConnection(String url, Properties props)锛氫娇鐢ㄧ粰瀹氱殑URL鍜屽睘鎬ц繑鍥炶繛鎺ャ
濡傛灉闇瑕佷娇鐢ㄤ笉鍚屼簬鈥渏dbc:mysql:///test鈥濈殑JDBC URL锛岃繕搴旇鐩栨柟娉getUrl()銆
鍦ㄦ紨绀轰綘鎵棰勮琛屼负鐨勬祴璇曟渚嬩腑锛堢浉瀵逛簬浣犺瀵熷埌鐨勪笘绾涓猴紝杩欐槸浣犲~鍏呴敊璇姤鍛婄殑鏈鍙兘鍘熷洜锛夛紝浣跨敤assertTrue(boolean expression)鍜assertTrue(String failureMessage, boolean expression)鏂规硶鍒涘缓蹇呴』婊¤冻鐨勬潯浠躲
鏈鍚庯紝鍒涘缓鐢ㄤ簬鍒涘缓娴嬭瘯妗堜緥瀹炰緥鐨main ()鏂规硶锛屽苟璋冪敤run鏂规硶锛
public static void main(String[] args) throws Exception {
new MyBugReport().run();
}
瀹屾垚浜嗘祴璇曟渚嬪苟璇佸疄瀹冭兘婕旂ず浣犳墍閫氭姤鐨勭己闄峰悗锛岃灏嗚妗堜緥涓庣己闄锋姤鍛婁竴璧蜂笂浼犲埌http://bugs.mysql.com/銆
# Changelog
# $Id: CHANGES,v 1.38.4.206 2005/05/12 15:25:54 mmatthews Exp $
05-17-05锛氱増鏈3.2.1-alpha
- 鐜板凡涓嶅啀閲嶈Autoreconnect鍔熻兘锛堝嵆autoReconnect=true锛夈
濡傛灉灏濊瘯骞朵娇鐢ㄥ畠灏嗘姏鍑哄紓甯革紝浣跨敤鈥渆nableDeprecatedAutoreconnect=true鈥濆彲缁х画浣跨敤autoReconnect銆備絾鏄紝鍦–onnector/J 3.3涓皢鍒犻櫎璇ラ」鐗规э紝璇峰弬瑙佹墜鍐屼腑鍏充簬涓嶉渶瑕佷娇鐢╝utoReconnect鐨勭浉搴旇В鍐虫柟妗堛
- 鐜板湪锛岄┍鍔ㄧ▼搴忓皢妫鏌ユ槸鍚﹁缃簡鏈嶅姟鍣ㄥ彉閲忊渋nit_connect鈥濓紝濡傛灉璁剧疆浜嗚鍙橀噺锛屽皢妫鏌utocommit锛堣嚜鍔ㄦ彁浜わ級璁剧疆锛屽苟搴旂敤瀹冦
- 濡傛灉杩炴帴鐨勬湇鍔″櫒鐗堟湰鍦5.0.x浠ヤ笂锛岃屼笖Statement.setFetchSize( > 0)锛岄┍鍔ㄧ▼搴忓皢灏濊瘯浣跨敤鏈嶅姟鍣ㄩ澶勭悊璇彞锛屽苟浣跨敤缁撴灉闆嗏渃ursors鈥濊幏鍙栬鍙ャ
- ServerPreparedStatements鐜板湪鑳芥纭湴灏咮LOB/CLOB鏁版嵁浠モ滄祦鏂瑰紡鈥濆彂閫佽嚦鏈嶅姟鍣ㄣ備綘鍙互浣跨敤灞炴р渂lobSendChunkSize鈥濋厤缃▼搴忓潡澶у皬鐨勯槇鍊硷紙榛樿鍊间负1MB锛夈
- 鏀寔sql妯″紡NO_BACKSLASH_ESCAPES浠ュ強闈炴湇鍔″櫒绔澶勭悊璇彞銆
12-23-04锛氱増鏈3.2.0-alpha
-鏇存浜咲atabaseMetaData.supportsCatalogIn*()閿欒鐨勮繑鍥炲笺
-浣跨敤ServerPreparedStatements浠ュ強MySQL 5.0鎴栨洿楂樼増鏈椂锛屾敮鎸佸熀浜庘渃ursor鈥濈殑缁撴灉闆嗐傜粨鏋滈泦闇涓衡滀粎姝e悜鈥濈粨鏋滈泦锛屽苟闇鍚敤閽堝璇ラ」鐗规х殑闈為浂鑾峰彇澶у皬銆
- 閲嶆柊鍒嗚В浜嗛澶勭悊璇彞鐨剋here閫昏緫锛屾湇鍔″櫒绔澶勭悊璇彞淇濇寔鏈夋晥銆
10-07-05锛氱増鏈3.1.11-stable
- 鏇存浜BUG#11629锛氬綋瀛楃缂栫爜鏄渦tf8鈥濇椂鎺у埗鍙颁笂鐨勪吉鈥!鈥濄
-鏇存浜嗕负涓㈠け鈥;鈥濓紙鐢ㄤ簬鈥減lain鈥濊鍙ワ級鐨勬祴璇曟渚嬬敓鎴愮殑璇彞銆
- 鏇存浜BUG#11663锛氫负鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ョ敓鎴愮殑涓嶆纭殑testcase鑴氭湰銆
-鏇存浜嗗洜淇ˉBUG#11552鑰屽鑷寸殑鍥炲綊锛屽浜BUG#11552锛屽綋鏁存暟澶勪簬姝e彿绫诲瀷鐨勮寖鍥村唴鏃讹紝瀵逛簬鏃犵鍙锋暣鏁帮紝璇ョ己闄峰皢瀵艰嚧椹卞姩绋嬪簭杩斿洖閿欒鍊笺
-灏嗘簮浠g爜绉诲埌浜唖vn repo銆
-鏇存浜BUG#11797锛氳浆涔夋爣蹇椾笉鑰冭檻鐢ㄤ簬杞箟鐢ㄩ旂殑灞傚寮忓崟寮曞彿銆
-浣跨敤鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ユ椂锛屼笉璇嗗埆GEOMETRY绫诲瀷銆
-鏇存浜BUG#11879锛歊eplicationConnection涓嶄細鍒囨崲鑷充粠杩炴帴锛屾姏鍑衡滅洰褰曚笉鑳戒负绌衡濆紓甯搞
-鏇存浜BUG#12218锛屼富杩炴帴鍜屽叿鏈夊鍒惰繛鎺ョ殑浠庤繛鎺ヤ箣闂村叡浜殑灞炴с
- 鏇存浜BUG#10630銆傚鏋滆鍙ュ凡鍏抽棴锛孲tatement.getWarnings()鏃犳硶涓嶯PE涓璧峰伐浣溿
-闇瑕佹椂锛屽湪PreparedStatement.ParseInfo()涓紝鍗宠兘浠嶴QL鑾峰彇char[]銆
-鏇存浜BUG#12104锛屾湇鍔″櫒绔澶勭悊璇彞涓嶈兘澶勭悊Geometry绫诲瀷銆
-鏇存浜BUG#11614锛屼娇鐢ㄥ瀛楄妭瀛楃缂栫爜鏃讹紝StringUtils.getBytes()涓嶅伐浣滐紝鍦ㄢ淿characters_鈥濅腑鎸囧畾浜嗛暱搴︺
-鏇存浜BUG#11798锛孭stmt.setObject(...., Types.BOOLEAN)鎶涘嚭寮傚父銆
-鏇存浜BUG#11976锛宮axPerformance.properties鎷奸敊鈥渆lideSetAutoCommits鈥濄
-鏇存浜BUG#11575锛屽浜庡湪Window骞冲彴涓婄殑鏈嶅姟鍣紝DBMD.storesLower/Mixed/UpperIdentifiers()閫氭姤涓嶆纭殑鍊笺
-鏇存浜BUG#11190锛屽湪ResultSet.moveToCurrentRow()涔嬪墠璋冪敤浜哛esultSet.moveToInsertRow()鏃讹紝ResultSet.moveToCurrentRow()涓嶈捣浣滅敤銆
-鏇存浜BUG#11115锛屼娇鐢ㄦ湇鍔″櫒绔澶勭悊璇彞鍜.setBytes()鏃讹紝VARBINARY鏁版嵁鍙戠敓宕╂簝銆
-鏇存浜BUG#12229锛屾湇鍔″櫒绔澶勭悊璇彞鎸傝捣explainSlowQueries銆
-鏇存浜BUG#11498锛岃浆涔夊鐞嗗櫒涓嶈冭檻鐢ㄥ弻寮曞彿鍒嗛殧鐨勫瓧绗︿覆銆
-瀵逛簬鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ワ紝澧炲姞浜嗗鏇存敼娴佸弬鏁扮殑闄愬埗銆傚彧瑕佸湪鎵ц鍓嶈缃簡鈥淿all_鈥濇祦鍙傛暟锛屽彲涓嶅繀璋冪敤.clearParameters()銆傦紙鐢变簬瀹㈡埛绔紡鏈嶅姟鍣ㄥ崗璁殑闄愬埗锛岄澶勭悊璇彞涓嶈兘澶嶄綅鏈嶅姟鍣ㄧ鐨勨淿individual_ stream鈥濇暟鎹級銆
-淇敼浜咶ield绫伙紝*Buffer鍜孧ysqlIO锛岃兘澶熻瘑鍒ぇ浜嶪nteger.MAX_VALUE鐨勫瓧娈甸暱搴︺
-鏇存柊浜咲BMD.supportsCorrelatedQueries()锛屽綋鐗堟湰楂樹簬4.1鏃惰繑鍥炩滅湡鈥濓紝鏇存柊浜唖upportsGroupByUnrelated()浣夸箣杩斿洖鈥滅湡鈥濓紝骞舵洿鏂颁簡getResultSetHoldability()浣夸箣杩斿洖HOLD_CURSORS_OVER_COMMIT銆
-鏇存浜BUG#12541锛孌atabaseMetaData.getIndexInfo()涓殑catalog锛堢洰褰曪級鍙傞噺澶勭悊锛屽畠涔熸剰鍛崇潃瀵笵atabaseMetaData涓笅杩版柟娉曠殑鏇存敼锛
- getBestRowIdentifier()
- getColumns()
- getCrossReference()
- getExportedKeys()
- getImportedKeys()
- getIndexInfo()
- getPrimaryKeys()
- getProcedures() (and thus indirectly getProcedureColumns())
- getTables()
涓婅堪鎵鏈夋柟娉曚腑鐨勨渃atalog鈥濆弬閲忕幇鍏锋湁涓嬭堪琛屼负鐗瑰緛锛
-濡傛灉鎸囧畾涓篘ull锛岃〃绀轰笉浼氫娇鐢╟atalog鏉ヨ繃婊ょ粨鏋滐紙鍥犳灏嗘悳绱㈡墍鏈夋暟鎹簱锛夛紝闄ら潪鍦↗DBC URL灞炴т腑璁剧疆浜嗏渘ullCatalogMeansCurrent=true鈥濄
-鎸囧畾涓衡溾濊〃绀哄綋鍓峜atalog锛屽敖绠″畠涓嶆槸鍗佸垎鍏煎JDBC瑙勮寖锛屼絾瀹冩槸涓轰紶缁熺敤鎴蜂繚鐣欑殑銆
-鎸囧畾catalog锛屼娇涔嬫寜API鏂囨。涓槓鏄庣殑鏂瑰紡宸ヤ綔銆
-浣垮緱jdbc2.optional杞欢鍖呬腑鐨勨滃皝瑁呪濊繛鎺ヨ兘澶熶娇鐢–onnection.clientPrepare()锛堜娇鐢–onnectionPoolDataSource瀹炰緥鍒涘缓杩炴帴锛夈
-涓哄鎴风澧炲姞浜咰onnection.isMasterConnection()锛屼互纭畾澶氫富鏈轰富锛忎粠杩炴帴鏄惁杩炴帴鑷冲垪琛ㄤ腑鐨勭1涓富鏈恒
-鏇存浜BUG#12753锛孶RL灞炴х敤浜庘=鈥濈殑鏍囧織浼氬鑷粹渟essionVariables=....鈥濇棤娉曟纭湴鍙傛暟鍖栥
-鏇存浜BUG#11781锛屽綋DatabaseMetaData鏂规硶浣跨敤璇ヤ俊鎭椂锛屾墍寮曠敤鐨勫閿俊鎭笉鑳借姝g‘瑙f瀽銆
-鑰冭檻鍒版祦缂撳啿鍖哄ぇ灏忓拰淇℃伅鍖呮姤澶达紝鈥渟endBlobChunkSize鈥濆睘鎬х幇鍦ㄤ笌鈥渕ax_allowed_packet鈥濆瘑鍒囩粨鍚堝湪涓璧凤紝褰搈ax_allowed_packet鐨勫ぇ灏忕被浼间簬榛樿鐨勨渟endBlobChunkSize鈥濇椂锛堜负1MB锛夛紝鑳介伩鍏峆acketTooBigExceptions銆
-CallableStatement.clearParameters()鐜拌兘娓呴櫎涓嶪NOUT/OUTPUT鍙傛暟鍜孖NPUT鍙傛暟鐩稿叧鐨勫睘鎬с
-鏇存浜BUG#12417锛孋onnection.prepareCall()鏄尯鍒嗗ぇ灏忓啓鐨勬暟鎹簱鍚嶇О锛堝湪Windows绯荤粺涓婏級銆
-鏇存浜BUG#12752锛屽浜庣増鏈珮浜4.0.x鐨勬湇鍔″櫒锛孋p1251涓嶆纭湴鏄犲皠鑷硍in1251銆
-鏇存浜BUG#12970锛屼娇鐢―atabaseMetaData.getColumns()鏃讹紝java.sql.Types.OTHER杩斿洖BINARY鍜孷ARBINARY鍒椼
-寮曠敤鍙傛暟绾︽潫鍒楄〃鍓嶏紝ServerPreparedStatement.getBinding()鐜板湪灏嗘鏌ヨ鍙ユ槸鍚﹀凡鍏抽棴锛屼互閬垮厤鎶涘嚭NullPointerException銆
-鏇存浜BUG#13277锛屾棤璁轰綍鏃讹紝褰撹皟鐢ㄩ渶瑕佽繛鎺ュ紩鐢ㄧ殑鏂规硶鏃讹紝鏉ヨ嚜Statement.getGeneratedKeys()鐨凴esultSetMetaData灏嗗鑷碞ullPointerExceptions鐨勬姏鍑恒
-鑷5.0璧凤紝Field绫籖esultSetMetaData.getColumnClassName()鍜孯esultSet.getObject(int)鐨勫弽鍚戠Щ妞嶅嚭鐜颁簡鍙樺寲锛屾洿姝d簡VARCHAR BINARY/VARBINARY鍜岀浉鍏崇被鍨嬫湁鍏崇殑琛屼负銆
-鏇存浜哊ullPointerException锛屽綋鍙傛暟涓篘ULL鏃讹紝鍦ㄥ緢澶欴atabaseMetaDataMethods涓皢鈥渃atalog鈥濆弬鏁拌浆鎹负byte[]鏃跺嚭鐜扮殑寮傚父锛堝浜庣粨鏋滈泦锛夈傦紙鏍规嵁JDBC瑙勮寖锛屼粠鎶鏈搴︿笂涓嶅厑璁糕渘ull鈥濓紝浣嗕粠鍘嗗彶瑙傜偣涓婏紝鎴戜滑鍏佽浣跨敤瀹冿級銆
-浠5.0璧凤紝VAR[BINARY|CHAR] [BINARY]绫诲瀷妫娴嬬殑鍙嶅悜绉绘銆
-鍗充娇鏃犳硶鎵撳紑鏈湴鏂囦欢锛屼篃鑳借鍙朚ysqlIO.sendFileToServer()涓搷搴旓紝鍚﹀垯锛屼笅涓涓彂鍑虹殑鏌ヨ灏嗗け璐ワ紝杩欐槸鍥犱负锛屽畠姝e湪璇诲彇瀵瑰彂閫佽嚦鏈嶅姟鍣ㄧ殑绌篖OAD DATA INFILE淇℃伅鍖呯殑鍝嶅簲銆
-閬垮紑浜BUG#13374锛屽凡鍏抽棴缁撴灉闆嗕笂鐨凴esultSet.getStatement()杩斿洖NULL锛堟寜鐓DBC 4.0瑙勮寖锛屼絾涓嶅叿鏈夊悜鍚庡吋瀹规э級銆傚皢杩炴帴灞炴р渞etainStatementAfterResultSetClose鈥濊涓衡滅湡鈥濓紝浠ヤ究鑳藉鍦ㄩ氳繃.getStatement()鍏抽棴浜嗙粨鏋滈泦鍚庢绱㈢粨鏋滈泦鐨勮鍙ワ紙榛樿涓衡滃亣鈥濅互渚夸笌JDBC鍏煎锛屽苟闄嶄綆浣跨敤JDBC鐨勪唬鐮佸悕娉勬紡璇彞瀹炰緥鐨勬満浼氾級銆
-鏇存浜BUG#13453锛孶RL閰嶇疆鍙傛暟涓嶅厑璁稿湪瀹冧滑鐨勫间腑浣跨敤鈥&鈥濇垨鈥=鈥濄傜幇鍦↗DBC椹卞姩绋嬪簭鑳藉瀵归厤缃弬鏁拌繘琛岀浉搴斿湴瑙f瀽锛屽氨鍍忓畠浠槸浣跨敤application/x-www-form-urlencoded鏍煎紡锛堝湪java.net.URLDecoder涓寚瀹氾紝http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLDecoder.html锛夎繘琛岀紪鐮侀偅鏍枫
濡傛灉鍦ㄩ厤缃睘鎬т腑鍑虹幇瀛楃鈥%鈥濓紝鐜板湪蹇呴』鐢ㄢ%25鈥濊〃绀猴紝瀹冩槸浣跨敤鈥渁pplication/x-www-form-urlencoded鈥濈紪鐮佷娇鈥%鈥濈殑宸茬紪鐮佸舰寮忋
-閰嶇疆灞炴р渟essionVariables鈥濈幇鍦ㄥ厑璁镐綘鎸囧畾浠モ淍鈥濈鍙峰紑濮嬬殑鍙橀噺銆
-鏇存浜BUG#13043锛屼负浣庝簬4.1.0鐗堢殑鏈嶅姟鍣ㄥ厑璁镐簡鈥済atherPerfMetrics鈥濇椂锛屽鏋滄煡璇㈡湭浣跨敤浠讳綍琛紝缁撴灉闆嗙殑鏋勯犲嚱鏁板皢鎶涘嚭NullPointerException銆
06-23-05锛氱増鏈3.1.10-stable
-鏇存浜嗗洜鏃犳寚瀹氭暟鎹簱鑰屽鑷寸殑MysqlIO.changeDatabaseTo()涓殑寮傚父銆
-棣栨瀹炵幇浜嗙敤浜嶱reparedStatement.getParameterMetadata()鐨凱arameterMetadata銆備粎鑳戒笌CallableStatements涓璧峰畬鍏ㄥ彂鎸ヤ綔鐢紝杩欐槸鍥犱负褰撳墠鐨勬湇鍔″櫒绔澶勭悊璇彞浼氬皢鎵鏈夊弬鏁拌繑鍥炰负VARCHAR绫诲瀷銆
06-22-05锛氱増鏈3.1.9-stable
-褰诲簳妫鏌ヤ簡瀛楃闆嗛厤缃紝鐜板湪鎵鏈夌浉鍏抽」鍧囪兘浣嶄簬灞炴ф枃浠朵腑銆
-濡傛灉鍦ㄧ敤浜嶹indows-31J鐨勬湇鍔″櫒涓婂彲鐢紝椹卞姩绋嬪簭鑳芥纭娇鐢–P932锛屼互鍙奀P932鍜孧S932 java缂栫爜鍚嶇О锛屽惁鍒欏皢姹傚姪浜庝粎涓鸿繎浼肩殑SJIS銆傜洰鍓嶏紝浠呭湪MySQL-5.0.3鍜屾洿楂樼増鏈笂锛堜互鍙奙ySQL-4.1.12/13锛屽彇鍐充簬浣曟椂鍙嶅悜绉绘瀛楃闆嗭級锛屾墠鑳藉彲闈犲湴鏀寔浠讳綍CP932鍙樹綋銆
-鏇存浜BUG#9064锛宑om.mysql.jdbc.PreparedStatement.ParseInfo瀵箃oCharArray()鐨勪笉蹇呰璋冪敤銆
-鏇存浜Bug#10144锛屽鏋渟erverPrepare()澶辫触锛孲erverPreparedStatement涓殑鍐呭瓨娉勬紡銆
-灏嗘竻鍗曟枃浠跺疄闄呭啓鍏ユ纭綅缃紝浠ヤ究鍏剁粓姝簬浜岃繘鍒秊ar鏂囦欢銆
-澧炲姞浜嗏渃reateDatabaseIfNotExist鈥濆睘鎬э紙榛樿涓衡滃亣鈥濓級锛岃灞炴т細浣块┍鍔ㄧ▼搴忚姹傛湇鍔″櫒鍒涘缓鍦║RL涓寚瀹氱殑鏁版嵁搴擄紙濡傛灉璇ユ暟鎹簱涓嶅瓨鍦ㄧ殑璇濓級銆傚繀椤绘嫢鏈夋伆褰撶殑鏁版嵁搴撳垱寤烘潈闄愭墠鑳芥墽琛岃浠诲姟銆
-鏇存浜BUG#10156锛屽浜嶳esultSet.getInt()锛屾棤绗﹀彿SMALLINT琚綋浣滃甫绗﹀彿绫诲瀷锛屾洿姝d簡鎵鏈夌殑UNSIGNED鏁存暟鍜屾湇鍔″櫒绔澶勭悊璇彞锛屼互鍙婄敤浜嶶NSIGNED TINYINT鐨凴esultSet.getObject()銆
-鏇存浜BUG#10155锛岃В鏋愬鎴风棰勫鐞嗚鍙ユ椂涓嶈兘璇嗗埆鍙屽紩鍙枫
-浣垮緱enableStreamingResults()鍦╟om.mysql.jdbc.jdbc2.optional.StatementWrapper涓婂彲瑙併
-浣垮緱ServerPreparedStatement.asSql()鑳芥纭伐浣滐紝鑷姩瑙i噴鍔熻兘鍙互涓庢湇鍔″櫒绔澶勭悊璇彞涓璧峰伐浣溿
-浣垮緱鍏煎JDBC2鐨勮蒋浠跺寘鎴愪负鍏叡鍖咃紝浠ヤ究鍏佽璁块棶鍘傚鎵╁睍銆
-鏁寸悊浜嗗墫鏋愬伐鍏蜂簨浠剁殑璁板綍鍔熻兘锛岀Щ鍔ㄤ簡浠g爜浠ュ皢鍓栨瀽宸ュ叿浜嬩欢杞偍涓篶om.mysql.jdbc.log.LogUtils鐨勫瓧绗︿覆锛屼互渚跨涓夋柟鑳藉浣跨敤瀹冦
- DatabaseMetaData.supportsMultipleOpenResults()鐜板湪杩斿洖鈥滅湡鈥濄侱BMD鍒氬垰涓㈠け鏌愪竴鍐呭鏃讹紝椹卞姩绋嬪簭鍦ㄤ竴娈垫椂闂村唴鏀寔瀹冦
-鏇存浜BUG#10310锛岄┍鍔ㄧ▼搴忎笉鏀寔鐢ㄦ潵璋冪敤瀛樺偍绋嬪簭鐨{?=CALL(...)}銆傚叾涓寘鎷紝涓篋atabaseMetaData.getProcedures()鍜実etProcedureColumns()澧炲姞浜嗗嚱鏁版绱㈡敮鎸併
-鏇存浜BUG#10485锛岀敤ResultSet.getString()妫绱EAR(2)鏃舵姏鍑篠QLException銆傜幇鍦紝椹卞姩绋嬪簭鎬绘槸灏哬EAR绫诲瀷褰撲綔java.sql.Dates瀵瑰緟锛屽苟涓篻etString()杩斿洖姝g‘鍊笺
鍙﹀锛屽彲浠ュ皢鈥測earIsDateType鈥濊繛鎺ュ睘鎬ц缃负鈥滃亣鈥濓紝骞跺皢鍊间綔涓篠HORT杩涜澶勭悊銆
-褰撯渢inyInt1isBit=true鈥濇椂锛堥粯璁わ級锛屼娇鐢ㄦ柊鐨勯厤缃睘鎬р渢ransformedBitIsBoolean鈥濓紙榛樿涓衡滃亣鈥濓級锛屽浜嶵INYINT(1)鍒楋紝杩斿洖鐨勬暟鎹被鍨嬪彲鍦═ypes.BOOLEAN鍜孴ypes.BIT涔嬮棿鍒囨崲銆傚鏋滆涓衡滃亣鈥濓紙榛樿锛夛紝瀵逛簬TINYINT(1)鍒楋紝DatabaseMetaData.getColumns()鍜孯esultSetMetaData.getColumnType()灏嗚繑鍥濼ypes.BOOLEAN銆傚鏋滀负鈥滅湡鈥濓紝灏嗚繑鍥濼ypes.BOOLEAN銆傛棤璁鸿閰嶇疆灞炴ф槸濡備綍璁剧疆鐨勶紝濡傛灉鍏佽浜嗏渢inyInt1isBit鈥濓紝鍏锋湁TINYINT(1)绫诲瀷鐨勫垪灏嗕綔涓篟esultSet.getObject(..)鐨刯ava.lang.Boolean瀹炰緥杩斿洖锛岃屼笖ResultSetMetaData.getColumnClassName()灏嗚繑鍥炩渏ava.lang.Boolean鈥濄
-鏇存浜BUG#10496锛屼笌cp932鎴杄ucjpms涓璧蜂娇鐢ㄢ渃haracterSetResults鈥濆睘鎬ф椂灏嗘姏鍑篠QLException銆
-閲嶇粍浜嗙洰褰曟牸灞锛屾簮鐮佺幇浣嶄簬鈥渟rc鈥濇枃浠跺す涓嬶紝鍒涘缓鏃朵笉濉厖鐖剁洰褰曪紝杈撳嚭浣嶄簬鈥./build鈥濅笅锛屽垎鍙戠増浣嶄簬鈥./dist鈥濅笅銆
-杩欑被鏀寔/缂洪櫡璺熻釜鐗规э紝灏嗏渁utoGenerateTestcaseScript鈥濊缃负鈥滅湡鈥濇椂锛岃鐗规ц兘澶熶负STDERR鐢熸垚.sql娴嬭瘯鑴氭湰銆
-鏇存浜BUG#10850锛屼娇鐢ㄦ湇鍔″櫒绔澶勭悊璇彞鏃讹紝涓嶄細灏嗏0闀垮害鈥濇祦鍙戦佺粰鏈嶅姟鍣ㄣ
-鐜板湪锛屽鏋滆缃簡鈥渃achePrepStmts=true鈥濓紝涔熶細浣胯繛鎺ヨ繘琛岄珮閫熺紦鍐叉搷浣滐紝妫鏌ラ┍鍔ㄧ▼搴忕殑鎵ц鎯呭喌锛屼互鍒ゆ柇棰勫鐞嗚鍙ユ槸鍚﹁兘澶熷湪鏈嶅姟鍣ㄧ宸ヤ綔锛屽苟鑳藉湪杩炴帴鐨勭敓鍛芥湡鍐呭鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ヨ繘琛岄珮閫熺紦鍐插鐞嗐備笌浠ュ線涓鏍凤紝鍙傛暟鈥減repStmtCacheSize鈥濊礋璐f帶鍒惰繖浜涢珮閫熺紦鍐插尯鐨勫ぇ灏忋
-杩涜浜嗗皾璇曪紝浠ユ洿涓轰紭缇庣殑鏂瑰紡澶勭悊OutOfMemoryErrors銆傚敖绠℃墍鑳戒綔鐨勪簨鎯呬笉鏄緢澶氾紝浣嗗湪澶у鏁版儏鍐典笅瀹冧滑鑳藉叧闂墍閬囧埌鐨勮繛鎺ワ紝杩欐牱锛岃繘涓姝ョ殑鎿嶄綔涓嶄細杩涘叆鐘舵佷笉鏄庣殑杩炴帴銆傚嚭鐜癘OM鏃讹紝杩炴帴涓婄殑浠讳綍杩涗竴姝ユ搷浣滃潎灏嗗け璐ワ紝鍚屾椂鎶涘嚭鈥滆繛鎺ュ凡鍏抽棴鈥濆紓甯革紝杩樺皢鍒楀嚭浣滀负闅愬紡杩炴帴鍏抽棴浜嬩欢鍘熷洜鐨凮OM寮傚父銆
-濡傛灉鏈姹傦紝鎵ц鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ユ椂涓嶅彂閫丆OM_RESET_STMT銆
-椹卞姩绋嬪簭灏嗘娴嬫槸鍚︽鍦ㄨ繍琛孧ySQL-5.0.7鎴栨洿楂樼増鏈紝鑰屼笖涓嶆壂鎻忔鍦ㄥ鐞嗙殑璇彞涓殑鈥淟IMIT ?[,?]鈥濓紝杩欐槸鍥犱负鐩墠鏈嶅姟鍣ㄦ敮鎸佽繖绫绘煡璇€
-鏇存浜BUG#11115锛屼娇鐢ㄦ湇鍔″櫒绔澶勭悊璇彞鍜孯esultSet.getBytes()鏃讹紝VARBINARY鏁版嵁鍙戠敓宕╂簝
-Connection.setCatalog()鎯冲湪鑳藉璇嗗埆鈥渦seLocalSessionState鈥濋厤缃睘鎬э紝灏嗚灞炴ц涓衡滅湡鈥濇椂锛屽鏋滄墍璇锋眰鐨刢atalog涓庡綋鍓峜atalog鐩稿悓锛屼細闃绘椹卞姩绋嬪簭灏嗏淯SE ...鈥濆彂閫佺粰鏈嶅姟鍣ㄣ
-澧炲姞浜嗕笅杩伴厤缃崋鍖咃紝閫氳繃鈥渦seConfigs鈥濋厤缃睘鎬т娇鐢1涓垨澶氫釜锛
* maxPerformance锛氳冭檻鍚庢灉鏃剁殑鏈澶фц兘
* solarisMaxPerformance锛歋olaris鐨勯渶鎬ц兘锛屽湪鍙兘鐨勬儏鍐典笅閬垮厤绯荤粺璋冪敤銆
* 3-0-Compat锛氫笌Connector/J 3.0.x鍔熻兘鍏煎銆
-澧炲姞浜嗏"maintainTimeStats鈥濋厤缃睘鎬э紙榛樿涓衡滅湡鈥濓級锛岀敤浜庨氱煡椹卞姩绋嬪簭鏄惁搴旇窡韪笂娆℃煡璇㈡椂闂达紝浠ュ強涓婃鎴愬姛灏嗕俊鎭寘鍙戦佸埌鏈嶅姟鍣ㄧ殑鏃堕棿銆傚鏋滃皢鍏惰缃负鈥滃亣鈥濓紝灏嗗垹闄ゆ瘡鏌ヨ鐨勪袱娆$郴缁熻皟鐢ㄣ
-鏇存浜BUG#11259锛宎utoReconnect鐨刾ing鎿嶄綔浼氬鑷磋繛鎺ュ惎鍔ㄦ椂鐨勫紓甯搞
-鏇存浜BUG#11360锛孋onnector/J灏嗘煡璇袱娆¤浆鍌ㄥ埌SQLException銆
-鏇存浜哖reparedStatement.setClob()锛屼笉鎺ュ彈Null浣滀负鍙傛暟銆
-鏇存浜BUG#11411锛岀敓浜у寘涓嶅寘鎷JBoss闆嗘垚绫汇
-鍒犻櫎浜嗕娇鐢ㄢ渦sage advisor鈥濇椂鏃犳剰涔夌殑鈥滃紑閿鏄傝吹鐨勭被鍨嬭浆鎹⑩濆憡璀︺
04-14-05锛氱増鏈3.1.8-stable
-鏇存浜咲atabaseMetaData.getTables()锛屾湭瑕佹眰鏃讹紝浠ヨ姹傝〃鐨勭被鍨嬩箣涓杩斿洖瑙嗗浘銆
-鍦5.0.3鍜屾洿楂樼増鏈殑MySQL涓紝澧炲姞浜嗗鏂扮簿搴︽暟瀛ECIMAL绫诲瀷鐨勬敮鎸併
-鏇存浜哛esultSet.getTime()锛屼綔鐢ㄤ簬鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ョ殑Null鍊间笂鏃舵姏鍑篘PE銆 -浣緾onnection.ping()鎴愪负public鏂规硶銆 -鏇存浜Bug#8868锛孌ATE_FORMAT()鏌ヨ浠巊etObject()杩斿洖BLOB銆 - ServerPreparedStatements鐜板湪鑳芥纭湴灏咮LOB/CLOB鏁版嵁浠モ滄祦鏂瑰紡鈥濆彂閫佽嚦鏈嶅姟鍣ㄣ備綘鍙互浣跨敤灞炴р渂lobSendChunkSize鈥濋厤缃▼搴忓潡澶у皬鐨勯槇鍊硷紙榛樿鍊间负1MB锛夈
-鐢熸垚棰勫鐞嗚鍙ユ椂锛孊lobFromLocator鐜板湪鑳戒娇鐢ㄦ纭殑ID寮曠敤銆
-浣跨敤杩炴帴灞炴р渟essionVariables鈥濈殑閫楀彿鍒嗛殧鍒楄〃鏂瑰紡浼犻掑畠浠紝鑳藉鍦ㄨ繛鎺ユ椂棰勫厛璁剧疆鏈嶅姟鍣ㄧ浼氳瘽鍙橀噺銆
-涓轰娇鐢ㄢ渁utoReconnect=true鈥濈殑鐢ㄦ埛鏇存浜唒ing()涓殑鍥炲綊闂銆
-鏇存浜BUG#9040锛孭reparedStatement.addBatch()涓嶈兘涓庢湇鍔″櫒绔澶勭悊璇彞鍜屾祦寮廈INARY鏁版嵁涓璧峰伐浣溿
-鏇存浜BUG#8800锛屽浜庤繍琛屼簬鍖哄垎澶у皬鍐欑殑鏂囦欢绯荤粺涓婄殑鏈嶅姟鍣紝DBMD.supportsMixedCase*Identifiers()杩斿洖閿欒鍊笺
-鏇存浜BUG#9206锛屽浜巆haracterSetResults閰嶇疆灞炴э紝涓嶈兘浣跨敤鈥淯TF-8鈥濄
-鏇存浜BUG#9236锛岃繛缁BUG#8868锛屽湪鏌ヨ涓娇鐢ㄤ簡澶氫釜鍑芥暟锛屾煡璇㈡湰搴旇繑鍥為潪瀛楃涓茬被鍨嬶紝浣嗗綋涓存椂琛ㄨВ鏋愬畠浠椂锛岃繑鍥炵被鍨嬬獊鐒跺彉涓洪毦浠ョ悊瑙g殑浜岃繘鍒跺瓧绗︿覆锛堥拡瀵规湇鍔″櫒闄愬埗閲囧彇浜嗙浉搴旂殑閬胯鎺柦锛夈傛澶栵紝杩樻洿姝d簡绫诲瀷涓篊HAR(n) CHARACTER SET BINARY鐨勫瓧娈碉紝浣垮叾鑳藉涓篟SMD.getColumnClassName()鍜孯esultSet.getObject()杩斿洖姝g‘锛忓尮閰嶇殑绫汇
-鏇存浜BUG#8792锛屽浜庘滀粎姝e悜/鍙鈥濈粨鏋滈泦锛堟垜浠敮鎸佽鏂瑰紡锛夛紝DBMD.supportsResultSetConcurrency()鏈繑鍥炩滅湡鈥濄
-鏇存浜BUG#8803锛岃闂椂锛孌BMD.getBestRowIdentifier()鐨勨淒ATA_TYPE鈥濆垪瀵艰嚧ArrayIndexOutOfBoundsException锛堜簨瀹炰笂锛屾湭杩斿洖浠讳綍鍊硷級銆
-妫鏌ヤ簡灏哻har/varchar鍒楁暟鎹浆鎹负鏁板兼椂鐨勭┖瀛楃涓('')锛屽鏋滈厤缃睘鎬р渆mptyStringsConvertToZero鈥濊璁句负鈥滃亣鈥濓紝鎶涘嚭寮傚父锛堜负浜嗕笌3.0鐗堢殑鍚戝悗鍏煎锛岄粯璁ゆ儏鍐典笅锛屽皢鍏惰涓衡滅湡鈥濓紝浣嗗湪3.2鐗堜腑锛屾渶鍙兘鐨勯粯璁よ缃负鈥滃亣鈥濓級銆
-鏇存浜BUG#9320锛屽湪鐗瑰畾鏉′欢涓嬶紝褰撴湭浣跨敤鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ユ椂锛孭reparedStatement.getMetaData()鍦ㄦ暟鎹簱涓彃鍏ヤ簡绌虹櫧琛屻
-Connection.canHandleAsPreparedStatement()鐜板湪灏嗗敖鈥滄渶澶у姫鍔涒濇潵璇嗗埆甯︽湁鍗犱綅绗︾殑LIMIT瀛愬彞锛岀洰鐨勫湪浜庯紝瀵逛簬鏈嶅姟鍣ㄧ洰鍓嶄笉鑳藉皢鍏跺綋浣滄湇鍔″櫒绔澶勭悊璇彞浜堜互澶勭悊鐨勮鍙ワ紝涓哄叾鐢熸垚澶勭悊鎺柦鏃讹紝鑾峰緱杈冨皯鐨勯敊璇偗瀹氱粨鏋溿
-鏇存浜哹uild.xml锛屽鏋渓og4j涓嶅彲鐢紝涓嶇紪璇憀og4j鏃ュ織鍔熻兘銆
-澧炲姞浜嗗c3p0杩炴帴姹犵殑锛http://c3p0.sf.net/锛夐獙璇/杩炴帴妫楠屽櫒鎺ュ彛鐨勬敮鎸侊紝濡傛灉鏈嶅姟鍣ㄥ彲鐢紝璇ユ楠屽櫒鎺ュ彛灏嗕娇鐢ㄨ交鍨嬧淐OM_PING鈥濊皟鐢ㄣ傝鎯充娇鐢ㄥ畠锛岃閰嶇疆c3p0杩炴帴鎸佺殑鈥渃onnectionTesterClassName鈥濆睘鎬э紝浠ヤ娇鐢ㄢ渃om.mysql.jdbc.integration.c3p0.MysqlConnectionTester鈥濄
-鏇村ソ鐨勬娴嬪紩鐢ㄥ瓧绗︿覆鐨勫唴澶朙IMIT锛屼互渚块┍鍔ㄧ▼搴忚兘鏇村姞姝g‘鍦板垽鏂槸鍚﹀彲浠ュ湪鏈嶅姟鍣ㄤ笂澶勭悊棰勫鐞嗚鍙ャ
-鏇存浜BUG#9319锛屽綋椹卞姩绋嬪簭璇曞浘纭畾鍙傛暟璁℃暟/绫诲瀷鏃讹紝鍒嗕笉娓呬笉鍚屾暟鎹簱涓叿鏈夌浉鍚屽悕绉扮殑瀛樺偍绋嬪簭銆
-涓篟esultSet鍜孲tatement瀹炴柦澧炲姞浜嗘渶缁堢‘瀹氬櫒锛屼互渚夸笌JDBC瑙勮寖鍏煎锛岃瑙勮寖瑕佹眰锛屽鏋滃畠浠湭鏄庣‘鍏抽棴锛屽湪鏃犵敤鍗曞厓鏀堕泦闃舵搴斿叧闂繖浜涜祫婧愩
-鏇存浜BUG#9682锛屽浜庡叿鏈塂ECIMAL鍙傛暟鍜屽瓨鍌ㄨ姹傜殑瀛樺偍绋嬪簭锛屽鏋滃寘鍚,鈥濓紝灏嗗け璐ャ
- PreparedStatement.setObject(int, Object, int type, int scale)鐜板湪鑳戒娇鐢ㄩ拡瀵笲igDecimal瀹炰緥鐨勬爣搴﹀笺
-鏇存浜BUG#9704锛屽綋宸叉湁缁撴灉闆嗘槸.close()d鏃讹紝Statement.getMoreResults()鍙兘鎶涘嚭NPE銆
-鎬ц兘搴﹂噺鐗规х幇鑳芥敹闆嗗叧浜嶴ELECT涓紩鐢ㄧ殑琛ㄦ暟閲忕殑淇℃伅銆
-鐜板湪鑳藉鑷姩閰嶇疆鏃ュ織绯荤粺銆傚鏋滅敤鎴烽氳繃URL灞炴р渓ogger鈥濇垨绯荤粺灞炴р渃om.mysql.jdbc.logger鈥濊缃簡鍊硷紝閭d箞灏嗕娇鐢ㄧ敤鎴风殑璁剧疆锛屽惁鍒欏皢閲囩敤涓嬭堪姝ラ鑷姩妫娴嬭缃細
濡傛灉Log4j鍙敤锛屽皢浣跨敤瀹冿紝鎺ヤ笅鏉ユ槸JDK1.4鏃ュ織鍔熻兘锛屽啀鎺ヤ笅鏉ユ槸STDERR鏃ュ織鍔熻兘銆
-鏇存浜BUG#9778锛屽嵆浣挎暟鎹簱鐗堟湰涓嶆敮鎸佽鍥撅紝濡傛灉璇锋眰浜嗚鍥撅紝DBMD.getTables()涓嶅簲杩斿洖琛ㄣ
-鏇存浜嗛┍鍔ㄧ▼搴忥紝褰撳湪鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ヨ繑鍥炵殑缁撴灉闆嗕笂璋冪敤浜哛esultSet.getBoolean()鏃讹紝瀵逛簬鈥-1鈥濅笉杩斿洖鈥滅湡鈥濄
-涓.jar鏂囦欢澧炲姞浜哅anifest.MF鏂囦欢浠ュ強瀹炴柦淇℃伅銆
-鍦‵ield.isOpaqueBinary()涓彁渚涗簡鏇村娴嬭瘯锛屼互璇嗗埆鏅︽订鐨勪簩杩涘埗瀛楁锛堝嵆鍏锋湁CHAR(n)鍜孋HARACTER SET BINARY绫诲瀷鐨勫瓧娈碉級锛岃繖绫诲瓧娈垫潵鑷悇绉嶆爣閲忓嚱鏁板拰鑱氬悎鍑芥暟锛堣繑鍥炲瓧绗︿覆锛夌殑杈撳嚭銆
-鏇存浜BUG#9917锛屽嚭浜庝紶缁熸柟闈㈢殑鑰冭檻锛屽嵆浣垮畠涓嶫DBC涓嶅吋瀹癸紝涔熷簲鎺ュ彈DBMD鏂规硶涓敤浜巆atalog锛堜娇鐢ㄥ綋鍓嶅硷級鐨凬ull銆傚皢杩炴帴灞炴р渘ullCatalogMeansCurrent鈥濊缃负鈥滃亣鈥濆彲绂佹瀹冿紙鍦–/J 3.2.x涓紝瀹冩槸榛樿璁剧疆锛夈
-鏇存浜BUG#9769锛屽嚭浜庝紶缁熸柟闈㈢殑鑰冭檻锛屽嵆浣垮畠涓嶫DBC涓嶅吋瀹癸紝涔熷簲鎺ュ彈DBMD涓敤浜庡悕绉帮紙鈥%鈥濓級鐨凬ull銆傚皢杩炴帴灞炴р渘ullNamePatternMatchesAll鈥濊缃负鈥滃亣鈥濆彲绂佹瀹冿紙鍦–/J 3.2.x涓紝瀹冩槸榛樿璁剧疆锛夈
02-18-05锛氱増鏈3.1.7-stable
-鏇存浜BUG#7686锛孴imestamp鍏抽敭瀛楀垪鏁版嵁闇瑕佸垎绂荤殑鈥淿binary鈥濓紝鐢ㄤ簬UpdatableResultSet.refreshRow()銆
-鏇存浜BUG#7715锛屽浜庢湇鍔″櫒绔澶勭悊璇彞鍜屽彲鏇存柊缁撴灉闆嗭紝Timestamps閿欒鍦拌浆鎹负瀛楃涓层
-妫娴嬪瓧绗︿覆琛ㄥ崟锛堜互鍓嶄负鏁存暟锛変腑鐨剆ql_mode鍙橀噺锛屽苟鎭板綋璋冩暣瀛楃涓茬殑寮曠敤鏂规硶銆
-澧炲姞浜嗏渉oldResultsOpenOverStatementClose鈥濆睘鎬э紙榛樿涓衡滃亣鈥濓級锛屽畠鑳藉皢statement.close()鐨勭粨鏋滈泦淇濇寔鎵撳紑鐘舵侊紝鎴栨墽琛岀浉鍚岃鍙ワ紙鐢盞evin Burton鎺ㄨ崘锛夈
-鏇存浜BUG#7952锛屽湪鏁呴殰鍒囨崲閰嶇疆涓嬪洖閫鑷充富杩炴帴鏃剁殑鏃犻檺閫掑綊銆
-濡傛灉鍏佽浜嗛珮閫熺紦鍐诧紝灏嗙姝4.1.10鐗堜箣鍓峂ySQL-4.1鐗堟湰鐨勫璇彞鍔熻兘锛堝鏋滀互鍏佽鐨勮瘽锛夛紝杩欐槸鍥犱负鍦ㄨ閰嶇疆涓嬶紝鏈嶅姟鍣ㄤ細杩斿洖閿欒鐨勭粨鏋溿
-鏇存浜哻onfigureClientCharset()涓殑閲嶅浠g爜锛岃绫讳唬鐮佸皢闃绘useOldUTF8Behavior=true鐨勬伆褰撹繍琛屻
-鍒犻櫎浜嗏渄ontUnpackBinaryResults鈥濆姛鑳斤紝鐜板湪锛岄┍鍔ㄧ▼搴忓皢鎸夊師鏍蜂繚瀛樻潵鑷湇鍔″櫒绔澶勭悊璇彞鐨勭粨鏋滐紙涓庢湇鍔″櫒鎻愪緵鐨勭浉鍚岋紝骞跺湪闇瑕佹椂灞曞紑锛夈
-鏇存浜BUG#8096锛屼娇鐢ㄦ湇鍔″櫒绔澶勭悊璇彞鏃讹紝妯℃嫙瀹氫綅鍣ㄧ牬鍧忎簡浜岃繘鍒舵暟鎹
-鏇存浜哠erverPreparedStatement.serverPrepare()鐨勫悓姝ヤ簨瀹滐紝濡傛灉鍦ㄥ涓嚎绋嬮棿鍏变韩杩炴帴锛屽彲鑳戒細瀵艰嚧姝婚攣/宕╂簝銆
-榛樿鎯呭喌涓嬶紝椹卞姩绋嬪簭鑳介氳繃鍚勭Connection.prepareStatement()鐨勫悇绉嶅彉浣撴壂鎻廠QL锛屼互鍒ゆ柇瀹冩槸鍚︽槸鑳藉鍦ㄦ湇鍔″櫒绔敮鎸佺殑璇彞绫诲瀷锛屽鏋滀笉琚湇鍔″櫒绔敮鎸侊紝浼氬皢鍏朵綔涓哄鎴风妯℃嫙棰勫鐞嗚鍙ヨ繘琛屽鐞嗭紙BUG#4718)锛夈涔熷彲浠ラ氳繃鍦↗DBC URL涓紶閫掆emulateUnsupportedPstmts=false鈥濈姝㈣鐗规с
-浠嶤allableStatement涓垹闄や簡鐢ㄤ綔杈撳叆锛忚緭鍑哄弬鏁扮殑鈥淿binary鈥濆紩浠嬭瘝銆
-瀵逛簬娉ㄥ唽涓*BINARY鐨勮緭鍑哄弬鏁帮紝鎬昏繑鍥瀊yte[]銆
-瀵逛簬PreparedStatement.setObject(n, "true", Types.BIT)锛屽皢甯冨皵鈥淭rue鈥濈殑姝g‘鍊煎彂閫佺粰鏈嶅姟鍣ㄣ
-鏇存浜嗕笌杩炴帴鏈夊叧鐨勭己闄凤紝褰撹鍙ヤ笉鏄湇鍔″櫒绔澶勭悊璇彞鏃讹紝鏃犳硶瀵规潵鑷猵repareStatement()鐨勮鍙ヨ繘琛岄珮閫熺紦鍐插鐞嗐
-浣跨敤ResultSet.get(..., cal)鍜孭reparedStatement.set(...., cal)鏃讹紝濡傛灉瀹㈡埛绔拰鏈嶅姟鍣ㄥ潎浣嶄簬GMT锛堟牸鏋楀▉娌绘爣鍑嗘椂闂达級鏃跺尯锛岄夋嫨杩涜鏃堕棿璋冩暣鐨勬纭柟鍚戙
-澧炲姞浜嗏渄ontTrackOpenResources鈥濋夐」锛堥粯璁や负鈥滃亣鈥濅互渚垮吋瀹笿DBC锛夛紝瀵逛簬鍏锋湁涓嶈壇鐗规х殑搴旂敤绋嬪簭锛堜緥濡傚簲鍏抽棴璇彞鏃讹紝鍗存湭鍏抽棴璇彞鐨勫簲鐢ㄧ▼搴忥級锛屽畠鏈夊姪浜庢敼鍠勫唴瀛樼殑浣跨敤銆
-鏇存浜BUG#8428锛孯esultSet.getString()涓嶈兘淇濇寔瀛樺偍鍦ㄦ湇鍔″櫒涓婄殑鏍煎紡锛屼粎褰撳皢鈥渘oDatetimeStringSync鈥濆睘鎬ц缃负鈥滅湡鈥濓紙榛樿涓衡滃亣鈥濓級鏃讹紝鎵嶈兘鍏佽缂洪櫡鏇存銆
-鏇存浜嗕娇鐢ㄢ渦sage advisor鈥濊屼笖缁撴灉闆嗗凡鍏抽棴鏃禦esultSet.realClose()涓殑NPE銆
-鏇存浜BUG#8487锛屼笉鍒涘缓娴佸紡缁撴灉闆嗙殑PreparedStatements銆
-涓嶅皢NULL浼犵粰缁橰esultSet.getNativeConvertToString()涓殑String.valueOf()锛屽師鍥犲湪浜嶴tring.valueOf()浼氬鍏惰繘琛屽瓧绗︿覆澶勭悊锛堝嵆杩斿洖鈥渘ull鈥濓級,瀵逛簬鎵杩版柟娉曪紝杩欐槸閿欒鐨勩
-鏇存浜BUG#8484锛屽綋闇瑕佽垗鍏ユ搷浣滀互璁惧畾鏍囧害鏃讹紝ResultSet.getBigDecimal()鎶涘嚭寮傚父銆傚鏋滈潪鑸嶅叆鎬igDecimal.setScale()澶辫触锛岄┍鍔ㄧ▼搴忕幇鍦ㄥ皢閫夋嫨鈥滃崐鍚戜笂鈥濊垗鍏ユā寮忋
-澧炲姞浜嗏渦seLocalSessionState鈥濋厤缃睘鎬э紝灏嗗叾璁剧疆涓衡滅湡鈥濇椂锛孞DBC椹卞姩绋嬪簭灏嗚涓哄簲鐢ㄧ▼搴忚涓鸿壇濂斤紝骞朵細浣跨敤java.sql.Connection鎻愪緵鐨勬柟娉曚粎璁剧疆autocommit鍜屼簨鍔¢殧绂荤骇鍒紝鍥犳锛岃兘澶熷湪澶у鏁版儏鍐典笅澶勭悊杩欎簺鍊硷紝鑰屼笉寮曞彂鏁版嵁搴撴湇鍔″櫒寰幆銆
-涓鸿繛鎺ユ睜瀹炴柦瀹炰緥鐨勮鍙ュ鍔犱簡enableStreamingResults()锛屽彲妫鏌tatement.setFetchSize()鏄惁瀛樺湪鍏煎瑙勮寖鐨勫笺傝皟鐢ㄢ淪tatement.setFetchSize(>=0)鈥濆彲绂佹鍏充簬璇ヨ鍙ョ殑娴佸紡缁撴灉銆
-澧炲姞浜嗗MySQL-5.0.3涓瑽IT绫诲瀷鐨勬敮鎸併傞┍鍔ㄧ▼搴忎細灏咮IT(1-8)褰撲綔JDBC鐨凚IT绫诲瀷瀵瑰緟锛堟槧灏勮嚦java.lang.Boolean锛夛紝杩欐槸鍥犱负褰撳0鏄庝簡鈥< 9 bits鈥)鏃讹紝鏈嶅姟鍣ㄧ洰鍓嶄笉浼氬彂閫佽兘纭畾姣旂壒瀛楁锛坆itfield锛夊ぇ灏忕殑瓒冲淇℃伅銆侭IT(>9)灏嗚褰撲綔VARBINARY瀵瑰緟锛屽苟褰撹皟鐢╣etObject()鏃惰繑鍥瀊yte[]銆
12-23-04锛氱増鏈3.1.6-stable
-鏇存浜哠ocketInputStream.read()鐨勬寕璧烽棶棰橈紝褰撻┍鍔ㄧ▼搴忓繀椤荤洿鎺ユ埅鍙栫粨鏋滈泦锛岃屼笉鏄窡韪粨鏋滈泦鏈熬鐨勨淟IMIT n鈥濇椂锛屼笌Statement.setMaxRows()鍜屽涓粨鏋滈泦涓璧蜂娇鐢ㄦ椂SocketInputStream.read()鎸傝捣銆
-鏇存浜BUG#7026锛孌BMD.getProcedures()涓嶈冭檻catalog鍙傛暟銆
12-02-04锛氱増鏈3.1.5-gamma
-鏇存浜嗗瓧绗︿覆甯告暟鍜屽姩鎬佸瓧绗︿覆涔嬮棿鐨勬瘮杈冧簨瀹滐紝鎴栨槸toUpperCase()d鎴栨槸toLowerCase()d锛屼互浣跨敤Locale.ENGLISH锛屽皢鍏剁敤浣滆嫳璇殑瑕嗙洊瑙勫垯銆傛澶栵紝杩樹娇鐢⊿tringUtils.indexOfIgnoreCase()鏇夸唬浜.toUpperCase().indexOf()锛屼互閬垮厤鍒涘缓寰堢煭鐨勮繃娓℃у瓧绗︿覆瀹炰緥銆
-鏇存浜BUG#5235锛屾湇鍔″櫒绔澶勭悊璇彞涓嶈冭檻鈥渮eroDateTimeBehavior鈥濆睘鎬э紝鑰屼笖褰撲娇鐢≧esultSet.getObject()鏃朵細瀵艰嚧绫绘姏寮冨紓甯革紝杩欐槸鍥犱负鎬昏繑鍥炲叏0瀛楃涓层
-鏇存浜嗘壒鏇存柊鍜屾湇鍔″櫒棰勫鐞嗚鍙ユ湁鍏崇殑闂锛屼笌浠ュ墠鐨勯泦鍚堢浉姣旓紝濡傛灉鍦ㄧ粰瀹氱殑鎵瑰弬鏁伴泦鍚堜腑鍙戠敓浜嗙被鍨嬪彉鏇达紝鏈嶅姟鍣ㄩ澶勭悊璇彞涓嶄細妫娴嬭繖绫诲彉鍖栵紝浠庤屽鑷存湇鍔″櫒杩斿洖閿欒鈥淲rong arguments to mysql_stmt_execute()鈥濄
-瑙e喅浜嗗綋鏃堕棿鎴崇殑瀛楃涓茶〃绀哄寘鍚悗缂鈥.鈥濅絾鍏跺悗娌℃湁鏁板瓧鏃剁殑鎯呭喌銆
-鏇存浜BUG#5706锛屽ResultSet.getNativeString()涓互鍓嶅瓨鍦ㄥ瓧绗︿覆瀹炰緥鐨勪綆鏁堟娴嬨
-涓嶆姏鍑洪拡瀵笴onnection.releaseSavepoint()鐨勫紓甯搞
-瑙g爜鏉ヨ嚜ServerPreparedStatements鐨勬棩鏈熸椂锛岄粯璁ゆ儏鍐典笅浣跨敤鎸変細璇濊繘琛岀殑鏃ュ巻瀹炰緥锛堥氳繃璁剧疆鈥渄ynamicCalendars=true鈥濓紝璁剧疆涓烘棭鏈熺殑鎬ц兘杈冧綆鐨勬柟寮忥級銆
-澧炲姞浜嗗疄楠屾ч厤缃睘鎬р渄ontUnpackBinaryResults鈥濓紝瀹冨欢杩熶簡瑙e寘浜岃繘鍒剁粨鏋滈泦鍙栧肩殑鍔熻兘锛岀洿鑷宠姹備簡瀹冧滑涓烘锛堥粯璁ゆ儏鍐典笅璁句负鈥滃亣鈥濓級銆傚浜庢煇浜泆secase/jvm缁勫悎锛屽畠瀵规棤鐢ㄤ俊鎭敹闆嗗櫒鏇村弸濂姐
-鏇存浜BUG#5729锛屽鏉ヨ嚜鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ョ粨鏋滈泦鐨刄NSIGNED BIGINT锛屾湭鑳芥纭В鍖呫
-鏇存浜BUG#6225锛孲erverSidePreparedStatement锛屽垎閰嶄簡涓嶅繀瑕佺殑鍏锋湁鐭敓瀛樻椂闂寸殑瀵硅薄銆
-鍒犻櫎浜哛esultSet鏋勯犲嚱鏁颁腑鏈夊鐨勬柊Throwable()锛屽師鍥犲湪浜庝笉鑹悎骞讹紙瀵艰嚧浠讳綍鎵鍒涘缓缁撴灉闆嗘案杩滀笉浼氫娇鐢ㄧ殑鏂板璞★級锛屽垎鏋BUG#6359鏃跺彂鐜般
-鏇存浜嗗湪EscapeProcessor.escapeSQL()涓繃鏃╁垱寤篠tringBuffer鐨勯棶棰橈紝鑰屼笖鍦ㄤ笉闇瑕佽浆涔夊姛鑳芥椂浠嶈繑鍥炲瓧绗︿覆锛堥槻姝笉蹇呰鐨勫璞″垎閰嶏級銆傚垎鏋BUG#6359鏃跺彂鐜般
-涓哄彲鏇存柊缁撴灉闆嗕腑鐨勯敭姣旇緝浣跨敤鈥渘ull-safe-equals鈥濄
-鏇存浜BUG#6537锛屽鏋滈渶瑕0濉厖锛屼綔鐢ㄥ湪Decimal涓婄殑SUM()浠ュ強鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ュ潎灏嗗拷鐣ユ爣搴︼紙鐢变簬鏈嶅姟鍣ㄥ皢鍏惰浆鎹负DOUBLE锛0濉厖灏嗙粨鏉燂紝灏嗗叾杞崲涓築igDecimal绫诲瀷鐨勫瓧绗︿覆杩涜瑙f瀽鏃讹紝涓㈠け鎵鏈夌殑濉厖鈥0鈥濓級銆
-鍒涘缓DBMD鏌ヨ鏃朵娇鐢―atabaseMetaData.getIdentifierQuoteString()銆
-濡傛灉鍦ㄦ湇鍔″櫒涓奓OAD DATA LOCAL INFILE灏忎簬鈥渕ax_allowed_packet鈥濓紝浣跨敤1MB鐨勪俊鎭寘鍙戦佹枃浠躲
-鏇存浜BUG#6399锛屽浜庡瀛楄妭瀛楃闆嗭紝ResultSetMetaData.getColumnDisplaySize()杩斿洖閿欒鍊笺
-閫氳繃鈥渁utoDeserialize鈥濆睘鎬э紙榛樿涓衡滃亣鈥濓級锛岃兘澶熷淇濆瓨鍦˙LOB涓殑java.lang.Objects鐨勮嚜鍔ㄤ覆骞惰浆鎹㈠姛鑳借繘琛岄厤缃
-淇敼浜咶ield.isOpaqueBinary()浠ユ娴嬧淐HAR(n) CHARACTER SET BINARY鈥濓紝浠庤岃兘澶熸敮鎸佺敤浜嶳esultSet.getObject()鐨勫浐瀹氶暱搴︿簩杩涘埗瀛楁銆
-浣跨敤鎴戜滑鑷繁鐨勭紦鍐茶緭鍏ユ祦瀹炴柦鏂瑰紡鏉ュ鐞唈ava.io.BufferedInputStream鐨勫皝闂涓恒備娇鐢ㄢ渦seReadAheadInput=false鈥濆彲绂佹瀹冦
-鏇存浜BUG#6348锛屽綋缁欏畾涓绘満鍚嶇殑鏌愪竴鍦板潃鏄疘PV6鏃舵棤娉曡繛鎺ュ埌鏈嶅姟鍣紙鏈嶅姟鍣ㄥ皻鏈笌IPV6鎹嗙粦锛 椹卞姩绋嬪簭鐜板湪鑳藉鏌ユ壘缁欏畾涓绘満鐨勬墍鏈塈P鍦板潃锛屽苟鍋滃湪鎺ュ彈socket.connect()鐨勭1涓湴鍧涓娿
09-04-04锛氱増鏈3.1.4-beta
-鏇存浜BUG#4510锛孋onnector/j 3.1.3 beta涓嶈兘姝g‘澶勭悊鏁存暟锛堢敱涓轰簡鏀寔Buffer.readInt() -> Buffer.readShort()涓殑鏃犵鍙疯鍙栨搷浣滄墍浣滅殑鏇存敼鑰屽鑷达級銆
-鍦―atabaseMetaData.getTables()鍜実etTableTypes()涓鍔犱簡瀵筕IEW鐨勬敮鎸侊紝璇ョ被鐗规х幇宸插湪MySQL鏈嶅姟鍣5.0.x鐗堜腑鎻愪緵銆
-鏇存浜BUG#4642锛岃В鍖呭瓧娈靛厓鏁版嵁鏃讹紝ServerPreparedStatement.execute*()鏈夋椂浼氭姏鍑篈rrayIndexOutOfBoundsException銆
-浼樺寲浜嗘暣鏁拌В鏋愬姛鑳斤紝閫氳繃鈥渦seFastIntParsing=false鈥濆睘鎬э紝鍏佽浣跨敤JDK绫昏緝鎱㈢殑瑙f瀽鍔熻兘銆
-澧炲姞浜嗏渦seOnlyServerErrorMessages鈥濆睘鎬э紝瀹冧細浣挎湇鍔″櫒鐢熸垚鐨勫紓甯镐腑鐨勬秷鎭枃鏈粎鍖呭惈鐢辨湇鍔″櫒鍙戦佺殑鏂囨湰锛堜笌SQLState鈥滄爣鍑嗏濅粙缁嶄腑缁欏嚭鐨勭浉鍙嶏紝姝ゆ椂鏂囨湰鍚庨潰杩樺寘鎷湇鍔″櫒鐨勯敊璇秷鎭級銆傞粯璁ゆ儏鍐典笅锛岃灞炴ц璁剧疆涓衡滅湡鈥濄
-鏇存浜BUG#4689锛屽鏋滃墠闈㈢殑Null宸茶杩斿洖锛屽浜庡師璇紝ResultSet.wasNull()涓嶅伐浣溿
-濡傛灉鈥渆nablePacketDebug=true鈥濓紝璺熻釜淇℃伅鍖呯殑搴忓垪鍙凤紝濡傛灉鏀跺埌鐨勪俊鎭寘娆″簭娣蜂贡锛屾姏鍑哄紓甯搞
-鏇存浜BUG#4482锛屼娇鐢ㄩ澶勭悊璇彞鏃讹紝瀵逛簬瀛楃涓诧紝ResultSet.getObject()杩斿洖閿欒绫诲瀷銆
-涓ゆ璋冪敤MysqlPooledConnection.close()锛堣櫧鐒朵篃鏄簲鐢ㄧ▼搴忛敊璇級浼氬鑷碞PE銆傚凡鏇存銆
-鏇存浜BUG#5012锛屽鐞咲ECIMAL绫诲瀷鐨勮繑鍥炲肩殑ServerPreparedStatements涓嶅伐浣溿
-鏇存浜BUG#5032锛屽浜庢潵鑷4.1.x鐗堥澶勭悊璇彞鐨勪吉浣嶇被鍨嬶紝ResultSet.getObject()涓嶈繑鍥炲竷灏旂被鍨嬶紙鍦ㄩ拡瀵逛吉浣嶇被鍨嬬殑getObject()涓娇鐢ㄤ簩杩涘埗缂栫爜鐨勭粨鏋滈泦妯$硦娴嬭瘯鏃讹紝瀹冩彁渚涗簡閬垮厤棰濆绫诲瀷杞崲鐨勫揩鎹锋柟寮忥級銆
-鐜板湪鑳藉鍦ㄢ淟OAD DATA LOCAL INFILE鈥濊鍙ヤ腑浣跨敤URL锛岃屼笖椹卞姩绋嬪簭灏嗕娇鐢↗ava鐨勫唴缃鐞嗙▼搴忔潵妫绱㈡暟鎹紝骞跺皢鍏跺彂閫佸埌鏈嶅姟鍣ㄣ傞粯璁ゆ儏鍐典笅涓嶅厑璁歌鐗规э紝瑕佹兂浣跨敤瀹冿紝蹇呴』灏嗏渁llowUrlInLocalInfile鈥濊繛鎺ュ睘鎬ц缃负鈥滅湡鈥濄
-瀵逛簬鍦≧esultSet.get*()鐨勬暟鍊间笂鎵ц鐨勬埅鍙栨搷浣滐紝椹卞姩绋嬪簭灏嗘洿鍔犱弗鏍硷紝鑰屼笖褰撴娴嬪埌鎴彇鎿嶄綔鏃跺皢鎶涘嚭SQLException銆傚皢鈥渏dbcCompliantTruncation鈥濊缃负鈥滃亣鈥濓紝鍙互绂佹璇ュ姛鑳斤紙鍦ㄩ粯璁ゆ儏鍐典笅鍏佽璇ュ姛鑳斤紝杩欐槸鍥犱负璇ュ姛鑳芥槸鍏煎JDBC鎵闇鐨勶級銆
-浠庣粨鏋滈泦璇诲彇鈥滃叏闆垛濇棩鏈熸椂闂村兼椂锛屽鍔犱簡涓夌澶勭悊瀹冧滑鐨勬柟娉曪紝鈥渆xception鈥濓紝锛堥粯璁ゅ硷級锛岀敤浠g爜涓衡淪1009鈥濈殑SQLState鎶涘嚭SQLException锛涒渃onvertToNull鈥濓紝杩斿洖NULL鑰屼笉鏄暟鎹紱浠ュ強鈥渞ound鈥濓紝瀵规棩鏈熻繘琛岃垗鍏ュ鐞嗭紝浣夸箣鎴愪负鏈鎺ヨ繎鐨勫硷紝鍗斥0001-01-01鈥濄
-鏇存浜哠erverPreparedStatement锛屼娇涔嬭兘澶熲滀互鑴辩嚎鈥濇柟寮忚鍙栭澶勭悊璇彞鍏冩暟鎹紝灏界鍦ㄧ洰鍓嶅畠鏄彇浠e湪浠讳綍鏃朵警鍧囦笉宸ヤ綔鐨凪ysqlIO.clearInputStream()鐨勫崰浣嶇锛屼箣鎵浠ュ姝わ紝鏄洜涓虹洰鍓嶅皻鏈粠鏈嶅姟鍣ㄨ鍙栨暟鎹傞氳繃鎶涘嚭ArrayIndexOutOfBoundExceptions鐨別rverPreparedStatements锛屽畠淇浜嗙敤鎴烽亣鍒扮殑鍋跺彂鎬ч敊璇
-鍔犺浇璧勬簮鎹嗗寘鏃朵娇鐢╟om.mysql.jdbc.Message鐨勭被鍔犺浇鍣紝搴旇兘鏇存璋冪敤鍣ㄧ殑绫诲姞杞藉櫒涓嶈兘纭畾璧勬簮鎹嗗寘浣嶇疆鏃跺嚭鐜扮殑鍋跺彂鎬ч敊璇
07-07-04锛氱増鏈3.1.3-beta
-瀵笴allableStatements鐨勮緭鍑哄弬鏁板悕杩涜Mangle澶勭悊锛屼娇寰楀湪涓庣敤鎴峰彉閲忓悕涓璧蜂娇鐢ㄦ椂锛岃繖绫诲悕绉颁笉浼氬穿婧冦
-澧炲姞浜嗗CallableStatements涓璉NPUT鍙傛暟鐨勬敮鎸併
-鏇存浜BUG#4119锛屼负鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ュ彂閫佺殑null姣旂壒鎺╃爜涓嶆纭
-榛樿鎯呭喌涓嬩娇鐢⊿QL鐨勬爣鍑哠QL鐘舵侊紝闄ら潪灏嗏渦seSqlStateCodes鈥濆睘鎬ц缃负鈥滃亣鈥濄
-澧炲姞浜嗕俊鎭寘璋冭瘯浠g爜锛堣鍙傝鈥渆nablePacketDebug鈥濆睘鎬ф枃妗o級銆
-涓篗ySQL閿欒缂栧彿澧炲姞浜嗗父閲忥紙鍙叕鍏辫闂紝璇峰弬瑙乧om.mysql.jdbc.MysqlErrorNumbers锛夛紝骞跺鍔犱簡鐢熸垚鏄犲皠鐨勮兘鍔涳紝鑳藉灏嗗巶瀹朵唬鐮佹槧灏勪负椹卞姩绋嬪簭浣跨敤鐨凷QLStates锛堝嚭浜庢枃妗g紪鍒剁洰鐨勶級銆
-浣挎洿澶氭秷鎭洿涓哄叿浣擄紙姝e湪鍔姏锛夈
-鏇存浜BUG#4311锛屽湪妫绱㈠叿鏈夐澶勭悊璇彞鍜屼簩杩涘埗鍗忚鐗规х殑mediumint鍒楁椂鍙戠敓閿欒銆
-褰撯渦seTimezone=true鈥濇椂锛屽湪MySQL-4.1.3涓敮鎸佹柊鐨勬椂鍖哄彉閲忋
-鏀寔鏃犵鍙锋暟鍊间綔涓洪澶勭悊璇彞杩斿洖鐨勭被鍨嬨傚浜庘渂igint unsigned鈥濈被鍨嬶紝杩欎篃浼氬鑷碦esultSet.getObject()涓殑鍐呭鍙戠敓鍙樺寲锛屸渂igint unsigned鈥濈被鍨嬬敤浜庤繑鍥濨igDecimal瀹炰緥锛岀幇鍦ㄥ畠灏嗚繑鍥瀓ava.lang.BigInteger瀹炰緥銆
06-09-04锛氱増鏈3.1.2-alpha
鏇存浜嗕负鍙傛暟锛堝char(), varchar()锛夋寚瀹氬ぇ灏忔椂瀛樺偍绋嬪簭鍙傛暟鐨勮В鏋愪俊鎭
-閫氳繃鈥渃acheCallableStmts鈥濆睘鎬э紝鍏佽瀵瑰彲璋冪敤璇彞杩涜楂橀熺紦鍐插鐞嗐
-鏇存浜嗕笅杩伴棶棰橈細鏈负瀛樺偍绋嬪簭鎸囧畾杈撳嚭鍙傛暟鏃讹紝鍙戝嚭铏氬亣鏌ヨ鏉ユ绱㈣緭鍑哄弬鏁帮紝浠庤屽鑷存湇鍔″櫒璇硶閿欒銆
-鏇存浜嗗湪CallableStatement.setOutputParameters()涓病鏈変换浣曞弬鏁颁細瀵艰嚧NullPointerException鐨勯棶棰樸
-鍒犻櫎浜哅ysqlIO.changeUser()涓殑寮傚父鎹嗗寘銆
-鏇存浜嗗叧浜庡彂閫佸ぇ鍨嬫煡璇㈠垎绂讳俊鎭寘鏂归潰鐨勯棶棰橈紝涔熷厑璁稿彂閫佸ぇ淇℃伅鍖呯殑nio鍔熻兘銆
-涓篠erverPreparedStatement澧炲姞浜.toString()鍔熻兘锛屽鏋滀綘姝e湪璋冭瘯浣滀负棰勫鐞嗚鍙ワ紙鏄剧ず涓烘湇鍔″櫒搴斿鐞嗙殑SQL锛夌殑鏌ヨ锛屽畠搴旀湁鎵甯姪銆
-澧炲姞浜嗏済atherPerformanceMetrics鈥濆睘鎬э紝浠ュ強鐢ㄤ簬鎺у埗鍦ㄤ綍鏃/浣曞璁板綍杩欑被淇℃伅鐨勫绉嶅睘鎬э紙鏇村淇℃伅璇峰弬瑙佺浉鍏虫枃妗o級銆
-璋冪敤.close()鏃讹紝ServerPreparedStatements瀹為檯涓婁笉鑳藉彇娑堝鏈嶅姟鍣ㄧ璧勬簮鐨勫垎閰嶃
-澧炲姞浜嗏渓ogSlowQueries鈥濆睘鎬э紝浠ュ強鈥渟lowQueriesThresholdMillis鈥濆睘鎬э紝浠ユ帶鍒跺簲鍦ㄤ綍鏃跺皢鏌ヨ瑙嗕负鈥滅紦鎱⑩濄
-鐩稿浜巖egisterOutParameter()涓殣鍚殑椤哄簭锛屾纭湴灏嗚緭鍑哄弬鏁版槧灏勫埌prepareCall()涓粰瀹氱殑浣嶇疆锛岋紱鏇存浜BUG#3146銆
-瀵逛簬鐗堟湰绛変簬楂樹簬4.1.0鐨勬湇鍔″櫒锛岃兘姝g‘鍦版娴嬪瓧绗﹂泦銆
-鏁寸悊浜嗘湇鍔″櫒灞炴х殑妫娴嬪姛鑳姐
-瀵逛簬鐗堟湰绛変簬楂樹簬4.1.2鐨勬湇鍔″櫒锛屾敮鎸佺敤浜庡弬鏁板厓鏁版嵁鐨勫崰浣嶇銆
-鏇存浜BUG#3539锛実etProcedures()鏈繑鍥炵粨鏋滈泦涓殑浠讳綍杩涚▼銆
-鏇存浜BUG#3540锛実etProcedureColumns()涓嶈兘涓庣▼搴忓悕鐨勯氶厤绗︿竴璧蜂娇鐢ㄣ
-鏇存浜BUG#3520锛孌BMD.getSQLStateType()杩斿洖涓嶆纭殑鍊笺
-澧炲姞浜嗏渃onnectionCollation鈥濆睘鎬э紝濡傛灉缁欏畾瀛楃闆嗙殑榛樿鏍″涓嶆伆褰擄紝椹卞姩绋嬪簭灏嗗湪杩炴帴鍒濆杩囩▼涓彂鍑衡渟et collation_connection=...鈥濇煡璇€
-鏇存浜嗗湪MySQL-5.0.0涓婅繍琛屾椂鐨凞atabaseMetaData.getProcedures()闂锛堝湪5.0.1鍜5.0.0闂达紝鈥渟how procedure status鈥濈殑杈撳嚭鏈夋墍涓嶅悓锛夈
-鏇存浜BUG#3804锛実etWarnings()杩斿洖SQLWarning鑰屼笉鏄疍ataTruncation銆
-瀵逛簬鐗堟湰涓5.0.0鎴5.0.1鐨勬湇鍔″櫒锛屼笉瑕佸惎鐢ㄦ湇鍔″櫒绔澶勭悊璇彞锛岃繖鏄洜涓猴紝瀹冧滑涓庨┍鍔ㄧ▼搴忎娇鐢ㄧ殑鈥4.1.2+鈥濋鏍间笉鍏煎锛堥┍鍔ㄧ▼搴忛璁¤繑鍥炵殑淇℃伅骞朵笉瀛樺湪锛屽洜鑰屾寕璧凤級銆
02-14-04锛氱増鏈3.1.1-alpha
-鏇存浜嗕笌涓嶄娇鐢ㄥ鎴风棰勫鐞嗚鍙ョ殑UpdatableResultSets鏈夊叧鐨勭己闄枫
-褰揗ySQL涓嶆彁渚涘瓧绗﹂泦骞跺皢JVM璁剧疆涓哄瀛楄妭缂栫爜鏃讹紝鏇存浜嗗皢瀛楄妭杞崲涓篈SCII鏃剁殑瀛楃缂栫爜浜嬪疁锛堥氬父浼氬奖鍝嶆暟鍊兼绱級銆
-灏嗘湇鍔″櫒棰勫鐞嗚鍙ョ殑鈥滄湭鐭モ濇暟鎹被鍨嬭В鍖呬负瀛楃涓层
-涓烘湇鍔″櫒棰勫鐞嗚鍙ュ疄鐜颁簡闀挎暟鎹被鍨嬶紙Blob銆丆lob銆両nputStreams銆丷eaders锛夈
-涓篗ySQL-4.1鍜屾洿楂樼増鏈疄鐜颁簡Statement.getWarnings()锛堜娇鐢ㄢ淪HOW WARNINGS鈥濓級銆
-榛樿缁撴灉闆嗙被鍨嬫洿鏀逛负TYPE_FORWARD_ONLY锛堝吋瀹笿DBC锛夈
- 缁撴灉闆嗙被鍨嬪拰骞跺彂鎬х殑闆嗕腑璁剧疆銆
-鍐嶆纭畾浜嗚繛鎺ュ睘鎬х殑璁剧疆鏂瑰紡鍜屾樉绀轰负DriverPropertyInfo鐨勬柟寮忥紝浠ュ強Connection鍜孌ataSource灞炴с
-鏀寔NIO銆傚湪鏀寔NIO鐨勫钩鍙颁笂浣跨敤鈥渦seNIO=true鈥濄
-鏀寔SAVEPOINTs锛圡ySQL >= 4.0.14鎴4.1.1锛夈
-鏀寔鈥渕ysql_change_user()...鈥濓紝璇峰弬瑙佲渃om.mysql.jdbc.Connection鈥濅腑鐨刢hangeUser()鏂规硶銆
-鍑忓皯浜嗗钩鍧囨煡璇腑璋冪敤鐨勬柟娉曟暟鐩紝浣夸箣鏇存湁鏁堢巼銆
-鑷姩鍐嶈繛鎺ユ椂閲嶆柊澶勭悊棰勫鐞嗚鍙ャ備换浣曢亣鍒扮殑閿欒鍧囪寤惰繜锛岀洿鑷抽娆″皾璇曞啀鎵ц缁忚繃閲嶆柊澶勭悊鐨勮鍙ヤ负姝€
-鎸夌収JDBC瑙勮寖锛岀‘淇濆湪棰勫鐞嗚鍙ヤ笂鎵ц鏌ヨ鍓嶇粰鍑虹殑璀﹀憡鏄槑纭殑锛堢洰鍓嶏紝鎴戜滑鏀寔璀﹀憡鍔熻兘锛夈
-鍦–onnectionProperties涓紝鏀寔鈥滄棫鐨勨漰rofileSql澶у啓鐗规с傝灞炴у凡鍙楀埌鍐疯惤锛屽簲灏介噺浣跨敤鈥減rofileSQL鈥濄
-浼樺寲浜咮uffer.readLenByteArray()锛屼互渚垮綋闀垮害涓0鏃惰繑鍥炲叡浜殑绌哄瓧鑺傛暟缁勩
-鍦ㄥ.execute*()鐨勫娆¤皟鐢ㄤ箣闂达紝鍏佽淇濈暀PreparedStatement.setBlob()鐨勫唴瀹广
-澶勭悊浜咵scapeProcessor涓殑0闀垮害浠ょ墝锛堢敱鍙皟鐢ㄨ鍙ヨ浆涔夎娉曞鑷达級銆
-鍦║pdatableResultSet涓殑鍒犻櫎锛忔洿鏂帮紡鎻掑叆琛屾搷浣滀笂锛屾鏌ュ叧闂殑杩炴帴銆
-鏇存浜嗘鏌pdatableResultSet涓殑鎵鏈変富閿椂瀵硅〃鍒悕鐨勬敮鎸佷簨瀹溿
-鍒犻櫎浜唘seFastDates杩炴帴灞炴с
-瀵规潵鑷狫NDI Refs鐨勬暟鎹簮灞炴ц繘琛屼簡姝g‘鐨勫垵濮嬪寲锛屽寘鎷槑纭寚瀹氱殑URL銆
-瀵逛簬鐗堟湰涓5.0.0鎴栨洿楂樼殑MySQL锛孌atabaseMetaData鐜板湪鑳介氭姤supportsStoredProcedures()銆
-鏇存浜咰onnection.prepareCall()涓殑鍫嗘爤婧㈠嚭闂锛堜笉鑹悎骞讹級銆
-瀵逛綆浜1.4鐗堢殑JDK锛屾洿姝d簡瀵笵ateTimeValue涓瑿alendar.getTimeInMillis()鐨処llegalAccessError锛堥潪娉曡闂敊璇級銆
-鏇存浜BUG#1673锛屽浜庨潪鈥%鈥濆垪鍚嶏紝DatabaseMetaData.getColumns()鏈繑鍥炴纭殑鍒楅『搴忎俊鎭
-鍚堝苟浜嗘暟鎹被鍨嬫槧灏勭殑鏇存浜嬮」锛屼粠MySQL绫诲瀷鈥淔LOAT鈥濆埌java.sql.Types.REAL锛堣嚜3.0鐗堣捣锛夌殑鏁版嵁绫诲瀷鏄犲皠銆
-妫娴嬬敤浜嶳SMD.isCaseSensitive()鐨勫垪鏍″銆
-鏇存浜嗕笌鍙戦佸ぇ浜16M鏌ヨ鏈夊叧鐨勯棶棰樸
-涓篊allableStatement澧炲姞浜嗗懡鍚嶅拰绱㈠紩寮忚緭鍏ワ紡杈撳嚭鍙傛暟鏀寔銆
MySQL-5.0.x鎴栨洿楂樼増鏈
-鏇存浜哠erverPreparedStatement.setTimestamp()涓殑NullPointerException锛屼互鍙奡erverPreparedStatement.setTimestamp()銆乻etDate()涓殑骞存湀宸紓銆
-涓篵uild.xml涓殑涓鑷存у拰閫掑綊/鍗曞厓娴嬭瘯澧炲姞浜嗘嫢鏈夊涓暟鎹簱/JVM鐩爣鐨勮兘鍔涖
-鏇存浜嗚闂甋erverPreparedStatements鍜屽叾缁撴灉闆嗕腑鏌愪簺鏃ユ湡鏃堕棿鍔熻兘鏃剁殑NPE鍜屼笉鑹勾鏈堣浆鎹㈤棶棰樸
-鏄剧ず鍏抽棴杩炴帴鐨勪綅缃拰鍘熷洜锛堢敤浜庡府鍔╄皟璇曪級銆
-瀹炵幇浜咰ommunicationsException锛屽畠鑳藉皾璇曞垽鏂笌鏈嶅姟鍣ㄥけ鍘婚氫俊鐨勫師鍥狅紝骞惰兘鍦ㄨ皟鐢.getMessage()鏃舵樉绀哄彲鑳界殑鍘熷洜銆
-鏇存浜BUG#2359锛屼簩杩涘埗缂栫爜缁撴灉闆嗕腑鏁板肩被鍨嬬殑NULL鍊间細瀵艰嚧NullPointerExceptions銆
-瀹炵幇浜咰onnection.prepareCall()锛孌atabaseMetaData.getProcedures()锛屼互鍙奼etProcedureColumns()銆
-璋冪敤clearParameters()鏃讹紝閫氳繃鍙戦丆OM_RESET_STMT鑷虫湇鍔″櫒锛屽浣嶄簡ServerPreparedStatement涓殑鈥渓ong binary鈥濆弬鏁般
-鑷3.0鐗堣捣锛屽悎骞朵簡棰勫鐞嗚鍙ラ珮閫熺紦鍐插拰.getMetaData()鏀寔銆
-瑙e寘鏉ヨ嚜鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ョ殑缁撴灉鏃讹紝鍦ㄦ煇浜涙儏鍐典笅锛屽浜嶵imeUtil.fastDate/TimeCreate()鐨勫勾浠斤紝浼氬嚭鐜皁ff-by-1900閿欒锛屾洿姝d簡璇ラ敊璇
-鏇存浜BUG#2502锛実etTables()涓殑瀛楃闆嗚浆鎹簨瀹溿
-瀹炵幇浜嗙敱璇彞鎴栧瓨鍌ㄧ▼搴忚繑鍥炵殑澶氫釜缁撴灉闆嗐
-鏇存浜BUG#2606锛屾湇鍔″櫒绔澶勭悊璇彞鏈纭繑鍥炴暟鎹被鍨嬧淵EAR鈥濄
-鍏佽瀵规潵鑷湇鍔″櫒绔澶勭悊璇彞鐨勭粨鏋滈泦杩涜娴佸鐞嗐
-鏇存浜BUG#2623锛屼娇鐢ㄦ粴鍔ㄧ粨鏋滈泦鍜屾湇鍔″櫒绔澶勭悊璇彞鏃跺嚭鐜扮被鑸嶅純寮傚父銆
-鑷3.0鐗堣捣锛屽悎骞朵簡鏃犵紦鍐茶緭鍏ヤ唬鐮併
-鏇存浜嗕笉鑳介氳繃瀛樺彇鍣ㄦ伆褰撴樉绀虹殑ConnectionProperties锛屽苟鏁寸悊浜咰onnectionProperties浠g爜銆
-鏇存浜BUG#2671锛屽湪鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ヤ腑锛屽湪浠讳綍鎯呭喌涓嬪潎涓嶈兘姝g‘缂栫爜NULL瀛楁銆
-鏇存浜嗗皢鏁板瓧鍐欏叆缂撳啿浠ュ彂閫侀澶勭悊璇彞鎵ц璇锋眰鏃跺嚭鐜扮殑缃曡缂撳啿鍖轰笅婧㈤棶棰樸
-瀵逛簬浜や粯鐨勯┍鍔ㄧ▼搴忥紝浣跨敤浜嗘枃妗g殑DocBook鐗堛
02-18-03锛氱増鏈3.1.0-alpha
-澧炲姞浜嗏渞equireSSL鈥濆睘鎬с
-澧炲姞浜嗏渦seServerPrepStmts鈥濆睘鎬э紙榛樿涓衡滃亣鈥濓級銆傚綋鏈嶅姟鍣ㄧ増鏈敮鎸佸苟灏嗚灞炴ц缃负鈥滅湡鈥濇椂锛4.1鍜屾洿楂樼増鏈級锛岄┍鍔ㄧ▼搴忓皢浣跨敤鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ャ傜洰鍓嶅叾榛樿璁剧疆涓衡滃亣鈥濓紝闄ら潪鎵鏈夌殑鎹嗙粦锛忚幏鍙栧姛鑳藉潎宸插疄鏂姐傜洰鍓嶏紝浠呬负4.1鐗堢殑鏈嶅姟鍣ㄧ棰勫鐞嗚鍙ュ疄鐜颁簡DML棰勫鐞嗚鍙ャ
-璺熻釜鎵撳紑鐨勮鍙ワ紝骞跺湪璋冪敤Connection.close()鏃跺叧闂墍鏈夋墦寮鐨勮鍙ワ紙JDBC鍏煎锛夈
06-23-05锛氱増鏈3.0.17-ga
-鏇存浜BUG#5874锛屽綋useTimeZone='true'鑰屼笖鏈嶅姟鍣ㄦ椂鍖轰笉鍚屼簬瀹㈡埛绔椂鍖烘椂锛孴imestamp/Time杞崲鍑虹幇鏂瑰悜閿欒銆
-鏇存浜BUG#7081锛孌atabaseMetaData.getIndexInfo()蹇界暐鈥滃敮涓鈥濆弬鏁般
-鏀寔鏂扮殑鍗忚绫诲瀷鈥淢YSQL_TYPE_VARCHAR鈥濄
-澧炲姞浜嗏渦seOldUTF8Behavoior鈥濋厤缃睘鎬э紝杩炴帴鍒癕ySQL-4.1鎴栨洿楂樼増鏈笖瀛楃缂栫爜涓衡渦tf-8鈥濇椂锛岃灞炴ц兘浣縅DBC椹卞姩绋嬪簭鐨勮涓烘柟寮忕被浼间簬鍦∕ySQL-4.0.x鍜屾洿鏃╃増鏈笅鐨勮涓烘柟寮忋
-鏇存浜BUG#7316锛岃皟鐢╣etConnection()鏃讹紝浠庤繛鎺ユ睜鍒涘缓鐨勮鍙ヨ繑鍥炲疄闄呰繛鎺ヨ屼笉鏄昏緫杩炴帴銆
-鏇存浜BUG#7033锛屽湪闈欐丼QL瀛楃涓蹭腑锛孭reparedStatements涓嶈兘姝g‘缂栫爜Big5锛堜互鍙婂叾浠栧瀛楄妭锛夊瓧绗﹂泦銆
-鏇存浜BUG#6966锛屽惎鍔ㄤ簡鏁呴殰鍒囨崲鐨勮繛鎺ワ紙鐢变簬涓昏繛鎺ュけ璐ワ級浠庝笉鍐嶆灏濊瘯涓昏繛鎺ャ
-鏇存浜BUG#7061锛孭reparedStatement.fixDecimalExponent()澧炲姞棰濆鈥+鈥濓紝浣垮緱MySQL鏈嶅姟鍣ㄦ棤娉曡В鏋愭暟鍊笺
-鏇存浜BUG#7686锛孴imestamp鍏抽敭瀛楀垪鏁版嵁闇瑕佸垎绂荤殑鈥淿binary鈥濓紝鐢ㄤ簬UpdatableResultSet.refreshRow()銆
-鍙嶅悜绉绘浜嗘潵鑷狢onnector/J 3.1鐨凷QLState浠g爜鏄犲皠锛屼娇鐢ㄨ繛鎺ュ睘鎬р渦seSqlStateCodes=true鈥濆彲鍚敤瀹冿紝鍦ㄦ湰鐗堟湰涓粯璁や负鈥滃亣鈥濓紝浠ュ厤鐮村潖浼犵粺搴旂敤绋嬪簭锛堝浜嶤onnector/J 3.1锛岄粯璁や负鈥滅湡鈥濓級銆
-鏇存浜BUG#7061锛孭reparedStatement.fixDecimalExponent()澧炲姞棰濆鈥+鈥濓紝浣垮緱MySQL鏈嶅姟鍣ㄦ棤娉曡В鏋愭暟鍊笺
-杞箟搴忓垪{fn convert(..., type)}鐜板湪鏀寔鐢盨QL棰勫厛璁惧畾鐨凮DBC绫诲瀷銆
-鏇存浜哻onfigureClientCharset()涓殑閲嶅浠g爜锛岃绫讳唬鐮佸皢闃绘useOldUTF8Behavior=true鐨勬伆褰撹繍琛屻
-閫氳繃鏇存琛屾暟璁℃暟鍣ㄧ殑鐜粫寮忓鐞嗙▼搴忥紝鑳芥纭鐞嗗ぇ浜20浜胯鐨勬祦寮忕粨鏋滈泦銆
-鏇存浜BUG#7607锛孧S932銆丼HIFT_JIS鍜學indows_31J涓嶆帴鍙楅拡瀵箂jis鐨勫埆鍚嶃
-鏇存浜BUG#6549锛堟洿姝#7607鐨勫悓鏃讹級锛屼负sjis澧炲姞浜咰P943鍒悕銆
-鏇存浜BUG#8064锛屼笌棰勫鐞嗚鍙ヤ竴璧蜂娇鐢ㄥ瀛楄妭瀛楃闆嗘椂锛岃姹傚浜岃繘鍒舵暟鎹繘琛屽崄鍏繘鍒惰浆涔夊鐞嗐
-鏇存浜BUG#8812锛孌BMD.getIndexInfo()鐨凬ON_UNIQUE鍒楄繑鍥炲掔疆鍊笺
-瑙e喅浜嗘湇鍔″櫒BUG#9098锛屾棤娉曞皢DATE/TIME/TIMESTAMP/TIMESTAMP鍒桟URRENT_*鐨勯粯璁ゅ间笌鈥滃瓧绗︿覆鈥濆煎尯鍒紑锛屽洜姝わ紝鎻掑叆榛樿鍊兼椂锛孶pdatableResultSet.moveToInsertRow()浼氱敓鎴愪笉鑹殑SQL銆
-鏇存浜BUG#8629锛屽皢鈥淓UCKR鈥濅綔涓衡淪ET NAMES euc_kr鈥濆彂閫侊紝MySQL-4.1浠ュ強鏇撮珮鐗堟湰涓嶈兘鐞嗚В璇ョ壒鎬с
-鏍规嵁鏈嶅姟鍣ㄧ殑鐗堟湰锛孌atabaseMetaData.supportsSelectForUpdate()杩斿洖姝g‘鍊笺
-瀵逛簬鍚埆鍚峎indows-31J銆丆P934銆丮S932鐨勫弻瀛楄妭瀛楃闆嗭紝瀵逛簬PreparedStatement.setBytes()锛岄噰鐢ㄥ崄鍏繘鍒惰浆涔夌壒鎬с
-澧炲姞浜嗗鈥淓UC_JP_Solaris鈥濆瓧绗︾紪鐮佺殑鏀寔锛屾槧灏勫埌鈥渆ucjpms鈥濈殑MySQL缂栫爜锛堜粠3.1鐗堝紑濮嬬殑鍙嶅悜绉绘锛夈傚畠鍙兘鍦ㄦ敮鎸乪ucjpms鐨勬湇鍔″櫒灞卞伐浣滐紝涔熷氨鏄5.0.3鎴栨洿楂樼増鏈
11-15-04锛氱増鏈3.0.16-ga
-杩炴帴鑷矼ySQL-4.1鎴栨洿楂樼増鏈笖鍐嶆浣跨敤杩炴帴姹犲拰锛忔垨Connection.changeUser()鏃讹紝灏嗗啀娆″彂鍑哄瓧绗﹂泦閰嶇疆鍛戒护銆
-鏇存浜哛esultSetMetaData.isReadOnly()锛屼互渚垮湪杩炴帴鑷矼ySQL-4.1鎴栨洿楂樼増鏈椂锛岃兘鏍规嵁鈥滃師濮嬬殑鈥濊〃鍚嶅拰鍒楀悕锛屾娴嬩笉鍙啓鐨勫垪銆
-鏇存浜BUG#5664锛屽綋ResultSet.updateByte()浣嶄簬鎻掑叆琛屼笂鏃舵姏鍑篈rrayOutOfBoundsException銆
-鏇存浜咲atabaseMetaData.getTypes()锛屽浜嶯UMERIC绫诲瀷锛屽畠杩斿洖涓嶆纭殑锛堥潪璐燂級鏍囧害銆
-鏇存浜BUG#6198锛孊uffer.readString(string)涓殑鈥渙ff-by-one鈥濋棶棰樸
-閫氳繃鈥渢inyInt1isBit鈥濆睘鎬э紝浣垮緱鑳藉瀵筎INYINT(1) -> BIT/Boolean杞崲杩涜閰嶇疆锛堜负浜嗕笌JDBC鍏煎锛岄粯璁や负鈥滅湡鈥濓級銆
-濡傛灉鏈嶅姟鍣ㄧ増鏈ぇ浜庣瓑浜4.1.1锛屽湪杩炴帴寤虹珛杩囩▼涓粎璁剧疆鈥渃haracter_set_results鈥濄
-鏇存浜嗗洖褰掗棶棰橈紝鍏朵腑锛寀seUnbufferedInput榛樿涓衡滃亣鈥濄
-鏇存浜BUG#6231锛孯esultSet.getTimestamp()浣滅敤鍦ㄥ叿鏈塗IME鐨勫垪涓婃椂澶辫触銆
09-04-04锛氱増鏈3.0.15-production
-鏇存浜BUG#4010锛屽浜嶨BK锛孲tringUtils.escapeEasternUnicodeByteStream浠嶈鐮村潖銆
-鏇存浜BUG#4334锛屽浜巃utoReconnect鐨勬晠闅滃垏鎹紝瀵逛换浣曚富鏈哄潎涓嶄娇鐢ㄧ鍙b#鈥濓紝鑰屼笖涓嶉噸璇曟墍鏈変富鏈恒傦紙璀﹀憡锛氶渶瑕佹洿鏀筍ocketFactory connect()鏂规硶鐨勭壒寰侊紝瀹冪洰鍓嶆槸鍏叡濂楁帴瀛楄繛鎺ワ紙String host锛宨nt portNumber锛孭roperties props锛夈備篃鑳芥锛屽繀椤绘洿鏀逛换浣曠涓夋柟濂楁帴瀛楀疄鏂芥柟寮忎互鏀寔璇ョ壒寰併
-褰撳畠浠凡琚叧闂苟琚繑鍥炲埌杩炴帴姹犳椂锛岀敱MysqlConnectionPoolDataSource鍒涘缓鐨勯昏緫杩炴帴灏嗗彂鍑簉ollback()銆傚鏋滀綘鐨勫簲鐢ㄦ湇鍔″櫒/杩炴帴姹犲凡甯姪浣犲畬鎴愪簡璇ヤ换鍔★紝鍙互灏嗏渞ollbackOnPooledClose鈥濆睘鎬ц缃负鈥滃亣鈥濅互閬垮厤棰濆鐨剅ollback()寮閿銆
-鍒犻櫎浜嗙粨鏋滈泦涓checkRowPos()鐨勫浣欒皟鐢ㄣ
-鏇存浜BUG#4742锛屽湪DBMD.getTypeInfo()涓紝鈥淒OUBLE鈥濇槧灏勪簡涓ゆ銆
-澧炲姞浜咶LOSS璁稿彲璞佸厤銆
-鏇存浜BUG#4808锛屽湪PooledConnection涓婅皟鐢ㄤ袱娆.close()灏嗗鑷碞PE銆
-鏇存浜BUG#4138鍜BUG#4860锛屽浜庢棤绗﹀彿鍒楋紝DBMD.getColumns()杩斿洖閿欒鐨凧DBC绫诲瀷銆傝繖涔熶細褰卞搷瀵筊SMD.getColumnType()鍜孯SMD.getColumnTypeNames()鏂规硶涓墍鏈夋暟鍊肩被鍨嬬殑绫诲瀷鏄犲皠锛屼互纭繚DBMD.getColumns()鐨勭被浼肩被鍨嬩笌RSMD.getColumnType()鍜孯SMD.getColumnTypeNames()杩斿洖鐨勭被鍨嬪尮閰嶃
-鍒嗗彂鐗堝懡鍚嶆柟妗堜腑鐨勨淧roduction鈥-鈥淕A鈥濄
-鏇存浜BUG#4880锛屽浜庨潪鏁板肩被鍨嬶紝RSMD.getPrecision()杩斿洖0锛堝浜庨潪浜岃繘鍒剁被鍨嬶紝搴旇繑鍥炲瓧绗︾殑鏈澶ч暱搴︼紝瀵逛簬浜岃繘鍒剁被鍨嬶紝搴旇繑鍥炴渶澶у瓧鑺傞暱搴︼級銆傛牴鎹湇鍔″櫒鍙戝洖鐨勯暱搴︼紙鍦ㄧ綉缁滃崗璁眰锛屾湇鍔″櫒涓嶅尯鍒員INYBLOB銆丅LOB銆丮EDIUMBLOB鎴朙ONGBLOB锛夛紝瀹冭繕鏇存浜嗛拡瀵笲LOB绫诲瀷鐨凴SMD.getColumnType()鍜孯SMD.getColumnTypeName()鏄犲皠銆
-鏇存浜BUG#5022锛岀粨鏋滈泦搴斿湪鈥.close()鈥濅腑閲婃斁Field[]瀹炰緥銆
-鏇存浜BUG#5069锛屽鏋滅粨鏋滈泦宸插叧闂紝ResultSet.getMetaData()涓嶅簲杩斿洖鏈纭垵濮嬪寲鐨勫厓鏁版嵁锛岃屾槸搴旀姏鍑篠QLException銆傛澶栵紝鍦ㄥ瀹炰緥绾у埆鐨勫瓧娈碉紙.close()杩囩▼涓彇娑堢殑瀛楁锛夎繘琛屾搷浣滀箣鍓嶏紝閫氳繃璋冪敤checkClosed()锛屽畠杩樻洿姝d簡getRow()銆乬etWarnings()鍜岄亶鍘嗘柟娉曘
-浠4.1.x鐗堟湇鍔″櫒寮濮嬶紝鑳借В鏋愭柊鐨勬椂鍖哄彉閲忋
-涓嶮ySQL-4.1.x鎴栨洿楂樼増鏈繛鎺ユ椂锛屼负PreparedStatement.setBytes()鍜宻et*Stream()浣跨敤鈥淿binary鈥濆紩浠嬭瘝锛屼互闃叉鍦ㄥ瓧绗﹂泦杞崲杩囩▼涓嚭鐜伴敊璇垽鏂
05-28-04锛氱増鏈3.0.14-production
-鏇存浜哢RL瑙f瀽閿欒銆
05-27-04锛氱増鏈3.0.13-production
-鏇存浜BUG#3848锛屾棤鏈嶅姟鍣ㄥ悕绉版椂锛屼笉鑳戒娇鐢∕ySQLDatasource銆
-鏇存浜BUG#3920锛屼娇鐢∕ysqlConnectionPoolDataSource鏃跺嚭鐜扳淣o Database Selected鈥濓紙鏈夋嫨鏁版嵁搴擄級銆
-鏇存浜BUG#3873锛屽浜庢壒鎻掑叆锛孭reparedStatement.getGeneratedKeys()鏂规硶浠呰繑鍥1涓粨鏋溿
05-18-04锛氱増鏈3.0.12-production
-涓篢YPE_NAME鍒椾腑鐨凞atabaseMetaData.getColumns()杈撳嚭澧炲姞浜嗘棤绗﹀彿灞炴с
-澧炲姞浜嗏渇ailOverReadOnly鈥濆睘鎬э紝鍏佽鏈缁堢敤鎴烽厤缃嚭鐜版晠闅滃垏鎹㈡椂鐨勮繛鎺ョ姸鎬侊紙鍙锛忓彲鍐欙級銆
-鑷3.1寮濮嬶紝鍙嶅悜绉绘浜嗏渃hange user鈥濆拰鈥渞eset server state鈥濆姛鑳斤紝鍏佽MysqlConnectionPoolDataSource鐨勫鎴风澶嶄綅杩炴帴姹犱笂getConnection()鐨勬湇鍔″櫒鐘舵併
-浣跨敤MySQL-4.1鎴栨洿楂樼増鏈椂锛屼笉瀵筍JIS/GBK/BIG5杩涜杞箟澶勭悊銆
-鍏佽MysqlDataSource鍜孧ysqlConnectionPool鏁版嵁婧愪娇鐢ㄢ渦rl鈥濆弬鏁帮紝浠ヤ究鑳藉浠庡唴閮ㄥ簲鐢ㄦ湇鍔″櫒浼犻掑叾浠栧睘鎬с
-灏嗗鍒堕敭鍜屽閿敊璇槧灏勫埌鈥23000鈥濈殑SQLState銆
-鑷3.1寮濮嬶紝鍙嶅悜绉绘浜嗘枃妗g紪鍒跺伐鍏枫
-杩斿洖鐢ㄤ簬缁撴灉闆嗙殑鍒涘缓璇彞锛岃缁撴灉闆嗙敱getGeneratedKeys()鍒涘缓锛BUG#2957锛夈
-鍏佽浣滀负鍙傛暟灏唈ava.util.Date鍙戦佸埌PreparedStatement.setObject()锛屽皢鍏惰浆鎹负Timestamp绫诲瀷浠ヤ繚鎸佸畬鏁寸簿搴︼紙BUG#3103锛夈
-浣跨敤setBytes()鍜/鎴杝etBinary/CharacterStream()鏃讹紝涓嶆埅鍙朆LOB/CLOB锛BUG#2670锛夈
-杩炴帴鏃讹紝鍦ㄤ娇鐢ㄢ淪HOW COLLATION鈥濈殑MySQL-4.1.0鍜屾洿楂樼増鏈笂锛屼负瀛楁绾у瓧绗﹂泦鍔ㄦ侀厤缃瓧绗﹂泦鏄犲皠銆
-灏嗏渂inary鈥濆瓧绗﹂泦鏄犲皠鍒扳淯S-ASCII鈥濓紝浠ユ敮鎸4.1.2鍜屾洿楂樼増鏈湇鍔″櫒鐨凞ATETIME瀛楃闆嗚瘑鍒姛鑳姐
-鍦ㄥ垵濮嬪寲杩囩▼涓娇鐢ㄢ淪ET character_set_results鈥濓紝鍏佽灏嗙粨鏋滈泦鐨勪换浣曞瓧绗﹂泦杩斿洖鍒伴┍鍔ㄧ▼搴忋
-鍦>= 4.1.0鐨凪ySQL涓婂彂鍑衡淪ET NAMES鈥濅箣鍓嶏紝鍦ㄨ繛鎺ヨ嚦缂栫爜鏌ヨ鐨勮繃绋嬩腑锛屼娇鐢ㄨ繑鍥炵殑charsetnr銆
-涓篟esultSetMetaData锛坓etColumnCharacterEncoding()鍜実etColumnCharacterSet()锛夊鍔犱簡Helper锛堝姪鎵嬶級鏂规硶锛屽厑璁告渶缁堢敤鎴锋煡鐪嬮┍鍔ㄧ▼搴忚涓哄簲鍦ㄥ垪涓婁娇鐢ㄧ殑瀛楃闆嗐
-鍦>= 4.1.0鐨凪ySQL涓婁粎璁剧疆character_set_results銆
-鏇存浜BUG#3511锛孲tringUtils.escapeSJISByteStream()涓嶈兘姝g‘澶勭悊鎵鏈夌殑涓滄柟鍙屽瓧鑺傚瓧绗﹂泦銆
-灏哠tringUtils.escapeSJISByteStream()閲嶆柊鍛藉悕涓烘洿璐村垏鐨別scapeEasternUnicodeByteStream()銆
-鏇存浜BUG#3554锛屽湪URL涓湭鎸囧畾鏁版嵁搴撳皢瀵艰嚧MalformedURL exception銆
-濡傛灉浣跨敤浜哻haracterEncoding灞炴э紝鑷姩灏哅ySQL缂栫爜鍚嶇О杞崲涓篔ava缂栫爜鍚嶇О銆
-澧炲姞浜嗗湪鏌愪簺JVM涓婅兘璇嗗埆鐨勭紪鐮佸悕绉帮紝浠ユ洿姝i敊璇湴灏嗗叾閫嗗悜鏄犲皠涓篗ySQL缂栫爜鍚嶇О鐨勯棶棰樸
-涓烘墍鏈夊崟鍏冩祴璇曚娇鐢╦unit.textui.TestRunner锛堝厑璁稿湪Ant鎴朎clipse浠ュ鐨勫懡浠よ涓婅繍琛屽畠浠級銆
-鏇存浜BUG#3557锛孶pdatableResultSet涓嶈兘鑾峰彇moveToInsertRow()鐨勯粯璁ゅ笺
-鏇存浜BUG#3570锛屼笉涓鑷寸殑鍒楃被鍨嬮氭姤銆傛湇鍔″櫒浠嶄笉鑳芥纭繑鍥*BLOBs *TEXT鐨勬墍鏈夌被鍨嬶紝鍥犳椹卞姩绋嬪簭涔熶笉鑳芥纭繑鍥炲畠浠
-鏇存浜BUG#3520锛孌BMD.getSQLStateType()杩斿洖涓嶆纭殑鍊笺
-鏇存浜哖reparedStatement.setString()鍜屼笢鏂瑰瓧绗︾紪鐮佷腑鐨勯掑綊闂銆
- 澧炲姞浜嗗StringRegressionTest 4.1-unicode鐨勮瘑鍒
02-19-04锛氱増鏈3.0.11-stable
-閫氳繃鈥渃haracterEncoding鈥濆睘鎬у皢缂栫爜鏂瑰紡寮哄埗璁句负鈥渦tf8鈥濇垨鈥渦tf-8鈥濇椂锛岃Е鍙戔淪ET NAMES utf8鈥濄備互鍓嶏紝鍙兘鐢↗ava椋庢牸鐨勨渦tf-8鈥濈紪鐮佸悕绉版墠鑳借Е鍙戣鎿嶄綔銆
-AutoReconnect鏃堕棿鐨勫闀块熷害蹇簬鎸囨暟閫熷害锛BUG#2447锛夈
-鏇存浜嗘晠闅滃垏鎹㈡昏烦鑷冲垪琛ㄤ腑鏈鍚1涓富鏈虹殑闂锛BUG#2578锛夈
-澧炲姞浜嗏渦seUnbufferedInput鈥濆弬鏁帮紝瀹冧篃鏄洰鍓嶇殑榛樿鍙傛暟锛堝洜JVM浜嬪疁锛http://developer.java.sun.com/developer/bugParade/bugs/4401235.html锛夈
-妫娴嬫湇鍔″櫒涓妉ower_case_table_names鐨勨渙n/off鈥濓紝鎴栤1鈥濄佲2鈥濄佲3鈥濆舰寮忋
-涓篟esultSetMetaData.getColumnClassName()鐨凾INYINT鍜孲MALLINT绫诲瀷杩斿洖鈥渏ava.lang.Integer鈥濓紙鏇存浜BUG#2852锛夈
-涓篟esultSetMetaData.getColumnClassName()鐨凢LOAT绫诲瀷杩斿洖鈥渏ava.lang.Double鈥濓紙鏇存浜BUG#2855锛夈
-涓篟esultSetMetaData.getColumnClassName()鐨凚INARY銆乂ARBINARY鍜孡ONGVARBINARY绫诲瀷杩斿洖鈥淸B鈥濊屼笉鏄渏ava.lang.Object鈥濓紙鍏煎JDBC锛夈
-鍦ㄧ敱ConnectionPoolDataSource鍒涘缓鐨勬墍鏈夊疄渚嬩笂鍙戝嚭杩炴帴浜嬩欢銆
01-13-04锛氱増鏈3.0.10-stable
-鍦≒reparedStatement瑙f瀽涓紝褰撲綅浜庘滃瓧绗︿覆鈥濆唴鏃讹紝涓嶅寮曠敤鐨処D杩涜璁℃暟锛堟洿姝d簡BUG#1511锛夈
-鍏充簬PacketTooLargeException鐨勨淔riendlier鈥濆紓甯告秷鎭紙BUG#1534锛夈
-浠3.1鐗堝紑濮嬶紝鍙嶅悜绉绘浜嗗checkUpdatability()鏂规硶涓埆鍚嶈〃鍜孶pdatableResultSets鐨勮ˉ涓併
-鏇存浜嗕娇鐢⊿tatement.setMaxRows()鏃跺嚭鐜扮殑ArrayIndexOutOfBounds寮傚父锛BUG#1695锛夈
-鏇存浜BUG#1576锛屽鐞嗘湭姝g‘璇诲彇鐨勫ぇBLOB鍜屽垎绂讳俊鎭寘銆
-鏇存浜哠tatement.getGeneratedKeys()鍜孯EPLACE璇彞鐨勯掑綊闂銆
-鏇存浜BUG#1630锛屽鏋滅粨鏋滈泦鏄笉鍙洿鏂扮殑锛屽ResultSet.updateFoo()鐨勫悗缁皟鐢ㄥ皢瀵艰嚧NPE銆
-纭畾浜4.1.1椋庢牸鐨刟uth锛屾棤瀵嗙爜銆
-鏇存浜BUG#1731锛屽閿垪鐨勯『搴忎笌DatabaseMetaData.getImported/Exported/CrossReference()涓嶄竴鑷淬
-鏇存浜BUG#1775锛孌atabaseMetaData.getSystemFunction()杩斿洖閿欒鍑芥暟鈥淰ResultsSion鈥濄
-鏇存浜BUG#1592锛屾湭姝g‘妫鏌ヤ氦鍙夋暟鎹簱鍙洿鏂扮粨鏋滈泦鐨勫彲鏇存柊鎬с
-瀵逛簬MySQL LONGTEXT绫诲瀷锛孌atabaseMetaData.getColumns()搴旇繑鍥濼ypes.LONGVARCHAR銆
-浣滅敤鍦═INYINT鍜孲MALLINT鍒椾笂鐨凴esultSet.getObject()搴旇繑鍥濲ava绫诲瀷鈥淚nteger鈥濓紙BUG#1913锛夈
-澧炲姞浜嗏渁lwaysClearStream鈥濊繛鎺ュ睘鎬э紝瀹冧細浣块┍鍔ㄧ▼搴忓湪姣忔鏌ヨ鍓嶆竻绌鸿緭鍏ユ祦涓婁换浣曚綑鐣欑殑鏁版嵁銆
-澧炲姞浜嗘洿鍏锋弿杩版х殑閿欒娑堟伅鈥淪erver Configuration Denies Access to DataSource鈥濓紙鏈嶅姟鍣ㄩ厤缃嫆缁濆鏁版嵁婧愮殑璁块棶锛夛紝骞惰兘浠庢湇鍔″櫒涓婃绱㈡秷鎭
-濡傛灉宸插彂鐢熷彉鍖栵紝Autoreconnect浠g爜鍦ㄧ孩蹇冭繛鎺ユ椂涓嶈缃甤atalog銆
-瀹炵幇浜哛esultSet.updateClob()銆
-瀵逛簬CHAR/VARCHAR鍒楋紝ResultSetMetaData.isCaseSensitive()杩斿洖閿欒鍊笺
-鏇存浜BUG#1933锛屼笉灏婇噸杩炴帴灞炴р渕axRows鈥濄
-鏇存浜BUG#1925锛屽湪DBMD.extractForeignKeyFromCreateTable()涓紝鍒涘缓璇彞鐨勬鏁板お澶氥
-鏇存浜BUG#1914锛屾敮鎸佽浆涔夊簭鍒{fn convert ... }
-鏇存浜BUG#1958锛屽綋鍙傛暟缂栧彿绛変簬鍙傛暟鏁扮洰锛1鏃讹紝ArrayIndexOutOfBounds銆
-鏇存浜BUG#2006锛屽綋SELECT鏌ヨ涓湁澶氫釜閲嶅鍒楀悕鏃讹紝ResultSet.findColumn()搴斾娇鐢ㄧ1涓尮閰嶇殑鍒楀悕锛堝吋瀹笿DBC锛夈
-浠嶱reparedStatement.setTimestamp()涓垹闄や簡闈欐佸悓姝ョ摱棰堛
-浠嶴ingleByteCharsetConverter鐨勫疄渚嬫柟娉曚腑鍒犻櫎浜嗛潤鎬佸悓姝ョ摱棰堛
-鍏佽閫氳繃鈥渃achePrepStmts鈥濄佲減repStmtCacheSize鈥濆拰鈥減repStmtCacheSqlLimit鈥濆睘鎬э紝瀵归澶勭悊璇彞鐨勮В鏋愭楠よ繘琛岄珮閫熺紦鍐插鐞嗭紙榛樿鎯呭喌涓嬬姝級銆
-鍔犲揩浜哖reparedStatements鐨勮В鏋愭搷浣滐紝鍙鍙兘锛屽敖閲忛噰鐢ㄤ竴娆℃ф柟寮忋
-鏇存浜嗗湪灏忓簲鐢ㄧ▼搴忎腑浣跨敤鏃剁殑瀹夊叏寮傚父闂锛堝皬搴旂敤绋嬪簭涓嶈兘璇诲彇LOAD DATA LOCAL INFILE鎵闇鐨勭郴缁熷睘鎬р渇ile.encoding鈥濓級銆
-涓篠QLStates浣跨敤甯告暟銆
-杩炴帴鑷矼ySQL-4.1.0鎴栨洿楂樼増鏈椂锛屽皢瀛楃闆嗏渒o18_ru鈥濇槧灏勫埌鈥渒o18r鈥濄
-纭繚Buffer.writeString()淇濆瓨鍦ㄢ\0鈥濅箣澶栫殑绌洪棿鍐呫
-鏇存浜嗏渃onnect w/ JDK-1.4.0鈥濅笂鐨勫紓甯糕滄湭鐭ュ瓧绗﹂泦danish鈥濄
-鏇存浜哠QLError涓殑鏄犲皠鍔熻兘锛岀敤鈥41000鈥漇QLStates閫氭姤姝婚攣鐘舵併
-鈥渕axRows鈥濆睘鎬т細褰卞搷鍐呴儴璇彞锛屽洜姝わ紝搴旀鏌ヤ负椹卞姩绋嬪簭鍒涘缓鐨勬墍鏈夊唴閮ㄨ鍙ワ紝骞跺湪涓嶆槸鍐呴儴璇彞鐨勬儏鍐典笅灏嗗叾璁句负0銆
10-07-03锛氱増鏈3.0.9-stable
-ResultSet鍜孭reparedStatement涓洿蹇殑鏃ユ湡澶勭悊浠g爜锛堜笉鍐嶄娇鐢ㄧ敤鏉ュ悓姝ラ潤鎬佹棩鍘嗙殑Date鏂规硶锛夈
-鏇存浜嗗Buffer.readString()涓紦鍐插尯鏈鐨勬祴璇曘
-鏇存浜哛esultSet.previous()琛屼负鏂瑰紡锛屽綋浣嶄簬缁撴灉闆嗙殑绗1琛屼笂鏃讹紝灏嗗綋鍓嶄綅缃Щ鍒扮粨鏋滈泦涔嬪墠锛坆ugs.mysql.com BUG#496锛夈
-鏇存浜嗗綋宸蹭娇鐢╯etMaxRows()鑰屼笖鍦ㄦ煡璇腑鍖呭惈LIMIT瀛愬彞鏃跺彂鍑轰吉鏌ヨ鐨勮鍙ュ拰PreparedStatement銆
-鏇存浜BUG#661锛屽綋涓婚敭鍊煎寘鍚渶瑕佽浆涔夌殑鍊兼椂refreshRow涓嶅伐浣滐紙浠ュ弻鍊嶈浆涔夌粨鏉燂級銆
-鎻愬彇DatabaseMetaData涓殑澶栭敭淇℃伅鏃讹紝鏀寔InnoDB绾︽潫鍚嶏紝BUG#517鍜BUG#664锛堢敱Parwinder Sekhon鎻愬嚭锛夈
-浠3.1鐗堝紑濮嬶紝鍙嶅悜绉绘浜4.1鍗忚鍙樺寲锛堟湇鍔″櫒绔疭QL鐘舵侊紝鏂板瓧娈典俊鎭紝杈冨ぇ鐨勫鎴风鑳藉姏鏍囧織锛屼笌鏁版嵁搴撶殑杩炴帴绛夛級銆
-鏇存浜哢pdatableResultSet锛屼綔鐢ㄥ湪鎻掑叆琛屼笂鏃讹紝涓篻etXXX()杩斿洖鍊硷紙BUG#675锛夈
-璋冪敤moveToInsertRow()鏃讹紝鑳藉鐢ㄩ粯璁ょ殑鍒楀煎姞杞経pdatableResultSet涓殑insertRow锛BUG#688锛夈
-瀵逛簬鎸囧畾涓篘ULL鐨勯粯璁ゅ硷紝DatabaseMetaData.getColumns()鏈繑鍥濶ULL銆
-灏嗛粯璁ょ殑璇彞绫诲瀷锛忓苟鍙戣鏇存敼涓篢YPE_FORWARD_ONLY鍜孋ONCUR_READ_ONLY锛堝吋瀹硅鑼冿級銆
-濡傛灉MySQL涓嶆敮鎸侊紝涓嶈灏濊瘯鎴栧浣嶅啀杩炴帴涓婄殑闅旂绾у埆銆
-涓嶅皢SQLExceptions灏佸湪RowDataDynamic鍐呫
-濡傛灉useTimezone==true锛屼笉鏇存敼鏃堕棿鎴砊Z涓ゆ锛BUG#774锛夈
-鏇存浜嗗ぇ鐨勫垎绂讳俊鎭寘澶勭悊涓瓨鍦ㄧ殑鍥炲綊闂锛BUG#848锛夈
-鏇村ソ鍦拌瘖鏂滄祦寮忊濈粨鏋滈泦寮傚父涓殑閿欒娑堟伅銆
-鍦ㄧ┖缁撴灉闆嗕笂鎶涘嚭鍏充簬ResultSet.getXXX()鐨勫紓甯革紙鍦ㄦ煇浜涙儏鍐垫湭琚繕鑾凤級銆
-涓嶉殣钘忓叧浜庡湪I/O灞備腑鎶涘嚭寮傚父鐨勬秷鎭
-鍏抽棴杩炴帴姹犳椂鎴栧湪鍏锋湁宸叉墦寮杩炴帴鐨凱ooledConnection.getConnection()涓婏紝涓嶈Е鍙戣繛鎺ュ叧闂椂闂达紙BUG#884锛夈
-鎴煭+/- INF锛堟渶灏忓拰鏈澶т唬琛ㄥ硷紝瀵逛簬MySQL涓殑绫诲瀷锛夛紝浠ュ強NaN锛堣嚦0锛屽浜巗etDouble/setFloat()锛夛紝褰撴湇鍔″櫒涓嶆敮鎸+/- INF鎴朜aN鏃讹紝灏辫鍙ュ彂鍑鸿鍛娿
-鏇存浜BUG#879锛屽綋瀛楃闆嗕负SJIS鎴朑BK鏃讹紝浠ュ強鈥\鈥濆嚭鐜板湪闈炶浆涔夎緭鍏ヤ腑鏃跺鈥\鈥濈殑鍙岃浆涔夊鐞嗐
-娓呯┖鈥滄祦寮忊濈粨鏋滈泦鏈娇鐢ㄨ鐨勮緭鍏ユ祦鏃讹紝姣100琛屽潎鏈夊綋鍓嶇嚎绋媦ield()锛屼互鍏嶇嫭鍗燙PU鏃堕棿銆
-鏇存浜BUG#1099锛孌atabaseMetaData.getColumns()寮勪笉娓呭瓧绗﹀垪涓殑鍏抽敭瀛椻渟et鈥濄
-鏇存浜嗕笌Statement.setMaxRows()鐩稿叧鐨勬閿佷簨瀹溿
-鏇存浜咰LOB.truncate()锛BUG#1130銆
-浼樺寲浜咰LOB.setChracterStream(), BUG#1131銆
-浣縟atabaseName銆乸ortNumber浠ュ強serverName鎴愪负MysqlDataSourceFactory鐨勫彲閫夊弬鏁帮紙BUG#1246锛夈
-淇浜BUG#1247锛屽鑷村瓧绗127鎹熷潖鐨凴esultSet.get/setString銆
-浠3.1鐗堝紑濮嬶紝鍙嶅悜绉绘浜嗛拡瀵4.11鍜屾洿楂樼増鏈殑auth.鏇存敼銆
-澧炲姞浜哻om.mysql.jdbc.util.BaseBugReport锛屼互甯姪鍒涘缓缂洪櫡鎶ュ憡鐨勬祴璇曡寖渚嬨
-閫氳繃灏嗏渃lobberStreamingResults鈥濆睘鎬ц缃负鈥滅湡鈥濓紙榛樿涓衡滃亣鈥濓級锛屼负鈥渃lobber鈥濇祦寮忕粨鏋滃鍔犱簡灞炴с傝繖浼氫娇鈥滄祦寮忊濈粨鏋滈泦琚嚜鍔ㄥ叧闂紝濡傛灉鍦ㄦ墍鏈夋暟鎹皻鏈粠鏈嶅姟鍣ㄤ腑璇诲彇瀹屼箣鍓嶏紝鎵ц浜嗗彟涓鏌ヨ锛屾鍦ㄤ粠鏈嶅姟鍣ㄦ祦鍑虹殑浠讳綍鏈畬鎴愭暟鎹潎灏嗚鑸嶅純銆
05-23-03锛氱増鏈3.0.8-stable
-鍏佽鍦―river.getPropertyInfo()涓娇鐢ㄤ吉URL銆
-涓嶴tatement.getGeneratedKeys()涓璧蜂娇鐢ㄥ鍊糏NSERTS鏃讹紝杩斿洖鎵鐢熸垚閿殑鍒楄〃銆
-涓庢枃浠跺悕鍜屸淟OAD DATA [LOCAL] INFILE鈥濅竴璧蜂娇鐢↗VM瀛楃闆嗐
-鏇存浜嗕笌Connection.cleanup()鏈夊叧鐨勬棤闄愬惊鐜
-灏咥nt鐩爣鈥渃ompile-core鈥濇洿鏀逛负鈥渃ompile-driver鈥濓紝骞朵娇娴嬭瘯濂椾欢缂栬瘧鎴愪负鍗曠嫭鐨勭洰鏍囥
-鏇存浜嗘湭鑾峰緱鍏充簬Statement.executeUpdate()鐨勯泦鍚堢殑缁撴灉闆嗭紝鍦ㄦ煇浜涙儏鍐典笅锛屽畠浼氬奖鍝峠etGeneratedKeys()鍜実etUpdateCount()銆
-瀛楃涓蹭腑鐨刄nicode瀛楃0xFFFF浼氬鑷撮┍鍔ㄧ▼搴忔姏鍑篈rrayOutOfBoundsException锛Bug #378锛夈
-浣跨敤鈥淩EPLACE鈥濊鍙ユ椂杩斿洖鎵鐢熸垚閿殑姝g‘鏁扮洰銆
-鏇存浜嗗湪鏌愪簺鎯呭喌涓嬫娴嬫湇鍔″櫒瀛楃闆嗙殑闂銆
-鏇存浜嗕娇鐢ㄦ瀬澶т俊鎭寘鏃剁殑琛屾暟鎹В鐮侀敊璇
-浼樺寲浜嗚鏁版嵁瑙g爜銆
-鍦ㄥ凡鍏抽棴棰勫鐞嗚鍙ヤ笂鎵ц鎿嶄綔浣挎姏鍑哄紓甯搞
-鏇存浜哠JIS缂栫爜缂洪櫡锛屾劅璋aoto Sato銆
-浼樺寲浜咵scapeProcessor鐨勪娇鐢ㄣ
-鍏佽瀵筍tatement.close()鐨勫娆¤皟鐢ㄣ
04-08-03锛氱増鏈3.0.7-stable
-鏇存浜嗚皟鐢ㄩ敊璇簨浠剁被鍨嬬殑MysqlPooledConnection.close()銆
-鏇存浜哖reparedStatement.setClob()涓殑StringIndexOutOfBoundsException銆
- 4.1鐗堝垪鍏冩暟鎹洿姝c
-浠嶥river.connect()鍜孌river.acceptsUrl()涓垹闄や簡鍚屾鍔熻兘銆
-浜嬪姟杩囩▼涓殑IOExceptions鐜板湪浼氬鑷村叧闂繛鎺ャ
-鏇存浜哛esultSetMetaData.getColumnTypeName()涓涪澶辩殑鈥淵EAR鈥濈被鍨嬭浆鎹€
-瀵逛簬DBMD.getPrimaryKeys()锛屼笉鎻愬彇浠モ減ri鈥濅綔涓轰富閿捣濮嬬殑绱㈠紩銆
-璇曞浘鍦ㄥ己鍒跺叧闂殑杩炴帴涓婃墽琛屾搷浣滄椂鎶涘嚭SQLExceptions锛堝嵆锛岄氫俊閾捐矾澶辫触鏃讹級銆
-鐜板湪锛屽彲浠ヤ娇鐢–onnection.setProfileSql(boolean)鏉ユ墦寮鎴栧叧闂豢鍨嬪姛鑳姐
鏇存浜嗕笌鏁版嵁搴撳厓鏁版嵁鏈夊叧鐨勫瓧绗﹂泦浜嬪疁锛堝瓧绗﹂泦涓嶈兘姝g‘鑾峰彇闆嗗悎锛夈
-涓嶮ySQL-4.1鎴栨洿楂樼増鏈繛鎺ユ椂锛岀幇鍦ㄨ兘澶熶负鍒悕琛/鍒楀垱寤哄彲鏇存柊缁撴灉闆嗐
-鏇存浜嗘枃浠跺ぇ浜庘渕ax_allowed_packet鈥濇椂鐨勨淟OAD DATA LOCAL INFILE鈥濈己闄枫
-瀵逛簬GBK鍜孊ig5瀛楃闆嗭紝鏇存浜0x5c ('\')瀛楃鐨勮浆涔夊姛鑳姐
-鏇存浜嗗熀纭瀛楁涓篋ATE绫诲瀷鏃剁殑ResultSet.getTimestamp()闂銆
-淇濊瘉浜嗘潵鑷猘lignPacketSize()鐨勪俊鎭寘澶у皬涓嶈秴杩嘙AX_ALLOWED_PACKET锛圝VM缂洪櫡锛夈
-autoReconnecting锛堣嚜鍔ㄥ啀杩炴帴锛夋椂涓嶅浣岰onnection.isReadOnly()銆
02-18-03锛氱増鏈3.0.6-stable
-鏇存浜哛esultSetMetaData锛屽綋catalog鏈煡鏃惰繑鍥""銆傛洿姝d簡涓嶴un CachedRowSet鏈夊叧鐨凬ullPointerExceptions銆
-鏇存浜咲BMD.getTypeInfo()鍜孌BMD.getColumns()涓篢EXT/BLOB绫诲瀷涓殑绮惧害杩斿洖涓嶅悓鍊肩殑闂銆
-閫氳繃灏嗏渋gnoreNonTxTables鈥濊缃负鈥滅湡鈥濓紝鍦ㄥ洖閫鏈熼棿锛堝吋瀹规э紡鍙敤鎬э級锛屽厑璁稿拷鐣モ渘on transactional tables鈥濓紙闈炰簨鍔¤〃锛夊憡璀︺
-鏇存浜嗗湪鍒濆杩炴帴涓奡QLExceptions鑰楀敖鐨勯棶棰樸
-鏇存浜哠tatement.setMaxRows()锛屽綋鍏朵笉闇瑕佹椂锛屽仠姝㈠彂閫佲淟IMIT鈥濈被鍨嬬殑鏌ヨ锛堟ц兘锛夈
-鏁寸悊浜嗚鍙ユ煡璇/鏂规硶澶遍厤娴嬭瘯锛堝嵆锛屼笉鍏佽涓.executeQuery()涓璧蜂娇鐢↖NSERT锛夈
-鍦≧esultSet閬嶅巻鏂规硶涓鍔犱簡鏇村妫鏌ワ紝浠ヨ幏鍙栦綍鏃跺浜庡叧闂姸鎬佺殑淇℃伅銆
-鏇存浜哛esultSetMetaData.isWritable()浠ヨ繑鍥炴纭笺
-涓篋BMD.nullsAreSortedAtStart澧炲姞浜嗕笉鍚孨ULL鍒嗙被琛屼负鐨勨滅獥鍙b濓紙4.0.2鑷4.0.10锛岀湡锛屽叾浠栦负鈥滃惁鈥濓級銆
-瀹炵幇浜咮lob.setBytes()銆備粛闇瑕佸皢鎵寰楃殑Blob浼犲洖鍒板彲鏇存柊ResultSet锛堢粨鏋滈泦锛夋垨PreparedStatement浠ヤ繚鎸佸彉鏇达紝杩欐槸鍥犱负MySQL涓嶆敮鎸佲滃畾浣嶅櫒鈥濄
-浠嶤onnector/J 3.1鍙嶅悜绉绘浜4.1瀛楃闆嗗瓧娈点
01-22-03锛氱増鏈3.0.5-gamma
-鏇存浜嗚В鍖呭瓧娈垫椂瀵规煇浜涙煡璇uffer.fastSkipLenString()瀵艰嚧ArrayIndexOutOfBounds寮傚父鐨勯棶棰樸
-涓篊onnection.getTypeMap()瀹炵幇浜嗙┖鐨凾ypeMap锛屼互渚挎煇浜涚涓夋柟搴旂敤绋嬪簭鑳戒笌MySQL涓璧峰伐浣滐紙IBM WebSphere 5.0杩炴帴姹狅級銆
-涓篋BMD.getColumns()澧炲姞浜嗕涪澶辩殑LONGTEXT绫诲瀷銆
-褰揗ySQL鐗堟湰鏀寔鏃讹紝Connection.getTransactionIsolation()鑳戒粠鏁版嵁搴撴绱X_ISOLATION锛岃屼笉鏄疄渚嬪彉閲忋
-寮曠敤DatabaseMetaData.getColumns()銆乬etPrimaryKeys()銆乬etIndexInfo()銆乬etBestRowIdentifier()涓殑琛ㄥ悕銆
-澶у箙搴﹂檷浣庝簡PreparedStatements涓璼etBinaryStream()鎵闇鐨勫唴瀛樸
-鏇存浜哛esultSet.isBeforeFirst()澶勭悊绌虹粨鏋滈泦鏂归潰鐨勯棶棰樸
-涓哄閿厓鏁版嵁澧炲姞浜嗏滄洿鏂扳濋夐」銆
01-06-03锛氱増鏈3.0.4-gamma
-涓篊onnection.setCatalog澧炲姞浜嗗鏁版嵁搴撳悕鐨勫紩鐢↖D銆
-鍦≒reparedStatement鍒嗘瀽绋嬪簭涓鍔犱簡瀵瑰紩鐢↖D鐨勬敮鎸併
-瀵逛簬setByte()锛屽湪PreparedStatements涓紝娴佺嚎寮忓瓧绗﹁浆鎹㈠拰byte[]澶勭悊銆
-閫氳繃涓嶮ysqlIO鍏变韩鍑虹珯淇℃伅鍖咃紝闄嶄綆浜哖reparedStatements鐨勫唴瀛樺崰鐢ㄣ
-澧炲姞浜嗏渟trictUpdates鈥濆睘鎬э紝鑳藉瀵瑰彲鏇存柊缁撴灉闆嗙殑澶ч噺鈥滄纭р濇鏌ヨ繘琛屾帶鍒躲傚鏋滃笇鏈涜幏寰楁洿蹇殑鍙洿鏂扮粨鏋滈泦锛屽苟浣跨敤涓婚敭閫氳繃浣滅敤鍦ㄨ〃涓婄殑SELECT鍒涘缓浜嗙粨鏋滈泦锛岃屼笖鍦ㄦ煡璇腑閫夋嫨浜嗘墍鏈夌殑涓婚敭锛屽簲灏嗗叾璁剧疆涓衡滃亣鈥濄
-澧炲姞浜嗗4.0.8椋庢牸澶т俊鎭寘鐨勬敮鎸併
-鏇存浜哖reparedStatement.executeBatch()鍙傛暟閲嶅啓鐨勯棶棰樸
12-17-02锛氱増鏈3.0.3-dev
-灏哠ingleByteCharConverter涓殑charsToByte鏇存敼涓洪潪闈欐佺被鍨嬨
-鏇存敼浜哠ingleByteCharConverter锛屼互浣跨敤鍚勮浆鎹㈠櫒鐨勭┖闂插垵濮嬪寲鐗规с
-鏇存浜咶ields.java涓殑瀛楃闆嗗鐞嗗姛鑳姐
-瀹炵幇浜咰onnection.nativeSQL()銆
-鏇村彲闈犵殑杞箟鏍囧織鈥-- recognize '--'鈥濇敞閲婏紝骞跺厑璁稿祵濂楀紡杞箟搴忓垪锛堣鍙傝testsuite.EscapeProcessingTest锛夈
-DBMD.getImported/ExportedKeys()鐜板湪鑳藉鐞嗘瘡涓〃涓婄殑澶氫釜澶栭敭銆
-鏇存浜嗗鏌愪簺娴偣绫诲瀷ResultSetMetaData.getPrecision()杩斿洖閿欒鍊肩殑闂銆
-鏇存浜哛esultSetMetaData.getColumnTypeName()瀵筎EXT绫诲瀷杩斿洖BLOB锛屽BLOB绫诲瀷杩斿洖TEXT鐨勯棶棰樸
-瀵逛簬4.1鍜屾洿楂樼増鏈湇鍔″櫒锛屾洿姝d簡Buffer.isLastDataPacket()銆
-澧炲姞浜咰LIENT_LONG_FLAG锛屼互渚胯兘鑾峰緱鏇村鐨勫垪鏍囧織锛坕sAutoIncrement()鏈閲嶈锛夈
-鐢变簬涓婅堪鍘熷洜锛屽疄鐜颁簡ResultSetMetaData.isAutoIncrement()浠ヤ娇鐢‵ield.isAutoIncrement()銆
-鍦―atabaseMetaData鏂规硶涓瘮杈冭〃鍚嶄笖鍦ㄦ湇鍔″櫒涓厑璁告椂锛屼紭鍏堣冭檻鈥渓ower_case_table_names鈥濄
-涓浜汳ySQL-4.1鍗忚鏀寔锛堟墿灞曞瓧娈典俊鎭級銆
-浣跨敤闈炲埆鍚嶈〃/鍒楀悕鍜屾暟鎹簱鍚嶏紝浠ュ畬鍏ㄩ檺瀹歎pdatableResultSet涓殑琛ㄥ拰鍒楋紙闇瑕丮ySQL-4.1鎴栨洿楂樼増鏈級銆
-鍏佽鐢ㄦ埛閫氳繃鈥渃ontinueBatchOnError鈥濆睘鎬э紙榛樿涓衡滅湡鈥濓級鏇存敼Statement/PreparedStatement.executeBatch()鐨勮涓恒
-鍦ㄦ洿澶氳繛鎺ユ柟娉曪紙createStatement銆乸repareStatement銆乻etTransactionIsolation銆乻etAutoCommit锛変腑妫鏌ュ叧闂殑杩炴帴銆
-鏇村彲闈犲湴瀹炵幇浜嗗彲鏇存柊缁撴灉闆嗐傛鏌ヨ〃鐨勬墍鏈変富閿槸鍚﹀凡琚夋嫨銆
-濡傛灉鍦ㄦ湇鍔″櫒鐨勯厤缃厑璁革紝鈥淟OAD DATA LOCAL INFILE ...鈥濈幇鍦ㄨ兘姝e父宸ヤ綔銆備笉鑳戒娇鐢ㄢ渁llowLoadLocalInfile鈥濆睘鎬у叧闂畠锛堣鍙傝README锛夈
-鍦ㄥ崟瀛楄妭瀛楃闆嗕腑锛屽浜庢湭鐭ョ殑瀛楃杞崲锛岀敤鈥?鈥濇浛浠b\0鈥濄
- NamedPipeSocketFactory鐜拌兘姝e父宸ヤ綔锛堜粎瀵筗indows骞冲彴锛夈傚叿浣撹鏄庤鍙傝README銆
11-08-02锛氱増鏈3.0.2-dev
-鏇存浜嗗彲鏇存柊缁撴灉闆嗗拰PreparedStatements涓嶅伐浣滅殑闂銆
-鏇存浜哛esultSet.setFetchDirection(FETCH_UNKNOWN)銆
-鏇存浜嗕娇鐢ㄤ换鎰忓煎苟璋冪敤Statement.setFetchSize()鏃剁殑闂銆
-鏇存浜哛esultSet.getLong()涓殑涓嶆纭浆鎹€
-瀹炵幇浜哛esultSet.updateBlob()銆
-鍒犻櫎浜哢pdatableResultSet涓殑閲嶅浠g爜锛堣兘浠嶳esultSet缁ф壙鑰屾潵锛屼笉闇瑕佸悇鏂规硶澶勭悊鍙洿鏂版х殑棰濆浠g爜锛屼絾鎴戣涓哄湪灏嗘潵鍙兘闇瑕侊級銆
-鏇存浜嗛氳繃灞炴р滃己鍒垛濆瓧绗︾紪鐮佹椂鎶涘嚭鐨勨淯nsupportedEncodingException鈥濄
-鏇存浜嗗悇绉嶉潪ASCII瀛楃缂栫爜闂銆
-澧炲姞浜嗛┍鍔ㄧ▼搴忓睘鎬р渦seHostsInPrivileges鈥濄傞粯璁ゅ间负鈥滅湡鈥濄傚畠灏嗗奖鍝嶆槸鍚﹀湪鈥淒BMD.getColumn/TablePrivileges鈥濅腑浣跨敤鈥淍hostname鈥濄
-鎻忚堪鏂规鐨勬墍鏈塂BMD缁撴灉闆嗗垪鐜拌繑鍥濶ULL锛屼互渚胯兘涓庣敤浜庡叾浠栨暟鎹簱鐨勫叾浠朖DBC椹卞姩绋嬪簭鐨勮涓烘洿鍏煎锛圡ySQL涓嶆敮鎸佹柟妗堬級銆
-澧炲姞浜哠SL鏀寔銆傚叧浜庡浣曚娇鐢ㄥ畠鐨勬洿澶氫俊鎭紝璇峰弬瑙丷EADME銆
-鎵ц鑷姩鍐嶈繛鎺ユ垨鏁呴殰鍒囨崲鏃讹紝鎭板綋鎭㈠杩炴帴灞炴э紝鍖呮嫭autoCommit鐘舵佷互鍙婇殧绂荤骇鍒
-鍙兘鏃讹紝浣跨敤鈥淪HOW CREATE TABLE鈥濓紝浠ョ‘瀹氱敤浜嶥atabaseMetaData鐨勫閿俊鎭紝瀵逛簬杩斿洖鐨凞ELETE淇℃伅杩樺厑璁哥骇鑱旈夐」銆
-瀵逛簬SJIS瀛楃闆嗭紝杞箟浜嗗瓧绗︿覆涓殑鈥0x5c鈥濆瓧绗︺
-鏇存浜咰lob.getSubString()涓捣濮嬩綅缃亸绂1鐨勯敊璇
-瀹炵幇浜咰lob.truncate()銆
-瀹炵幇浜咰lob.setString()銆
-瀹炵幇浜咰lob.setAsciiStream()銆
-瀹炵幇浜咰lob.setCharacterStream()銆
-澧炲姞浜哻om.mysql.jdbc.MiniAdmin绫伙紝璇ョ被鍏佽浣犲皢鈥渟hutdown鈥濆懡浠ゅ彂閫佽嚦MySQL鏈嶅姟鍣ㄣ傚湪鏈缁堢敤鎴峰簲鐢ㄤ腑宓屽叆Java鍜孧ySQL鏈嶅姟鍣ㄦ椂浣跨敤銆
-澧炲姞浜嗏渃onnectTimeout鈥濆弬鏁帮紝鍏佽JDK-1.4鍜屾洿楂樼増鏈殑鐢ㄦ埛鎸囧畾寤虹珛杩炴帴鎵闇绛夊欑殑鏈闀挎椂闂淬
-浠呭綋杩炴帴澶勪簬autoCommit(false)鐘舵佹椂锛屾晠闅滃垏鎹㈠拰autoReconnect鎵嶈兘宸ヤ綔锛岀洰鐨勫湪浜庝繚鎸佷簨鍔$殑瀹夊叏銆
-澧炲姞浜嗏渜ueriesBeforeRetryMaster鈥濆睘鎬э紝鍑虹幇鏁呴殰鍒囨崲鏃惰屼笖鍦ㄩ噸鏂拌繛鎺ュ埌涓绘湇鍔″櫒涔嬪墠锛岃灞炴ф寚瀹氫簡鑳藉鍙戝嚭鐨勬煡璇㈡暟鐩紙榛樿涓50锛夈
-鏇存浜咲BMD.supportsResultSetConcurrency()锛屼互渚夸负ResultSet.TYPE_SCROLL_INSENSITIVE鍜孯esultSet.CONCUR_READ_ONLY鎴朢esultSet.CONCUR_UPDATABLE杩斿洖鈥滅湡鈥濄
-鏇存浜哛esultSet.isLast()澶勭悊绌虹粨鏋滈泦鏂归潰鐨勯棶棰橈紙搴旇繑鍥炩滃亣鈥濓級銆
- PreparedStatement鐜板湪灏嗕紭鍏堣冭檻setBinary/Ascii/Character Stream()涓殑娴侀暱搴︼紝闄ら潪灏嗚繛鎺ュ睘鎬р渦seStreamLengthsInPrepStmts鈥濊缃负鈥滃亣鈥濄
-鍒犻櫎浜嗕竴浜涗娇鐢‥scapeProcessor銆丆onnection鍜孌atabaseMetaData绫讳腑鐨勨淪trings smarter鈥濆垱寤虹殑涓嶉渶瑕佺殑涓存椂瀵硅薄銆
09-21-02锛氱増鏈3.0.1-dev
-鏇存浜哛esultSet.getRow()鍋忓樊1鐨勭己闄枫
-鏇存浜哛owDataStatic.getAt()鍋忓樊1鐨勭己闄枫
-澧炲姞浜嗘湁闄怌lob鍔熻兘锛圧esultSet.getClob()銆丳reparedStatemtent.setClob()銆丳reparedStatement.setObject(Clob)锛夈
-涓篣RL澧炲姞浜唖ocketTimeout鍙傛暟銆
- Connection.isClosed()涓嶅啀瀵规湇鍔″櫒鎵ц鈥淧ing鈥濇搷浣溿
-褰撯済etAutoCommit() == false鈥濇椂Connection.close()鍙戝嚭rollback()銆
-澧炲姞浜嗏滃鎯斥濆弬鏁帮紝閫氳繃鍒犻櫎鍏朵腑鐨勨滄晱鎰熲濅俊鎭竻鐞嗕簡閿欒娑堟伅锛堝嵆锛屼富鏈哄悕銆佺鍙c佺敤鎴峰悕绛夛級锛屽苟鍦ㄥ彲鑳界殑鎯呭喌涓嬶紝娓呯悊浜嗏滄晱鎰熲濈殑鏁版嵁缁撴瀯銆
-鏇存浜哛esultSetMetaData.isSigned()鍦ㄥ鐞員INYINT鍜孊IGINT鏂归潰鐨勯棶棰樸
- 鐜板湪灏嗚嚜鍔ㄦ娴嬪瓧绗﹂泦銆備紭鍖栦簡鍗曞瓧鑺傚瓧绗﹂泦杞崲鐨勪唬鐮併
-瀹炵幇浜哛esultSet.getCharacterStream()銆
-涓篋atabaseMetaData.getTableTypes()涓殑琛ㄧ被鍨嬪鍔犱簡鈥淟OCAL TEMPORARY鈥濄
- 鏁寸悊浜嗗ぇ鍧椾唬鐮侊紝浠ラ伒寰狫ava缂栫爜鎯緥锛堟椂鏈烘垚鐔燂級銆
07-31-02锛氱増鏈3.0.0-dev
- !!! 璁稿彲鍙樺寲!!! 椹卞姩鐜板湪鏄疓PL銆傚鏋滈渶瑕侀潪GPL璁稿彲锛岃涓庢垜浠仈绯伙紙mark@mysql.com锛夈
- JDBC-3.0鍔熻兘鍖呮嫭Statement/PreparedStatement.getGeneratedKeys()鍜孯esultSet.getURL()銆
-鎬ц兘澧炲己锛屽湪澶у鏁版儏鍐典笅锛岄┍鍔ㄧ▼搴忓揩浜50-100锛咃紝鑰屼笖鍒涘缓鐨勪复鏃跺璞℃洿灏戙
-閲嶆柊灏佽...鏂扮殑椹卞姩绋嬪簭鍚嶆槸鈥渃om.mysql.jdbc.Driver鈥濓紝浣嗘棫鍚嶇О渚濈劧鏈夋晥锛堥┍鍔ㄧ▼搴忕幇鐢盡ySQL-AB鎻愪緵锛夈
-鏇村ソ鍦板湪璇彞鍜孭reparedStatement涓鏌ュ凡鍏抽棴鐨勮繛鎺ャ
-鏀寔娴佸紡缁撴灉闆嗭紙鎸夎锛夛紝璇峰弬瑙丷EADME锛屾劅璋oron銆
-鏀寔澶т俊鎭寘锛圡ySQL-4.0鍗忚鐨勬柊澧炲唴瀹癸級锛屾洿澶氫俊鎭鍙傝README銆
- JDBC鍏煎锛岄櫎浜嗗瓨鍌ㄧ▼搴忔祴璇曞锛屾彁渚涗簡鎵鏈夋祴璇曘
-鏇存骞跺垎绫讳簡DBMetaData涓殑涓婚敭鍚嶇О锛圫F缂洪櫡582086鍜582086锛夈
-娴偣绫诲瀷鐜颁负java.sql.Types.FLOAT锛圫F缂洪櫡579573锛夈
- ResultSet.getTimestamp()鐜板湪鑳藉鐞咲ATE绫诲瀷锛圫F缂洪櫡559134锛夈
- ResultSet.getDate/Time/Timestamp鐜板湪鑳借瘑鍒敱MySQL璁剧疆涓哄叏闆剁殑鎵鏈夊舰寮忕殑鏃犳晥鍊硷紙SF缂洪櫡586058锛夈
- Testsuite鐜板湪灏嗕娇鐢↗unit锛堝彲浠www.junit.org鑾峰緱锛夈
-椹卞姩绋嬪簭鐜板湪浠呰兘涓嶫DK-1.2鎴栨洿楂樼増鏈竴璧峰伐浣溿
-澧炲姞浜嗗涓绘満鏁呴殰鍒囨崲鏀寔锛堣鍙傝README锛夈
-杩涜浜嗕竴鑸х殑婧愮爜娓呯悊銆
-璇诲彇淇℃伅鍖呮椂锛岄氳繃鎺у埗MysqlIO绫诲垱寤虹殑杩囨浮瀵硅薄锛屾敼鍠勪簡鎬荤殑閫熷害銆
-鏀瑰杽浜嗗瓧绗︿覆澶勭悊鍜屽瓧娈靛厓鏁版嵁鍒涘缓鐨勬ц兘锛堜緥绀猴級锛岀敱Alex Twisleton-Wykeham-Fiennes鎻愪緵銆
05-16-02锛氱増鏈2.0.14
-鏇村浠g爜鏁寸悊銆
- PreparedStatement鐜板湪鑳介噴鏀.close()涓婄殑璧勬簮锛圫F缂洪櫡553268锛夈
-濡傛灉鏈嶅姟鍣ㄧ増鏈笉鏀寔锛屼笉浣跨敤寮曠敤ID銆傛澶栵紝濡傛灉鏈嶅姟鍣ㄦ槸浠モ鈥ansi鈥濇垨鈥--sql-mode=ANSI_QUOTES鈥濆紑濮嬶紝閭d箞鈥"鈥濆皢鐢ㄤ綔ID寮曠敤锛屽惁鍒欏皢浣跨敤鈥渀鈥濄
- ResultSet.getDouble()鐜板湪鑳芥洿鍑嗙‘鍦颁娇鐢↗DK鍐呯疆鐨勪唬鐮侊紙浣嗚緝鎱級銆
- LogicalHandle.isClosed()璋冪敤锛岀洿鑷崇墿鐞嗚繛鎺ャ
-澧炲姞浜哠QL浠垮瀷鍔熻兘锛堝埌STDERR锛夈傚湪JDBC url涓缃減rofileSql=true鈥濄傛洿澶氫俊鎭鍙傝README銆
-鏇存浜唕elaxAutoCommit鍙傛暟鐨勭被鍨嬨
04-24-02锛氱増鏈2.0.13
-鏇村浠g爜鏁寸悊銆
-鏇存浜嗘湭鑳芥纭鍙栫殑unicode瀛楃锛圫F缂洪櫡541088锛夈
-涓篜repStmt鎻愪緵浜嗘洿蹇殑Blob杞箟鍔熻兘銆
-涓篋ataSource(s)澧炲姞浜唖et/getPortNumber()锛圫F缂洪櫡548167锛夈
-涓篗ySQLXADataSource澧炲姞浜唖etURL()锛圫F缂洪櫡546019锛夈
-鏇存浜哖reparedStatement.toString()锛圫F缂洪櫡534026锛夈
-瀹炵幇浜哛esultSetMetaData.getColumnClassName()銆
- 鐜板湪瀹炴柦浜嗘潵鑷狫DBC-3.0鐨凷tatement.getGeneratedKeys()鐨勫垵绾х増鏈紙瑕佹兂浣夸箣宸ヤ綔锛岄渶瑕佷娇鐢↗DK-1.4锛屾垜涓汉璁や负锛夈
- DBMetaData.getIndexInfo()锛屾洿姝d簡涓嶈壇鐨凱AGES锛圫F缂洪櫡542201锛夈
04-07-02锛氱増鏈2.0.12
-涓鑸т唬鐮佹暣鐞嗐
-涓篊onnection鍜孧ysqlLogicalHandle澧炲姞浜唃etIdleFor()鏂规硶銆
-鏀炬澗浜嗘墍鏈夌被涓殑鍔熻兘锛屽簲鏇存520615鍜520393銆
-涓篋BMD澧炲姞浜唃etTable/ColumnPrivileges()锛堟洿姝484502锛夈
-涓篻etTypeInfo()澧炲姞浜嗘柊绫诲瀷锛屾洿姝d簡宸叉湁绫诲瀷锛屾劅璋l Davis鍜孠id Kalanon銆
-涓篜reparedStatement澧炲姞浜咮IT绫诲瀷鏀寔锛51870锛夈
-鏇存浜哛esultSet涓殑getRow()缂洪櫡锛527165锛夈
-鏇存浜哖reparedStatement涓殑ResultSet鍙洿鏂版с
-鏇存浜哖reparedStatement涓椂鍖哄亸宸1灏忔椂鐨勭己闄凤紙538286銆528785锛夈
- ResultSet: 鏇存浜嗗彲鏇存柊鎬э紙濡傛灉涓嶅彲鏇存柊锛屽皢鍊艰涓篘ULL锛夈
- DataSources锛屾洿姝d簡setUrl缂洪櫡锛511614銆525565锛夛紝閿欒鐨勬暟鎹簮绫诲悕锛532816銆528767锛夈
-涓洪渶瑕佸畠浠殑鎵鏈塂atabaseMetaData鏂规硶澧炲姞浜咺D寮曠敤锛堝簲鏇存518108锛夈
-澧炲姞浜嗗YEAR绫诲瀷鐨勬敮鎸侊紙533556锛夈
- ResultSet.insertRow()鐩墠鑳藉鍦ㄥぇ澶氭暟鎯呭喌涓嬫娴媋uto_increment瀛楁锛屽苟鍦ㄦ柊琛屼腑浣跨敤璇ュ笺備絾鏄紝璇ユ娴嬩笉閫傜敤浜庡鍊奸敭锛屽師鍥犲湪浜嶮ySQL鍗忚涓嶈繑鍥炶绫讳俊鎭
-瀹炵幇浜哛esultSet.refreshRow()銆
-鏇存浜唗estsuite.Traversal afterLast()缂洪櫡锛屾劅璋gor Lastric銆
01-27-02锛氱増鏈2.0.11
-鏇存浜DBMD.getImported/ExportedKeys()鍜getCrossReference()涓涪澶辩殑DELETE_RULE鍊笺
-Statement.java鐨勫畬鍏ㄥ悓姝ャ
-澶氬淇敼锛屾洿姝d簡璇诲彇BLOB鏃剁殑鈥淯nexpected end of input stream鈥濓紙杈撳叆娴佹剰澶栫粨鏉燂級閿欒銆傝繖搴旀槸鏈鍚庢洿姝c
01-24-02锛氱増鏈2.0.10
-鏇存浜哅ysqlIO涓殑铏氬亣鈥淯nexpected end of input stream鈥濓紙杈撳叆娴佹剰澶栫粨鏉燂級閿欒锛堢己闄507456锛夈
-鏇存浜嗕笌Websphere 4涓璧蜂娇鐢∕ysqlConnectionPoolDataSource鏃剁殑鈥渘ull-pointer-exceptions鈥濓紙缂洪櫡505839锛夈
01-13-02锛氱増鏈2.0.9
- Ant鍒涘缓澶辫触锛屽寘鎷琷ar鏂囦欢锛屽凡鏇存锛堢己闄487669锛夈
-鏇存浜哅ysqlIO.readPacket()涓澶栫殑鍐呭瓨鍒嗛厤锛堢己闄488663锛夈
-瀹炵幇浜咲atabaseMetaData.getExported/ImportedKeys()鍜実etCrossReference()銆
-鍦ㄦ洿鏀瑰疄渚嬪拰绫诲叡浜紩鐢ㄧ殑鏂规硶涓婏紝瀹炵幇浜嗗畬鍏ㄥ悓姝ワ紝椹卞姩绋嬪簭鐜板湪鏄畬鍏ㄧ嚎绋嬪畨鍏ㄧ殑锛堝鏋滈亣鍒伴棶棰橈紝璇峰憡璇夋垜锛夈
-灏咲ataSource瀹炴柦绉昏嚦org.gjt.mm.mysql.jdbc2.optional杞欢鍖咃紝PooledConnectionDataSource鍜孹ADataSource鐨勫師濮嬪疄鏂戒粛淇濈暀鍦ㄥ師澶勶紙鎰熻阿Todd Wolff缁欏嚭浜哖ooledConnectionDataSource涓嶪BM WebSphere 4涓璧风殑瀹炴柦鏂规鍜屾祴璇曠粨鏋滐級銆
-澧炲姞浜嗚鍙栦俊鎭寘鏃跺鍏抽棴缃戠粶杩炴帴鐨勬娴嬶紙鎰熻阿Todd Lizambri锛夈
-鏇存浜嗕笌杞箟澶勭悊鍏舵湁鍏崇殑閿欒锛堢己闄486265锛夈
-閫氳繃DatabaseMetaData锛屾敮鎸佹壒鏇存柊锛堢己闄495101锛夈
-鏇存浜哖reparedStatement.setTimestamp()涓亸宸1灏忔椂鐨勯敊璇紙缂洪櫡491577锛夈
-浠庨┍鍔ㄧ▼搴忎腑鍒犻櫎浜嗙骇杩炴敮鎸侊紙鈥渱|鈥濇搷浣滅锛夛紝杈冩棭鐨刅isualAge鐗堟湰浼间箮鏄娇鐢ㄥ畠鐨勫敮涓杞欢锛屽畠涓庨昏緫鈥渱|鈥濇搷浣滅鍐茬獊銆傝鎯充娇鐢ㄢ渱|鈥濇搷浣滅浣滀负绾ц仈锛岄渶瑕佺敤鈥--ansi鈥濇爣蹇楀惎鍔╩ysqld锛堢己闄491680锛夈
-鏇存浜哖reparedStatement涓殑鑸嶅純缂洪櫡锛488663锛夈
11-25-01锛氱増鏈2.0.8
-鐜板湪鏀寔鎵规洿鏂帮紙鎰熻阿Daniel Rall鐨勯紦鍔憋級銆
- XADataSource/ConnectionPoolDataSource浠g爜锛堝疄楠屾э級銆
- PreparedStatement.setAnyNumericType()鐜板湪鑳芥纭鐞嗘鎸囨暟锛堝鍔犱簡鈥+鈥濓紝鍥犳MySQL鑳界悊瑙e畠锛夈
- DatabaseMetaData.getPrimaryKeys()鍜実etBestRowIdentifier()鐩墠鍦ㄨ瘑鍒富閿柟闈㈡洿鍔犲彲闈狅紙鍖归厤锛屼笉绠′富閿湪Key_type鍒椾腑鐨勫ぇ灏忓啓銆佹垨缂╁啓锛忓叏鍚嶏級銆
10-24-01锛氱増鏈2.0.7
- PreparedStatement.setCharacterStream()鐜板凡瀹炵幇銆
-鏇存浜嗗浜庨珮鍒╃敤鐜囨ā寮忥紙autoReconnect=true锛変笅鏃剁殑鎮寕濂楁帴瀛楅棶棰橈紝杩炴帴鐨刦inalizer灏嗗叧闂换浣曞湪GC涓婃偓鎸傜殑濂楁帴瀛椼
-鏇存浜嗗湪杈冩柊鐗堟湰鐨凪ySQL涓奟esultSetMetaData.getPrecision()杩斿洖鐨勫兼瘮瀹為檯鍊煎皬1鐨勯棶棰樸
-濡傛灉鍒楀间负NULL锛孯esultSet.getBlob()鐜板湪灏嗚繑鍥濶ULL銆
-濡傛灉useUnicode=true鑰屼笖鏈缃甤haracterEncoding锛屽皢浠庢暟鎹簱璇诲彇瀛楃闆嗐傦紙鎰熻阿Dmitry Vereshchagin锛夈
-浠庢暟鎹簱璇诲彇鍒濆浜嬪姟闅旂绾у埆锛堝鏋滃彲鐢ㄧ殑璇濓級锛堟劅璋mitry Vereshchagin锛夈
-鏇存浜咲atabaseMetaData.supportsTransactions()锛宻upportsTransactionIsolationLevel()锛実etTypeInfo() SQL_DATETIME_SUB锛屼互鍙婁笉鍙鍙栫殑SQL_DATA_TYPE瀛楁銆
-鏇存浜嗙敤浜庣敓鎴怱QL骞跺洖鍦ㄦ煇浜涙煡璇腑浠ヨ娉曢敊璇粨鏉熺殑PreparedStatement銆
-鏇存浜哛esultSet.isAfterLast()鎬昏繑鍥炩滃亣鈥濈殑闂銆
-鏇存浜哖reparedStatement.setTimestamp()涓殑鏃跺尯闂锛堟劅璋rik Olofsson锛夈
-鍦║RL鎴栧睘鎬т腑浼犻掍簡鈥渃aptializeTypeNames=true鈥濇椂锛屽皢绫诲瀷鍚嶈浆鎹负澶у啓锛堝浜嶹ebObjects锛屾劅璋njo Krank锛夈
-鍙洿鏂扮粨鏋滈泦鐜板湪鑳芥纭鐞嗗瓧娈典腑鐨凬ULL鍊笺
- PreparedStatement.setDouble()鐜板湪鑳戒娇鐢ㄥ弻绮惧害鍊硷紙鎾ら攢浜嗕互鍓嶆墍浣滅殑鎴彇鏇存锛夈
-濡傛灉MySQL鐨勭増鏈珮浜庢垨绛変簬3.21.23锛孭reparedStatement.setBoolean()灏嗕娇鐢1/0鍊笺
06-16-01锛氱増鏈2.0.6
-鏇存浜哖reparedStatement鍙傛暟妫鏌ュ姛鑳姐
-鏇存浜哛esultSet.java涓尯鍒嗗ぇ灏忓啓鐨勫垪鍚嶃
06-13-01锛氱増鏈2.0.5
- 鏇存浜哛esultSet.getBlob() ArrayIndex瓒呭嚭鑼冨洿鐨勯棶棰樸
-鏇存浜哛esultSetMetaData.getColumnTypeName鍏充簬TEXT/BLOB鐨勯棶棰樸
-鏇存浜嗗彂閫佸ぇBLOB鏌ヨ鏃剁殑ArrayIndexOutOfBounds闂锛堟湭璁剧疆鏈澶т俊鎭寘澶у皬锛夈
-涓篊onnection.setIsolationLevel()澧炲姞浜咺SOLATION绾у埆鏀寔銆
-鏇存浜嗘墍鏈夊垪鍧囨湭璁剧疆鏃跺湪PreparedStatement.executeUpdate()涓婄殑NPE闂銆
-鏇存浜嗛噰鐢ㄤ袱浣嶆暟瀛楀勾浠界殑TIMESTAMP鐨勬暟鎹В鏋愰棶棰樸
-涓篜reparedStatement.setObject()澧炲姞浜咮yte銆
- ResultSet.getBoolean()鐜板湪鑳藉皢鈥-1鈥濊瘑鍒负鈥滅湡鈥濄
- ResultSet鍏锋湁+/-Inf/inf鏀寔鐗规с
-鍗充娇骞堕潪鎵鏈夊垪鍧囧凡琚缃紙璁句负NULL锛夛紝ResultSet.insertRow()鐜板湪涔熻兘宸ヤ綔銆
- DataBaseMetaData.getCrossReference()涓嶅啀浣跨敤ArrayIndexOOB銆
-浣滅敤鍦ㄧ粨鏋滈泦涓婄殑getObject()鑳芥纭墽琛孴INYINT->Byte鍜孲MALLINT->Short鎿嶄綔銆
12-03-00锛氱増鏈2.0.3
-涓篔DBC2瀹炵幇浜嗕笉甯︽爣搴︾粍鍒嗙殑getBigDecimal()銆
-鏇存浜嗕笌鍙洿鏂扮粨鏋滈泦鏈夊叧鐨勫鍚堥敭闂銆
-澧炲姞浜-/+INF瀵瑰弻绮惧害鐨勬娴嬨
-鏇村揩鐨凙SCII瀛楃涓叉搷浣溿
-鏇存浜哅AX_ALLOWED_PACKET鐨勪笉姝g‘妫娴嬶紝鍥犳锛岀幇鍦ㄨ兘鍙戦佸ぇ鐨凚lob銆
-鏇存浜唈ava.sql.Blob瀹炴柦浠g爜涓殑鈥滃亸宸1鈥濋敊璇
-澧炲姞浜嗏渦ltraDevHack鈥漊RL鍙傛暟锛屽皢鍏惰缃负鈥滅湡鈥濓紝鍙厑璁窶acromedia UltraDev浣跨敤璇ラ┍鍔ㄧ▼搴忋
04-06-00锛氱増鏈2.0.1
-鏇存浜哛SMD.isWritable()杩斿洖閿欒鍊肩殑闂銆傛劅璋oritz Maass銆
-鏁寸悊浜嗚繛鎺ョ‘瀹氭椂鐨勫紓甯稿鐞嗗姛鑳姐
-浣跨敤getObject()锛屽叿鏈塗EXT绫诲瀷鐨勫垪鐜板湪浼氫綔涓哄瓧绗︿覆杩斿洖銆
- DatabaseMetaData.getPrimaryKeys()鐜板湪鑳芥纭伐浣滐紙鍐欏叆鍒発ey_seq锛夈傛劅璋rian Slesinsky銆
-鎸夌収JDBC瑙勮寖锛屽湪PreparedStatements涓婏紝涓嶅啀杩涜杞箟澶勭悊銆
-鏇存浜嗗緢澶欽DBC-2.0閬嶅巻銆佸畾浣嶉敊璇紝灏ゅ叾鏄啓鍏ョ┖缁撴灉闆嗙殑闂銆傛劅璋on Smits銆丯ick Brook銆丆essar Garcia鍜孋arlos Martinez銆
-鏇存浜嗕娇鐢ㄥ涓富閿椂锛屼笌缁撴灉闆嗕腑鍙洿鏂版ф敮鎸佹湁鍏崇殑涓浜涢棶棰樸
02-21-00锛氱増鏈2.0pre5
-鏇存浜嗕笉鑹殑鎻℃墜闂銆
01-10-00锛氱増鏈2.0pre4
-鏇存浜嗛拡瀵筰nsertRow()鐨勭粨鏋滈泦锛屾劅璋esar Garcia銆
-瀵归┍鍔ㄧ▼搴忚繘琛屼簡淇敼锛屼娇涔嬭兘澶熼氳繃鍔犺浇JDBC-2.0绫绘潵璇嗗埆JDBC-2.0锛岃屼笉鏄緷闈燡DK鐗堟湰鍙枫傛劅璋ohn Baker銆
-鏇存浜嗙粨鏋滈泦锛屼互杩斿洖姝g‘鐨勮鍙枫
- Statement.getUpdateCount()鐜板湪鑳借繑鍥炲尮閰嶇殑琛岋紝鑰屼笉鏄疄闄呮洿鏂扮殑琛岋紝瀹冩洿鍍廠QL-92銆
10-29-99
-鏇存浜哠tatement/PreparedStatement.getMoreResults()缂洪櫡銆傛劅璋oel J. Bergman銆
-涓篜reparedStatement.setObject()澧炲姞浜哠hort绫诲瀷銆傛劅璋eff Crowder銆
-椹卞姩绋嬪簭鐜板湪鑳介氳繃鏌ヨ鏈嶅姟鍣ㄨ嚜鍔ㄩ厤缃渶澶/棣栭夌殑淇℃伅鍖呭ぇ灏忋
-濡傛灉鏈嶅姟鍣ㄦ敮鎸侊紝Autoreconnect浠g爜灏嗕娇鐢ㄦ洿蹇殑ping鍛戒护銆
-鏇存浜嗕粠鏈嶅姟鍣ㄨ鍙栦俊鎭寘銆佷互鍙婁负鍐欏叆鍒版湇鍔″櫒鑰屽垎閰嶄俊鎭寘鏃朵笌淇℃伅鍖呭ぇ灏忔湁鍏崇殑澶氱缂洪櫡銆
08-17-99锛氱増鏈2.0pre
-鐩墠鏄湪JDK-1.2涓嬬紪璇戠殑銆傞氳繃鏍稿績绫婚泦鍚堬紝椹卞姩绋嬪簭鍚屾椂鏀寔JDK-1.1鍜孞DK-1.2銆傚湪杩愯鏃讹紝閫氳繃鍒ゆ柇浣犳墍浣跨敤鐨凧VM鐗堟湰锛岄┍鍔ㄧ▼搴忓皢鍔犺浇鎭板綋鐨勬帴鍙g被銆
-淇浜嗗湪棣栬涓叏涓篘ULL鐨勭粨鏋滈泦銆傦紙鐢盩im Endres鎸囧嚭锛夈
-鏇存浜嗙粨鏋滈泦鍐匰QLExceptions鐨勫垪缂栧彿锛堟劅璋las Rodriguez Somoza锛夈
-涓嶅啀闇瑕佸皢鏁版嵁搴撴寚瀹氱粰杩炴帴銆傦紙鎰熻阿Christian Motschke锛夈
07-04-99锛氱増鏈1.2b
-鏇村ソ鐨勬枃妗o紙涓嶆柇鏀瑰杽锛夛紝doc/mm.doc/book1.html銆
-瀵逛簬鍒楀悕妯″紡锛孌BMD鐜板湪鍏佽null锛堟湭鍦ㄨ鑼冧腑瀹氫箟锛夛紝瀹冨皢琚洿鏀逛负鈥%鈥濄
- DBMD鐜板湪鎻愪緵浜嗛拡瀵筭etXXX()鐨勬纭被鍨嬶紡闀垮害銆
-淇敼浜哛esultSet.getDate()銆乬etTime()鍜実etTimestamp()銆傦紙鐢盇lan Wilken鎻愪緵锛夈
- EscapeProcessor鐜板湪鑳芥纭鐞嗗紩鍙峰唴鐨勨\{ \}鈥濆拰鈥{ or }鈥濄傦紙鎰熻阿Alik灏卞浣曚慨姝e畠缁欏嚭鐨勮鐐癸級銆
-瀵硅繛鎺ヤ腑鐨勫睘鎬у鐞嗗姛鑳借繘琛屼簡淇銆傦紙鐢盝uho Tikkala鎻愪緵锛夈
-瀵逛簬琛ㄤ腑鐨凬ULL鍒楋紝ResultSet.getObject()鐜板湪鑳借繑鍥濶ULL锛岃屼笉鏄攢姣併傦紙鎰熻阿Ben Grosman锛夈
-瀵逛簬MySQL涓嶄簡瑙g殑绫诲瀷锛孯esultSet.getObject()鐜板湪鑳借繑鍥炲瓧绗︿覆銆傦紙鐢盋hris Perdue寤鸿锛夈
-鍒犻櫎浜嗕笉闇瑕佺殑DataInput/Output娴侊紝瀵逛簬姣忔IO鎿嶄綔锛1锛2鐨勬柟娉曡皟鐢ㄩ兘鏄笉闇瑕佺殑銆
-濡傛灉鏈寚瀹氬瓧绗︾紪鐮侊紝浣跨敤榛樿鐨勫瓧绗︾紪鐮併傝繖鏄宸叉崯鍧廕VM鐨勪竴绉嶉伩瑙勬帾鏂斤紝杩欐槸鍥犱负锛屾寜鐓ц鑼冿紝鎵鏈夌殑JVM閮藉繀椤绘敮鎸佲淚SO8859_1鈥濓紝浣嗗苟闈炲姝ゃ
-鏇存浜嗚繛鎺ヤ簨瀹滐紝濡傛灉鏈槑纭缃瓧绗︾紪鐮侊紝灏嗕娇鐢ㄥ钩鍙扮殑瀛楃缂栫爜锛岃屼笉鏄淚SO8859_1鈥濄傚畠淇浜嗗姞杞藉苟涓嶆诲瓨鍦ㄧ殑瀛楃杞崲鍣ㄧ被鏃跺瓨鍦ㄧ殑闂锛圝VM缂洪櫡锛夈傦紙鎰熻阿Fritz Elfert鎸囧嚭浜嗚闂锛夈
-淇敼浜哅ysqlIO锛屼娇涔嬪湪鍙兘鐨勬儏鍐典笅鍐嶆浣跨敤淇℃伅鍖咃紝鑰屼笉鏄檷浣庡唴瀛樹娇鐢ㄧ巼銆
-鏇存浜嗕笌寮曞彿鍐呪{}鈥濇湁鍏崇殑杞箟澶勭悊鍣ㄧ己闄枫
04-14-99锛氱増鏈1.2a
-鏇存浜嗗闈濲avasoft JVM鐨勫瓧绗﹂泦鏀寔锛堟劅璋㈠緢澶氭寚鍑鸿闂鐨勪汉鍛橈級銆
-鏇存浜哛esultSet.getBoolean()锛屼娇涔嬭兘澶熻瘑鍒綔涓哄竷灏旀爣蹇楃殑鈥測鈥濆拰鈥渘鈥濓紝浠ュ強鈥1鈥濆拰鈥0鈥濄傦紙鎰熻阿Tim Pizey锛夈
-鏇存浜哛esultSet.getTimestamp()锛屼互鎻愪緵鏇村ソ鐨勬ц兘銆傦紙鎰熻阿Richard Swift锛夈
- 鏇存浜唃etByte()鍦ㄥ鐞嗘暟鍊肩被鍨嬫柟闈㈢殑闂銆傦紙鎰熻阿Ray Bellis锛夈
- 鏇存浜咲atabaseMetaData.getTypeInfo()鍦ㄥ鐞咲ATE绫诲瀷鏃跺瓨鍦ㄧ殑闂銆傦紙鎰熻阿Paul Johnston锛夈
-鏇存浜嗙敤浜庘渇n鈥濊皟鐢ㄧ殑EscapeProcessor銆傦紙鎰熻阿locomotive.org鐨凱iyush Shah锛夈
-鏇存浜咵scapeProcessor锛屽鏋滄病鏈夎浆涔変唬鐮侊紝涓嶆墽琛岄澶栨搷浣溿傦紙鎰熻阿Ryan Gustafson锛夈
-鏇存浜嗛┍鍔ㄧ▼搴忥紝浣夸箣鑳借В鏋愨渏dbc:mysql://host:port鈥濆舰寮忕殑URL锛堟劅璋ichard Lobb锛夈
03-24-99锛氱増鏈1.1i
-鏇存浜嗗叧浜嶱reparedStatements鐨凾imestamps闂銆
-鏇存浜哛SMD鍜孯S涓殑Null鎸囬拡寮傚父銆
-瀵逛簬鏈夋晥鐨勭被鏂囦欢锛屼笌jikes涓璧疯繘琛屼簡鍐嶇紪璇戯紙鎰熻阿ms!锛夈
03-08-99锛氱増鏈1.1h
-鏇存浜嗚浆涔夊鐞嗗櫒锛屼互澶勭悊涓嶅尮閰嶇殑鈥{鈥濆拰鈥}鈥濓紙鎰熻阿Craig Coles锛夈
-鏇存浜嗚浆涔夊鐞嗗櫒锛屼互鍒涘缓绉绘鎬ф洿濂界殑锛堝湪DATETIME鍜孴IMESTAMP绫诲瀷闂达級琛ㄨ揪寮忥紝浠ヤ究鑳戒笌BETWEEN瀛愬彞涓璧蜂娇鐢ㄣ傦紙鎰熻阿Craig Longman銆
- MysqlIO.quit()鐜板湪鑳藉叧闂鎺ュ瓧杩炴帴銆傚湪姝や箣鍓嶏紝澶氭杩炴帴澶辫触鍚庯紝鏌愪簺鎿嶄綔绯荤粺灏嗚楀敖鏂囦欢鎻忚堪绗︺傦紙鎰熻阿Michael Brinkman锛夈
-鏇存浜咲river.getPropertyInfo涓殑NullPointerException锛堟劅璋ave Potts锛夈
-淇浜哅ysqlDefs锛屽厑璁稿瓧瀛楃涓插舰寮忔绱㈡墍鏈夌殑*text瀛楁銆傦紙鎰熻阿Chris at Leverage锛夈
-鏇存浜哖reparedStatement涓殑setDouble锛屼娇涔嬭兘鐢ㄤ簬澶勭悊澶ф暟瀛楋紝闃叉灏嗙瀛﹁鏁版硶鍙戦佸埌鏁版嵁搴撱傦紙鎰熻阿J.S. Ferguson锛夈
-鏇存浜哛SMD涓殑getScale()鍜実etPrecision()銆傦紙鐢盝ames Klicman璐$尞锛夈
-鏇存浜嗗瓧娈典负DECIMAL鎴朜UMERIC鏃剁殑getObject()锛堟劅璋ert Hobbs锛夈
-浼犻扤ull琛ㄥ悕鏃讹紝DBMD.getTables()鍑虹幇涓ラ噸鏁呴殰銆傚凡鏇存锛堟劅璋ichard Lobb锛夈
-澧炲姞浜嗗湪杩炴帴杩囩▼涓鈥渃lient not authorized鈥濓紙瀹㈡埛绔湭琚巿鏉冿級閿欒鐨勬鏌ャ傦紙鎰熻阿Hannes Wallnoefer锛夈
02-19-99锛氱増鏈1.1g
-缁撴灉闆嗚鐜板湪鏄瓧鑺傛暟缁勩侭lob鍜孶nicode鐜板湪鑳藉弻鍚戝伐浣溿傜洰鍓嶅疄鏂戒簡useUnicode鍜岀紪鐮侀夐」銆
-淇浜哖reparedStatement锛屼娇鐢╯etXXXStream锛堜笉鏀瑰彉鍦板彂閫侊級灏嗕簩杩涘埗闆嗗悎鍙戦佸埌MySQL鏈嶅姟鍣ㄣ
-淇浜唃etDriverPropertyInfo()銆
12-31-98锛氱増鏈1.1f
-灏嗘墍鏈夌殑缁撴灉闆嗗瓧娈垫洿鏀逛负瀛楃涓诧紝杩欐牱锛屽簲鑳戒娇Unicode宸ヤ綔锛屼絾浣犵殑JVM蹇呴』鑳藉鍦ㄥ瓧绗﹂泦闂磋繘琛岃浆鎹€傚畠杩樿兘浣垮鏈嶅姟鍣ㄧ殑鏁版嵁璇诲彇鏇村揩锛屽師鍥犲湪浜庯紝鐜板湪涓嶅瓨鍦ㄤ粠StringBuffer鍒癝tring锛堝瓧绗︿覆锛夌殑杞崲銆
-鏇存敼浜哖reparedStatement.streamToString()锛屼娇涔嬫洿鏈夋晥锛堜唬鐮佺敱Uwe Schaefer鎻愪緵锛夈
- URL瑙f瀽鍔熻兘鏇村彲闈狅紙瀵逛簬閿欒锛屾姏鍑篠QL寮傚父锛岃屼笉鏄疦ullPointerExceptions锛夈
- PreparedStatement鐜板湪鑳介氳繃setObject()灏哠tring杞崲涓篢ime/Date鍊硷紙浠g爜鐢盧obert Currey鎻愪緵锛夈
-鍦˙uffer.readInt()涓紝IO杩涚▼涓嶅啀琚寕璧凤紝璇ョ己闄锋槸鍦1.1d涓綋灏嗙粨鏋滈泦鏇存敼涓哄叏瀛楄妭鏁扮粍鏃跺紩鍏ョ殑銆傦紙鐢盨amo Login鎸囧嚭锛夈
11-03-98锛氱増鏈1.1b
-淇浜咲atabaseMetaData锛屽厑璁窱BM VA鍜孞-Builder鍚屾椂宸ヤ綔銆傝鍛婅瘔鎴戝畠鐨勫伐浣滄満鍒躲傦紙鎰熻阿Jac Kersing锛夈
-淇浜哛esultSet.getBoolean()鍦ㄥ鐞哊ULL瀛楃涓叉柟闈㈢殑闂锛堟劅璋arry Lagerweij锛夈
-寮濮嬩唬鐮佹暣鐞嗭紝骞惰繘琛屼簡鏍煎紡澶勭悊銆傚紑濮嬪皢鍏跺垎鍑轰负骞惰鐨凧DBC-2.0婧愭爲銆
-涓篗ysqlIO鍜孊uffer鍐呯殑鍏抽敭閮ㄥ垎澧炲姞浜嗏滄渶缁堚濋檺瀹氱锛屽厑璁哥紪璇戝櫒閲囩敤鍐呰仈鏂规硶浠ユ彁楂橀熷害銆
9-29-98
-濡傛灉浼犻掔粰PreparedStatement涓璼etXXX()鐨勫璞″紩鐢ㄦ槸绌虹殑锛屽皢鑷姩璋冪敤setNull()銆傦紙鎰熻阿Erik Ostrom缁欏嚭鐨勬彁璁級銆
-瀵逛簬Types.OTHER瀵硅薄鍜屾湭鐭ョ被鍨嬪璞★紝PreparedStatement涓殑setObject()鐜板湪浼氬皾璇曞皢瀵硅薄鐨勪覆琛屽寲琛ㄧず鍐欏叆鍒版暟鎹簱銆
- Util鐜板湪鏈変簡1涓潤鎬佹柟娉時eadObject()锛岀粨鏋滈泦鍜屽垪绱㈠紩灏嗕互涓婅堪鏂瑰紡鍦ㄦ渚嬬ず搴忓垪鍖栫殑瀵硅薄銆
9-02-98 鈥 鐗堟湰1.1
-娑堥櫎浜哅ysqlIO.nextRow()涓殑鈥滀笐闄嬬己闄封濄傛洿姝d簡Buffer.isLastDataPacket()锛岃屼笉鏄幏鍙栧紓甯搞
- Connection.getCatalog()鍜孋onnection.setCatalog()鐜板湪鑳藉宸ヤ綔銆
- Statement.setMaxRows()鑳藉姝e父宸ヤ綔锛屼篃鑳戒娇鐢ㄥ睘鎬axRows杩涜璁剧疆銆傞氳繃灞炴ф垨URL鍙傛暟锛孲tatement.setMaxRows()鑳借鐩杕axRows璁剧疆銆
-鎻愪緵浜嗚嚜鍔ㄥ啀杩炴帴鍔熻兘銆傜敱浜庡湪姣忔鏌ヨ鍓嶄笉寰椾笉Ping鏁版嵁搴擄紝鍦ㄩ粯璁ゆ儏鍐典笅锛屽畠灏嗚鍏抽棴銆傝鎯充娇鐢ㄨ鍔熻兘锛岃鍦ㄨ繛鎺RL涓紶閫掆渁utoReconnect=true鈥濄傞氳繃鈥渕axReconnects=n鈥濓紙榛樿涓3锛夊拰鈥渋nitialTimeout=n鈥濓紙榛樿涓2绉掞級鍙傛暟锛屼綘涔熷彲浠ユ洿鏀瑰啀杩炴帴灏濊瘯鐨勬鏁板拰鍒濆瓒呮椂鍊笺俆imeout鏄秴鏃剁殑鎸囨暟琛ュ伩绫诲瀷銆備緥濡傦紝濡傛灉鍒濆瓒呮椂璁剧疆涓2绉掞紝maxReconnects涓3锛岄偅涔堝啀杩炴帴灏濊瘯涔嬮棿鐨勯棿闅斿垎鍒槸2绉掞紝4绉掑拰16绉掋
8-24-98锛氱増鏈1.0
- 鏇存浜咮uffer.java涓瑽lob鏁版嵁鐨勫鐞嗗姛鑳姐
-鏇存浜嗕笌灏哄杩囧皬鐨勯壌瀹氫俊鎭寘鏈夊叧鐨勭己闄枫
-JDBC椹卞姩绋嬪簭鐜板湪閲囩敤LPGL銆
8-14-98 -
- 鏇存浜 Buffer.readLenString()锛屼娇涔嬭兘姝g‘璇诲彇BLOB鏁版嵁銆
-鏇存浜哖reparedStatement.stringToStream锛屼娇涔嬭兘姝g‘璇诲彇BLOB鏁版嵁銆
-鏇存浜哖reparedStatement.setDate()锛屼娇涔嬩笉澧炲姞1澶┿傦紙鎰熻阿Vincent Partington鍦ㄤ笂杩颁慨姝i」鏂归潰鐨勮础鐚級銆
-澧炲姞浜哢RL鍙傛暟瑙f瀽鍔熻兘锛?user=...绛夌瓑锛夈
8-04-98锛氱増鏈0.9d
- 閲嶅ぇ鏂伴椈锛 鏂扮殑杞欢鍖呭悕銆侷CE宸ョ▼鍏徃鐨凾im Endres鐫鎵嬩负GNU GPL鐨凧ava杞欢寤虹珛鏂扮殑婧愭爲銆備粬鍙嬪ソ鍦板皢org.gjt.mm杞欢鍖呯洰褰曟彁渚涚粰鎴戯紝鍥犳锛岀幇鍦ㄩ┍鍔ㄧ▼搴忓湪org.gjt.mm.mysql杞欢鍖呬腑銆傜洰鍓嶆垜鏄悎娉曠敤鎴枫傛湡寰匱im椤圭洰鐨勬洿澶氫俊鎭
-鐜板湪閲囩敤浜嗗姩鎬佺‘瀹氬ぇ灏忕殑淇℃伅鍖咃紝鍚戞暟鎹簱鍙戦佸懡浠ゆ椂锛岃兘澶熷噺灏戝唴瀛樹娇鐢ㄣ
-瀵筭etTypeInfo()鐨勫弬鏁扮瓑鏂归潰杩涜浜嗗皬鐨勪慨姝c
- DatabaseMetaData鐜板凡瀹屽叏瀹炵幇銆傚鏋滆繖浜涢┍鍔ㄧ▼搴忚兘涓庡悇绉岻DE涓璧峰伐浣滐紝璇峰憡鐭ャ傛垜宸插惉璇村畠浠涓嶫builder涓璧蜂娇鐢ㄣ
-鍦ㄨ蒋浠跺寘涓鍔犱簡JavaDoc鏂囨。銆
-杞欢鍖呴噰鐢.zip鎴.tar.gz鏍煎紡鎻愪緵銆
7-28-98锛氱増鏈0.9
-瀹炵幇浜唃etTypeInfo()銆傛牴鎹甁DBC瑙勮寖锛孋onnection.rollback()鐜板湪鑳芥姏鍑篠QLException銆
-澧炲姞浜哖reparedStatement锛屽畠鏀寔棰勫鐞嗚鍙ョ殑鎵鏈塉DBC API鏂规硶锛屽寘鎷琁nputStreams銆傝妫鏌ヨ鐐癸紝濡傛湁闂锛岃鍛婄煡銆
-鏇存浜哛esultSet涓殑1涓己闄凤紝璇ョ己闄蜂細鐮村潖浠呰繑鍥1琛岀殑鏌愪簺鏌ヨ銆
- 鏇存浜咲atabaseMetaData.getTables()銆丏atabaseMetaData.getColumns()鍜孌atabaseMetaData.getCatalogs()涓瓨鍦ㄧ殑缂洪櫡銆
-澧炲姞浜嗚鍙ョ殑鍔熻兘锛屽厑璁竐xecuteUpdate()淇濆瓨鐢盇UTO_INCREMENT瀛楁鑷姩鐢熸垚鐨処D鍊笺備竴鑸岃█锛屾墽琛宔xecuteUpdate()鍚庯紝灏嗘煡鎵維QLWarnings浠ヤ簡瑙h鍛婁俊鎭紝濡侺AST_INSERTED_ID = 'some number'锛孋OMMAND = 'your SQL query'銆
濡傛灉鍦ㄨ〃涓浣跨敤AUTO_INCREMENT瀛楁锛屽苟鍦ㄤ竴鏉¤鍙ヤ笂鎵ц浜嗗涓猠xecuteUpdate()锛屽姟蹇呮瘡娆¢兘鎵цclearWarnings()浠ヨ妭鐪佸唴瀛樸
7-06-98锛氱増鏈0.8
-灏哅ysqlIO鍜孊uffer鍒嗙涓哄崟鐙被銆傚浜庤繖涓や釜绫讳腑鐨勬煇浜涘瓧娈碉紝涓浜汣lassLoader锛堢被鍔犺浇鍣級浼氱粰鍑篒llegalAccess锛堥潪娉曡闂級閿欒銆傜幇鍦紝mm.mysql鑳藉鍦ㄥ皬搴旂敤绋嬪簭鍜屾墍鏈夌被鍔犺浇鍣ㄤ腑姝e父宸ヤ綔銆
鎰熻阿Joe Ennis jce@mail.boone.com鎸囧嚭璇ラ棶棰橈紝骞朵笌鎴戜竴璧疯繘琛屼簡淇銆
7-01-98锛氱増鏈0.7
-鏇存浜唃etColumns()涓殑DatabaseMetadata problems锛屽苟鏇存浜嗗瓧娈垫瀯閫犲嚱鏁板唴寮鍏宠鍙ヤ腑瀛樺湪鐨勭己闄枫
鎰熻阿Costin Manolache costin@tdiinc.com鎸囧嚭浜嗗畠浠
5-21-98锛氱増鏈0.6
-鍦∕ysqlIO.java鍜孯esultSet.java涓紝缁撳悎Richard Swift Richard.Swift@kanatek.ca缁欏嚭鐨勬湁鏁堝彉鏇村唴瀹广
-鐜板湪锛屾垜浠殑椹卞姩绋嬪簭姣擥WE鐨勯┍鍔ㄧ▼搴忓揩15锛呫
- 寮濮嬬潃鎵嬪鐞咲atabaseMetaData銆
瀹炵幇浜嗕笅杩版柟娉曪細
* getTables()
* getTableTypes()
* getColumns
* getCatalogs()
MySQL Connector/MXJ浣垮緱MySQL鏁版嵁搴撳儚鏄熀浜巎ava鐨勭粍浠躲傚畠閫氳繃涓嬭堪姝ラ瀹屾垚璇ヤ换鍔★紝纭畾绯荤粺鎵杩愯鐨勫钩鍙帮紝閫夋嫨鎭板綋鐨勪簩杩涘埗鏂囦欢锛屽苟鎵ц绋嬪簭銆備篃鑳藉彲閫夊湴閮ㄧ讲鍏锋湁浠讳綍鎸囧畾鍙傛暟鐨勪釜鍒濆鏁版嵁搴撱
浣滀负涓绉岼MX Mbean锛孧ySQL Connector/MXJ闇瑕佷笌JMX v1.2鍏煎鐨凪bean瀹瑰櫒锛屽Jboss鐗堟湰4銆侻bean灏嗕娇鐢ㄦ爣鍑嗙殑JMX绠$悊API鏉ュ睍绀轰笌骞冲彴鐩搁傚簲鐨勫弬鏁帮紙骞跺厑璁歌缃弬鏁帮級銆
鍏朵腑鍖呭惈涓嶫DBC椹卞姩绋嬪簭涓璧蜂娇鐢ㄧ殑璇存槑锛屼互鍙婁互JMX Mbean鏂瑰紡灏嗗叾閮ㄧ讲鑷矹boss鐨勮鏄庛
鍙粠涓嬭堪绔欑偣涓嬭浇婧愮増鏈拰浜岃繘鍒剁増鏈細http://dev.mysql.com/downloads/connector/mxj/
杩欐槸涓绉嶆祴璇曟澘锛屾杩庡弽棣堝拰榧撳姳銆
濡傛湁浠讳綍闂鎴栨剰瑙侊紝璇峰彂閫佺數瀛愰偖浠惰嚦java@lists.mysql.com銆
Linux, i386
Windows NT, x86
Windows 2000, x86
Windows XP, x86
Solaris 9, SPARC 32
棣栧厛搴旂‘淇濈粍浠惰兘澶熷湪骞冲彴涓婂伐浣溿傜敱浜庘淢ysqldResource鈥濈被瀹為檯涓婃槸MySQL鍥烘湁鐗堟湰鐨勫寘瑁呭櫒锛屽苟闈炴墍鏈夌殑骞冲彴鍧囨敮鎸佸畠銆傜紪鍐欐湰鏂囨椂锛屽杩愯鍦╥386鏋舵瀯涓婄殑Linux杩涜浜嗘祴璇曪紝鐪嬩笂鍘诲伐浣滆壇濂斤紝灏卞儚鍦∣S X v10.3涓婁竴鏍枫傚湪Windows鍜孲olaris骞冲彴涓婅繘琛屼簡鏈夐檺娴嬭瘯銆
瑕佹眰锛
1. JDK-1.4鎴栨洿楂樼増鏈紙鎴朖RE锛屽鏋滀笉鎵撶畻缂栬瘧婧愭枃浠舵垨JSP鐨勮瘽锛夈
2. 閫氳繃CLASSPATH瀹夎浜嗗苟鎻愪緵浜哅ySQL Connector/J鐗堟湰3.1鎴栨洿楂樼増鏈紙http://dev.mysql.com/downloads/connector/j/ 锛夈
3. 鐢ㄤ簬JMX鐗堟湰1.2.1鐨javax.management绫伙紝瀹冧滑浣嶄簬涓嬭堪搴旂敤鏈嶅姟鍣ㄤ笂锛
路 JBoss - 4.0rc1鎴栨洿楂樼増鏈
路 Apache Tomcat - 5.0鎴栨洿楂樼増鏈
路 Sun鍏徃鐨凧MX鍙傝冨疄鏂界増鏈1.2.1锛http://java.sun.com/products/JavaManagement/銆
4. Junit 3.8.1锛http://www.junit.org/锛
濡傛灉浠庢簮鐮佸垱寤猴紝闄や簡涓婅堪鎵鏈夎姹傚锛岃繕椤绘弧瓒筹細
1. Ant鐗堟湰1.5鎴栨洿楂樼増鏈紙鍙粠http://ant.apache.org/涓婁笅杞斤級銆
1. 杩欑被娴嬭瘯灏嗗皾璇曞湪3336绔彛涓婂惎鍔∕ySQL銆傚鏋滄湁姝e湪杩愯鐨凪ySQL锛屽彲鑳戒細鍑虹幇鍐茬獊锛屼絾鍙兘鎬т笉澶э紝鍘熷洜鍦ㄤ簬MySQL鐨勯粯璁ょ鍙f槸3306銆傜劧鑰岋紝涔熷彲浠ュ皢鈥渃-mxj_test_port鈥滼ava灞炴ц缃负浣犳墍閫夋嫨鐨勭鍙c備綔涓哄彲閫夋柟寮忥紝浣犱篃鍙互閫氳繃鍏抽棴杩愯鍦ㄧ洰鏍囨満鍣ㄤ笂鐨凪ySQL瀹炰緥鏉ュ惎鍔ㄦ祴璇曘
榛樿鎯呭喌涓嬶紝娴嬭瘯缁撴灉灏嗚緭鍑哄埌鎺у埗鍙般傝鎯宠幏寰楄缁嗚緭鍑猴紝鍙互灏嗏渃-mxj_test_silent鈥滼ava灞炴ц缃负鈥滃亣鈥濄
2. 瑕佹兂杩愯Junit娴嬭瘯濂椾欢锛$CLASSPATH蹇呴』鍖呭惈涓嬭堪閮ㄥ垎锛
路 JUnit
路 JMX
路 Connector/J
路 MySQL Connector/MXJ
3. 濡傛灉浣犱笅杞界殑鏂囦欢涓笉鍚connector-mxj.jar锛岃瑙e寘MySQL Connector/MXJ婧愮爜妗f鏂囦欢銆
4. cd mysqldjmx
5. ant dist
闅忓悗锛屽皢$TEMP/cmxj/stage/connector-mxj/connector-mxj.jar娣诲姞鍒CLASSPATH锛堢被璺緞锛夈
6. 濡傛灉鏈junit锛屾墽琛屽崟鍏冩祴璇曘浠庡懡浠よ涓婅緭鍏ワ細
7. java junit.textui.TestRunner com.mysql.management.AllTestsSuite
杈撳嚭涓庝笅闈㈢粰鍑虹殑绫讳技锛
.........................................
.........................................
..........
Time: 259.438
OK (101 tests)
娉ㄦ剰锛屽湪蹇粨鏉熸椂閫熷害浼氬彉鎱紝璇疯愬績绛夊欍
MySQL Connector/J JDBC椹卞姩绋嬪簭鐨1涓壒鐐规槸锛岃兘澶熷湪JDBC杩炴帴瀛楃涓蹭腑灏嗏淪ocketFactory鈥濇寚瀹氫负鍙傛暟銆侻ySQL Connector/MXJ鍖呭惈1涓畾鍒剁殑SocketFactory銆傞娆¤繛鎺ユ椂锛孲ocketFactory灏嗛儴缃插苟鍚姩MySQL鏁版嵁搴撱係ocketFactory涔熶細鏄剧ず1涓渟hutdown鈥濇柟娉曘
瑕佹兂浣跨敤瀹冿紝璇峰湪JDBC杩炴帴瀛楃涓蹭笂鎸囧畾鈥渟ocketFactory鈥濆弬鏁帮紝骞跺皢鍏跺艰涓衡渃om.mysql.management.driverlaunched.ServerLauncherSocketFactory鈥濄
鍦ㄤ笅闈㈢殑绀轰緥涓紝鏈1涓兘鍒涘缓杩炴帴鐨勭▼搴忥紝鎵ц鏌ヨ锛屽苟灏嗙粨鏋滆緭鍑哄埌System.out銆侻ySQL鏁版嵁搴撳皢浣滀负杩炴帴杩涚▼鐨勭粍鎴愰儴鍒嗕簣浠ラ儴缃插苟鍚姩锛屾渶鍚庢槸缁撴潫閮ㄥ垎銆
import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import com.mysql.management.driverlaunched.ServerLauncherSocketFactory; public class ConnectorMXJTestExample { public static void main(String[] args) throws Exception { String hostColonPort = "localhost:3336"; String driver = com.mysql.jdbc.Driver.class.getName(); String url = "jdbc:mysql://" + hostColonPort + "/" + "?" + "socketFactory=" + ServerLauncherSocketFactory.class.getName(); String userName = "root"; String password = ""; Class.forName(driver); Connection conn = null; try { conn = DriverManager.getConnection(url, userName, password); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT VERSION()"); rs.next(); String version = rs.getString(1); rs.close(); stmt.close(); System.out.println("------------------------"); System.out.println(version); System.out.println("------------------------"); } finally { try { conn.close(); } catch (Exception e) { e.printStackTrace(); } ServerLauncherSocketFactory.shutdown(hostColonPort); } } }
瑕佹兂杩愯涓婅堪绋嬪簭锛屽湪CLASSPATH涓繀椤绘湁connector-mxj.jar鍜孋onnector/J銆傜劧鍚庨敭鍏ワ細
java ConnectorMXJTestExample
褰撶劧锛屽浜嶮ySQL鏁版嵁搴擄紝鏈夊緢澶氬彲璁剧疆鐨勯夐」銆傞氳繃涓烘瘡涓湇鍔″櫒閫夐」鍐犱互鍓嶇紑鈥渟erver鈥濓紝鍙皢鍏朵綔涓篔DBC杩炴帴瀛楃涓茬殑閮ㄥ垎锛岀畝鍗曞湴鎸囧畾杩欎簺閫夐」銆傚湪涓嬭堪绀轰緥涓紝鎴戜滑璁剧疆浜3涓┍鍔ㄧ▼搴忓弬鏁板拰2涓湇鍔″櫒鍙傛暟锛
String url = "jdbc:mysql://" + hostColonPort + "/" + "?" + "socketFactory=" + ServerLauncherSocketFactory.class.getName(); + "&" + "cacheServerConfiguration=true" + "&" + "useLocalSessionState=true" + "&" + "server.basedir=/opt/myapp/db" + "&" + "server.datadir=/mnt/bigdisk/myapp/data";
鏈1涓猨ava搴旂敤绋嬪簭骞舵墦绠楀祵鍏ySQL鏁版嵁搴擄紝鐩存帴浣跨敤com.mysql.management.MysqldResource绫汇傚彲浠ヤ娇鐢ㄩ粯璁ょ殑鏋勯犲嚱鏁帮紙鏃犲弬閲忥級渚嬬ず璇ョ被锛屾垨鑰呴氳繃鍦╦ava.io.File瀵硅薄锛堜唬琛ㄥ笇鏈涙湇鍔″櫒瑙e寘鑷崇殑鐩綍锛変腑浼犻掔被鏉ヤ緥绀轰箣銆備篃鍙敤閽堝鈥渟tdout鈥濆拰鈥渟tderr鈥濓紙鐢ㄤ簬璁板綍锛夌殑杈撳嚭娴佷緥绀哄畠銆
涓鏃﹀畬鎴愪緥绀猴紝java.util.Map锛岃瀵硅薄灏嗚兘鎻愪緵涓庡钩鍙颁互鍙婂笇鏈涗娇鐢ㄧ殑MySQL鐗堟湰鐩搁傚簲鐨勬湇鍔″櫒閫夐」鐨刯ava.util.Map銆
MysqldResource鍏佽浣犱娇鐢ㄦ墍鎻愪緵鐨勬湇鍔″櫒閫夐」鐨刯ava.util.Map鍚姩MySQL锛屽苟鍏佽浣犲叧闂暟鎹簱銆傚湪涓嬮潰鐨勭ず渚嬩腑锛岀粰鍑轰簡浣跨敤鏄庣爜java瀵硅薄灏哅ySQL宓屽叆鍒板簲鐢ㄧ▼搴忕殑绠鍗曟柟娉曘
import com.mysql.management.MysqldResource; ... public void startMySQL() { File baseDir = new File(ourAppDir, "mysql"); mysqldResource = new MysqldResource(baseDir); Map options = new HashMap(); options.put("port", "3336"); String threadName = "OurApp MySQL"; mysqldResource.start(threadName, options); } public void stopMySQL() { if (mysqldResource != null) { mysqldResource.shutdown(); } mysqldResource = null; } public java.sql.Connection getConnection() throws Exception { String db = "test"; String url = "jdbc:mysql://localhost:3336/" + db; String userName = "root"; String password = ""; Class.forName(com.mysql.jdbc.Driver.class.getName()); return DriverManager.getConnection(url, userName, password); }
路 public MysqldResource(File baseDir, PrintStream out, PrintStream err);
鍏佽璁剧疆瀹夎MySQL鏂囦欢鐨勨渂asedir鈥濓紝骞惰缃爣鍑嗚緭鍑哄拰鏍囧噯閿欒鐨勮緭鍑烘祦銆
路 public MysqldResource(File baseDir);
鍏佽璁剧疆瀹夎MySQL鏂囦欢鐨勨渂asedir鈥濄傛爣鍑嗚緭鍑哄拰鏍囧噯閿欒鐨勮緭鍑哄皢琚鑷砈ystem.out鍜孲ystem.err銆
路 public MysqldResource();
Basedir鏄痡ava.io.tempdir鐨勯粯璁ゅ瓙鐩綍銆傛爣鍑嗚緭鍑哄拰鏍囧噯閿欒鐨勮緭鍑哄皢琚鑷砈ystem.out鍜孲ystem.err銆
MysqldResource API鍖呭惈涓嬭堪鏂规硶锛
路 void start(String threadName, Map mysqldArgs);
閮ㄧ讲骞跺惎鍔∕ySQL銆傗渢hreadName鈥濆瓧绗︿覆鐢ㄤ簬鍛藉悕瀹為檯鎵цMySQL鍛戒护琛屽懡浠ょ殑绾跨▼銆傗渕ap鈥濇槸灏嗚浼犻掔粰鍛戒护琛岀殑鍙傞噺鍜屽弬鑱斿肩殑闆嗗悎銆
路 void shutdown();
鍏抽棴鐢盡ysqldResource瀵硅薄绠$悊鐨凪ySQL瀹炰緥銆
路 Map getServerOptions();
杩斿洖鎵鏈夐夐」浠ュ強MySQL鏁版嵁搴撳彲鐢ㄧ殑褰撳墠閫夐」锛堟垨榛樿閫夐」锛屽鏋滄湭杩愯鐨勮瘽锛夌殑鏄犲皠銆
路 boolean isRunning();
濡傛灉MySQL鏁版嵁搴撴鍦ㄨ繍琛岋紝杩斿洖鈥滅湡鈥濄
路 boolean isReadyForConnections();
涓鏃︽暟鎹簱閫氭姤瀹冨凡鍋氬ソ杩炴帴鍑嗗锛岃繑鍥炩滅湡鈥濄
路 void setKillDelay(int millis);
榛樿鐨勨淜ill Delay鈥濇槸30绉掋傚畠琛ㄧず鍙戝嚭鍒濆鍏抽棴璇锋眰鍜屽彂鍑衡滃己鍒舵潃姝烩濓紙濡傛灉鏁版嵁搴撴湭鍏抽棴锛夊懡浠や箣闂撮渶瑕佺瓑寰呯殑鏃堕棿銆
路 void addCompletionListenser(Runnable listener);
褰撴湇鍔″櫒杩涚▼瀹屾垚鏃讹紝鍏佽閫氱煡搴旂敤绋嬪簭銆傛瘡涓渓istener鈥濓紙鐩戝惉绋嬪簭锛夊皢鍦ㄨ嚜宸辩殑绾跨▼涓彂鍑恒
路 String getVersion();
杩斿洖MySQL鐨勭増鏈
路 void setVersion(int MajorVersion, int minorVersion, int patchLevel);
鏍囧噯鍒嗗彂鐗堟湰浠呮彁渚涗簡1绉嶇増鏈殑MySQL杞欢鍖呫備絾涔熻兘灏嗗涓増鏈皝瑁呭湪涓璧凤紝骞舵寚瀹氳浣跨敤鐨勭増鏈
鎴戜滑甯屾湜鍦↗MX浠g悊鐨勬椿鍔ㄤ腑鐪嬪埌MysqldDynamicMBean銆傚湪com.mysql.management.jmx.sunri杞欢鍖呬腑锛屽畠鏄甫鏈2涓狹beans鐨凧MX浠g悊锛
1. MysqldDynamicMBean锛屼互鍙
2. com.sun.jdmk.comm.HtmlAdaptorServer锛屽畠鎻愪緵浜嗙敤浜庢搷鎺MX浠g悊鍐呬紬澶氬厓绱犵殑Web鎺ュ彛銆
鍚姩浜嗚繖涓崄鍒嗙畝鍗曠殑浠g悊绋嬪簭鍚庯紝鍏佽鐢╓eb娴忚鍣ㄥ惎鍔ㄥ苟鍋滄MySQL鏁版嵁搴撱
1. 濡傚墠鎵杩帮紝瀹屾垚骞冲彴娴嬭瘯銆
路 褰撳墠JDK, JUnit, Connector/J, MySQL Connector/MXJ
路 鏈妭闇瑕丣MX鐨凷UN鍙傝冨疄鏂界増鏈
路 PATH, JAVA_HOME, ANT_HOME, CLASSPATH
2. 濡傛灉涓嶆槸浠庢簮鐮佸垱寤虹殑锛岃烦鍒颁笅涓姝ャ
rebuild with the "sunri.present"
ant -Dsunri.present=true dist
re-run tests:
java junit.textui.TestRunner com.mysql.management.AllTestsSuite
3. 浠庡懡浠よ鍚姩娴嬭瘯浠g悊锛
4. java com.mysql.management.jmx.sunri.MysqldTestAgentSunHtmlAdaptor &
5. 浠庢祻瑙堝櫒锛
6. http://localhost:9092/
7. 鍦∕ysqldAgent涓
8. 閫夋嫨鈥渘ame=mysqld鈥
9. 瑙傚療Mbean瑙嗗浘
10. 婊氬姩鍒板睆骞曞簳閮紝鎸 鎸夐挳
11. 鐐瑰嚮鈥Back to MBean View鈥濓紙杩斿洖Mbean瑙嗗浘锛
12. 婊氬姩鍒板睆骞曞簳閮紝鎸 鎸夐挳
13. 鏉姝昏繍琛屾祴璇曚唬鐞嗙殑Java杩涚▼锛坖mx鏈嶅姟鍣級
涓鏃︾‘瀹歁bean鑳藉鍦ㄥ钩鍙颁笂宸ヤ綔锛屾帴涓嬫潵搴斿湪鏍囧噯鐨凧MX浠g悊鍐呴儴缃睲bean銆傚叾涓寘鍚儴缃插埌Jboss鐨勮鏄庛
1. 纭繚鏈夋渶鏂扮増鏈殑java寮鍙戝伐鍏风锛坴1.4.x锛夛紝璇峰弬瑙佸墠闈㈢殑浠嬬粛銆
路 纭繚璁剧疆JAVA_HOME锛圝boss瑕佹眰JAVA_HOME锛夈
路 纭繚JAVA_HOME/bin浣嶄簬PATH涓紙涓嶉渶瑕佽缃瓹LASSPATH锛屼篃涓嶉渶瑕佷互鍓嶆祴璇曚腑浣跨敤鐨勪换浣昷ar鏂囦欢锛夈
2. 纭繚瀹夎浜咼boss鐨勬渶鏂扮増鏈紙v4.0RC1鎴栨洿楂橈級銆
3. http://www.jboss.org/index.html
4. 閫夋嫨鈥淒ownloads鈥濄
5. 閫夋嫨鈥渏boss-4.0.zip鈥濄
6. 閫夋嫨1涓暅鍍忋
7. unzip ~/dload/jboss-4.0.zip
8. 鍒涘缓JBOSS_HOME鐜鍙橀噺锛岃缃В鍖呯洰褰曘
9. 浠呭Unix锛
10. cd $JBOSS_HOME/bin
11. chmod +x *.sh
12.灏connector-mxj.jar瀹夎锛堟嫹璐濓級鍒$JBOSS_HOME/server/default/lib銆
13.灏mysql-connector-java-3.1.4-beta-bin.jar瀹夎锛堟嫹璐濓級鍒$JBOSS_HOME/server/default/lib銆
14.鍦$JBOSS_HOME/server/default/deploy涓嬪垱寤簃xjtest.war鐩綍銆
15. 灏index.jsp瀹夎锛堟嫹璐濓級鍒$JBOSS_HOME/server/default/deploy/mxjtest.war銆
16.鍦$JBOSS_HOME/server/default/deploy涓嬪垱寤簃ysqld-service.xml鏂囦欢銆
17. <?xml version="1.0" encoding="UTF-8"?>
18. <server>
19. <mbean code="com.mysql.management.jmx.jboss.JBossMysqldDynamicMBean"
20. name="mysql:type=service,name=mysqld">
21. <attribute name="datadir">/tmp/xxx_data_xxx</attribute>
22. <attribute name="autostart">true</attribute>
23. </mbean>
24. </server>
25.鍚姩jboss锛
路 鍦║nix涓婏細$JBOSS_HOME/bin/run.sh
路 鍦╓indows涓婏細%JBOSS_HOME%\bin\run.bat
鍑嗗灏辩华锛欽boss鍦ㄥ睆骞曚笂鏄剧ず澶ч噺杈撳嚭銆
26. 褰揓boss鐪嬩笂鍘诲仠姝㈠皢淇℃伅杈撳嚭鍒板睆骞曚笂鏃讹紝鎵撳紑Web娴忚鍣細http://localhost:8080/jmx-console
27.婊氬姩鍒mysql閮ㄥ垎椤甸潰搴曢儴锛岄夋嫨bulleted mysqld閾炬帴銆
28.瑙傚療JMX MBean View椤甸潰銆侻ySQL搴斿凡杩愯銆
29. 锛堝鏋滆缃簡鈥渁utostart=true鈥濆彲璺宠繃璇ユ锛夈傛粴鍔ㄥ埌灞忓箷搴曢儴銆傛寜 鎸夐挳鍋滄锛堟垨鍚姩锛塎ySQL锛岃瀵熷凡鎴愬姛瀹屾垚鑰屼笖鏃犺繑鍥炲肩殑鎿嶄綔銆傜偣鍑烩Back to MBean View鈥濓紙杩斿洖Mbean瑙嗗浘锛
30. 瑕佹兂纭畾MySQL鏄惁姝e湪杩愯锛屾墦寮Web娴忚鍣http://localhost:8080/mxjtest/锛屽簲鐪嬪埌锛
SELECT 1
returned with a result of
1
31.鎸夌収$JBOSS_HOME/server/default/deploy/mxjtest.war/index.jsp涓殑浠嬬粛锛岃兘澶熷湪浣犵殑Web搴旂敤绋嬪簭涓浣跨敤MySQL銆傚叾涓彁渚涗簡渚涙祴璇曠敤鐨勬祴璇曟暟鎹簱鍜屾牴鐢ㄦ埛锛堟棤瀵嗙爜锛夈傚垱寤鸿〃锛屾彃鍏ヤ竴浜涜锛屽苟杩涜涓浜涢夋嫨銆
32. 鍏抽棴MySQL銆傚仠姝boss鏃讹紝MySQL灏嗚嚜鍔ㄥ仠姝紝鎴栵細鍦ㄦ祻瑙堝櫒涓紝婊氬姩鍒癕Bean View搴曢儴锛屽苟鎸夊仠姝㈡湇鍔 瑙傚療宸叉垚鍔熷畬鎴愯屼笖鏃犺繑鍥炲肩殑鎿嶄綔銆備娇鐢ps鎴栦换鍔$鐞嗗櫒鏌ョ湅MySQL鏄惁宸蹭笉鍐嶈繍琛屻
瀵逛簬1.0.6-beta鐗堬紝鑳藉鍦ㄥ惎鍔ㄦ椂璁㎝bean鍚姩MySQL鏁版嵁搴撱傛澶栵紝鎴戜滑杩樺熼壌浜咼boss鐢熷懡鍛ㄦ湡鎵╁睍鏂规硶鐨勪紭鐐癸紝鍏抽棴Jboss鏃惰兘浼橀泤鍦板叧闂暟鎹簱銆
濡傛灉闃呰浜嗕笂杩伴儴鍒嗭紝搴斿凡瀹屾垚浜嗚繖浜涙楠ゃ備絾鎴戜滑鍦ㄤ笅闈㈠垪鍑轰簡瀹冧滑锛屼互渚涘揩閫熷弬鑰冦
鍚姩浜嗛┍鍔ㄧ▼搴忥細
1. 涓嬭浇骞惰В鍖匔onnector/MXJ锛屽皢connector-mxj.jar娣诲姞鍒癈LASSPATH銆
2. 涓篔DBC杩炴帴瀛楃涓叉坊鍔犱笅杩板弬鏁帮細"socketFactory=" + ServerLauncherSocketFactory.class.getName()
JBoss:
1. 涓嬭浇Connector/MXJ锛屽皢connector-mxj.jar鏂囦欢鎷疯礉鍒扮洰褰$JBOSS_HOME/server/default/lib銆
2. 涓嬭浇Connector/J锛屽皢connector-mxj.jar鏂囦欢鎷疯礉鍒扮洰褰$JBOSS_HOME/server/default/lib銆
3. 鏈変换鎰忓睘鎬ц缃湪$JBOSS_HOME/server/default/deploy鐩綍涓嬪垱寤Mbean鏈嶅姟xml鏂囦欢锛屼緥濡datadir鍜autostart銆
4. 璁剧疆Web搴旂敤绋嬪簭鐨凧DBC鍙傛暟锛屼互浣跨敤锛String driver = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql:///test?propertiesTransform="+ "com.mysql.management.jmx.ConnectorMXJPropertiesTransform"; String user = "root"; String password = ""; Class.forName(driver); Connection conn = DriverManager.getConnection(url, user, password);
浣犳垨璁稿笇鏈涗负姣忎釜搴旂敤绋嬪簭鍒涘缓鍗曠嫭鐢ㄦ埛鍜屾暟鎹簱琛ㄧ┖闂达紝鑰屼笉鏄娇鐢ㄦ牴鐢ㄦ埛鍜屾祴璇曟暟鎹簱銆
寮虹儓寤鸿瀹氭湡澶囦唤锛屽皢鏁版嵁搴撴枃浠跺浠藉埌datadir鐩綍涓嬨
杩欐槸MySQL鍙傝冩墜鍐岀殑缈昏瘧鐗堟湰锛屽叧浜嶮ySQL鍙傝冩墜鍐岋紝璇疯闂dev.mysql.com銆傚師濮嬪弬鑰冩墜鍐屼负鑻辨枃鐗堬紝涓庤嫳鏂囩増鍙傝冩墜鍐岀浉姣旓紝鏈炕璇戠増鍙兘涓嶆槸鏈鏂扮殑銆