List:Commits« Previous MessageNext Message »
From:tikeda Date:January 25 2006 10:41pm
Subject:Connector/J commit: r4850 - branches/branch_5_1/connector-j/src/com/mysql/jdbc
View as plain text  
Modified:
   branches/branch_5_1/connector-j/src/com/mysql/jdbc/PreparedStatement.java
Log:
added implementation to PreparedStatement.setNString method

Modified: branches/branch_5_1/connector-j/src/com/mysql/jdbc/PreparedStatement.java
===================================================================
--- branches/branch_5_1/connector-j/src/com/mysql/jdbc/PreparedStatement.java	2006-01-25 22:33:08 UTC (rev 4849)
+++ branches/branch_5_1/connector-j/src/com/mysql/jdbc/PreparedStatement.java	2006-01-25 22:41:25 UTC (rev 4850)
@@ -2414,7 +2414,7 @@
      * Set a parameter to a Java String value. The driver converts this to a SQL
      * VARCHAR or LONGVARCHAR value with introducer _utf8 (depending on the 
      * arguments size relative to the driver's limits on VARCHARs) when it sends 
-     * it to the database.
+     * it to the database. If charset is set as utf8, this method just call setString.
      * 
      * @param parameterIndex
      *            the first parameter is 1...
@@ -2425,6 +2425,12 @@
      *                if a database access error occurs
      */
     public void setNString(int parameterIndex, String x) throws SQLException {
+        if (this.charEncoding.equalsIgnoreCase("UTF-8")
+                || this.charEncoding.equalsIgnoreCase("utf8")) {
+            setString(parameterIndex, x);
+            return;
+        }
+        
         // if the passed string is null, then set this column to null
         if (x == null) {
             setNull(parameterIndex, Types.CHAR);

Thread
Connector/J commit: r4850 - branches/branch_5_1/connector-j/src/com/mysql/jdbctikeda25 Jan