尊龙凯时人生就是博

oracleÖÐÎÄÂÒÂë½â¾öÒªÁì

oracle ÖÐÎÄÂÒÂëͨ³£ÓÉ×Ö·û¼¯¹ýʧÒýÆð¡£½â¾ö°ì·¨ÈçÏ£º¼ì²éÊý¾Ý¿â×Ö·û¼¯ £¬Ó¦Îª utf8¡£ÐÞ¸Ä×Ö·û¼¯Îª utf8¡£¼ì²é¿Í»§¶Ë×Ö·û¼¯ £¬Ó¦ÓëÊý¾Ý¿âÒ»Ö¡£ÑéÖ¤×Ö·û¼¯ÒѸü¸Ä¡£ÖØмÓÔØÊý¾Ý £¬Ö¸¶¨×Ö·û¼¯Îª utf8¡£

½â¾ö Oracle ÖÐÎÄÂÒÂë

Oracle Êý¾Ý¿âÖÐÎÄÂÒÂëÊÇÒ»¸ö³£¼ûµÄ¹ýʧ £¬¿ÉÄÜÊÇÓÉÓÚ×Ö·û¼¯ÉèÖò»×¼È·Ôì³ÉµÄ¡£ÒÔÏÂÊǽâ¾ö¸ÃÎÊÌâµÄ°ì·¨£º

1. ¼ì²é×Ö·û¼¯ÉèÖÃ

ÔÚÊý¾Ý¿âÖÐ £¬Ö´ÐÐÒÔÏÂÏÂÁîÒÔÉó²éÄ¿½ñ×Ö·û¼¯£º

SELECT * FROM V$NLS_PARAMETERS WHERE PARAMETER = 'NLS_CHARACTERSET';

µÇ¼ºó¸´ÖÆ

Êä³öÓ¦ÀàËÆÓÚ£º

PARAMETER              VALUE
---------------------- ------------------------
NLS_CHARACTERSET        UTF8

µÇ¼ºó¸´ÖÆ

ÈôÊÇ×Ö·û¼¯²»ÊÇ UTF8 £¬ÔòÐèÒª¶ÔÆä¾ÙÐиü¸Ä¡£

2. ¸ü¸Ä×Ö·û¼¯

Òª¸ü¸Ä×Ö·û¼¯ £¬ÇëÖ´ÐÐÒÔÏÂÓï¾ä£º

ALTER SYSTEM SET NLS_CHARACTERSET = 'UTF8';

µÇ¼ºó¸´ÖÆ

È»ºó £¬ÖØÐÂÆô¶¯Êý¾Ý¿âÒÔʹ¸ü¸ÄÉúЧ£º

SHUTDOWN IMMEDIATE;
STARTUP;

µÇ¼ºó¸´ÖÆ

3. ¼ì²é¿Í»§¶Ë×Ö·û¼¯

Êý¾Ý¿â¿Í»§¶ËÒ²ÐèҪʹÓÃÓëÊý¾Ý¿âÏàͬµÄ×Ö·û¼¯¡£ÔÚ Java ¿Í»§¶ËÖÐ £¬¿ÉÒÔʹÓÃÒÔÏ´úÂ룺

DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", "user", "password");
Statement stmt = connection.createStatement();
stmt.execute("SET NLS_CHARACTERSET = UTF8");

µÇ¼ºó¸´ÖÆ

4. ÑéÖ¤×Ö·û¼¯

ÔÙ´ÎÖ´Ðа취 1 ÖеÄÅÌÎÊÒÔÑéÖ¤×Ö·û¼¯ÊÇ·ñÒѸü¸ÄΪ UTF8¡£

5. ÖØмÓÔØÊý¾Ý

ÈôÊÇÊý¾ÝÊÇÔÚʹÓþÉ×Ö·û¼¯Ê±¼ÓÔØµÄ £¬ÔòÐèÒª½«ÆäÖØмÓÔØ¡£Ê¹ÓÃÒÔÏÂÏÂÁî´ÓÎļþÖмÓÔØÊý¾Ý£º

LOAD DATA
INFILE 'datafile.csv'
INTO TABLE users
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
IGNORE 1 LINES
(name VARCHAR(255) CHARACTER SET UTF8);

µÇ¼ºó¸´ÖÆ

Ö´ÐÐÕâЩ°ì·¨ºó £¬Oracle ÖеÄÖÐÎÄÂÒÂëÓ¦»ñµÃ½â¾ö¡£

ÒÔÉϾÍÊÇoracleÖÐÎÄÂÒÂë½â¾öÒªÁìµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是博ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是博ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ