[Á°][¼¡][ÈÖ¹æ½ç°ìÍ÷][¥¹¥ì¥Ã¥É°ìÍ÷]

mysql:6722

From: (sumino) <<sumino@xxxxxxxxxx>>
Date: Tue, 17 Dec 2002 18:32:57 +0900
Subject: [mysql 06722] ¥·¥Õ¥È JIS ¤Îʸ»ú²½¤±

Win2000¾å¤Ç Java + MySQL¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òºîÀ®¤·¤Æ¤¤¤ë¤Î¤Ç¤¹¤¬¡¢
JDBC Type4 ¥É¥é¥¤¥Ð¤ò»ÈÍѤ·¤ÆINSERT¤·¤¿¤È¤­¤Ëʸ»ú²½¤±¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
²ò·èÊýË¡¤ò¤´Â¸ÃΤÎÊý¤Ï¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£

¡ÖßÀùõ¡×¢ª¡ÖßÀ?¡×
¡Öüñüòüóüôüõ¡×¢ª¡Ö?????¡×¤È¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£

»ÈÍѤ·¤¿JDBC¥É¥é¥¤¥Ð
    gweMysqlJDBC_extra4
    gweMysqlJDBC_extra3    gwe.sql.gweMysqlDriver
    mysql-connector-java-2.0.14
    mysql-connector-java-3.0.2-beta    org.gjt.mm.mysql.Driver

sun¤ÎJDBC Type1 ¥É¥é¥¤¥Ð sun.jdbc.odbc.JdbcOdbcDriver ¤À¤È¡¢¤¦¤Þ¤¯¤¤¤­¤Þ¤¹¡£
JDBC¥É¥é¥¤¥Ð¤ò»ÈÍѤ»¤º¤Ë¡¢¥³¥Þ¥ó¥É¤«¤éľÀÜÆþÎϤ·¤¿¾ì¹ç¤âʸ»ú²½¤±¤¹¤ë¤³¤È¤Ê
¤¯¡¢INSERT¤Ç¤­¤Þ¤¹¡£
SELECT¤Ï¤¦¤Þ¤¯¤¤¤­¤Þ¤¹¡£

¤¿¤À¡¢¡Öɽ¡×¤Ïʸ»ú²½¤±¤·¤Þ¤»¤ó¡£¡Ê²áµî¤Ë²¿ÅÙ¤âÏÃÂê¤Ë¤Ê¤Ã¤¿¡Ö\¡×ÌäÂê¤Ç¤Ï¤Ê¤¤
¤È»×¤¤¤Þ¤¹¡£¡Ë

»ÈÍѴĶ­
    windows 2000 pro sp3
    mysql 3.23.51-nt
    ¥í¡¼¥«¥ë¥Û¥¹¥È¤Ç»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£
    j2sdk1.4.0_01

°Ê²¼¥µ¥ó¥×¥ë¥½¡¼¥¹
    1 import java.sql.*;
    2
    3 public class JDBCBatch{
    4  public static void main(String[] args) {
    5   Connection con = null;
    6   Statement stmt = null;
    7   String dburl =
"jdbc:mysql://localhost:3306/TestDB?useUnicode=true&characterEncoding=SJIS";
    8
    9   try {
   10    // ¥É¥é¥¤¥Ð¥¯¥é¥¹¤ò¥í¡¼¥É
   11 //   Class.forName("com.mysql.jdbc.Driver");
   12 //   Class.forName("gwe.sql.gweMysqlDriver");
   13    Class.forName("org.gjt.mm.mysql.Driver");
   14 //   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
   15
   16    // ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ØÀܳ
   17 //   con = DriverManager.getConnection("jdbc:odbc:TestDB", "", "");
   18    con = DriverManager.getConnection(dburl,"root","masterkey");
   19    // ¥¹¥Æ¡¼¥È¥á¥ó¥È¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®
   20    stmt = con.createStatement();
   21
   22    /**½èÍý£±**/
   23    stmt.addBatch("INSERT INTO Test (No,̾Á°) VALUES('00004','üñüòüóüô
ùõ')");
   24
   25    // ¥Ð¥Ã¥Á¤ò¼Â¹Ô¤·¤Þ¤¹
   26    stmt.executeBatch();
   27
   28   } catch (Exception e) {
   29    e.printStackTrace();
   30   } finally {
   31    // ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹
   32    try {
   33     if (stmt!=null) {
   34      stmt.close();
   35     }
   36     if (con!=null) {
   37      con.close();
   38     }
   39    } catch (SQLException e) {
   40     e.printStackTrace();
   41    }
   42   }
   43  }
   44 }

 ------------------------------------------------------------
 Name      : Sumino Hiroshi
 E-Mail    : sumino@xxxxxxxxxx




[Á°][¼¡][ÈÖ¹æ½ç°ìÍ÷][¥¹¥ì¥Ã¥É°ìÍ÷]

->    6722 2002-12-17 18:32 [<sumino@xxxxxxxxxx> ] ¥·¥Õ¥È JIS ¤Îʸ»ú²½¤±                   
      6723 2002-12-17 22:56 ¨²["¾ë" <sora_iro@xxxxx]                                       
      6724 2002-12-17 23:16 ¨±["TAKAHASHI, Tomohiro]                                       
      6725 2002-12-18 11:21 ¡¡¨±[<sumino@xxxxxxxxxx> ]