Modified:
branches/branch_5_1/connector-j/src/com/mysql/jdbc/ServerPreparedStatement.java
Log:
implemented ServerPreparedStatement.setNString method and it's test method to StatementTest
Modified: branches/branch_5_1/connector-j/src/com/mysql/jdbc/ServerPreparedStatement.java
===================================================================
--- branches/branch_5_1/connector-j/src/com/mysql/jdbc/ServerPreparedStatement.java 2006-01-25 22:41:25 UTC (rev 4850)
+++ branches/branch_5_1/connector-j/src/com/mysql/jdbc/ServerPreparedStatement.java 2006-01-25 22:46:17 UTC (rev 4851)
@@ -1864,6 +1864,19 @@
binding.isLongData = false;
}
}
+
+ /**
+ * @see java.sql.PreparedStatement#setNString(int, java.lang.String)
+ */
+ public void setNString(int parameterIndex, String x) throws SQLException {
+ if (this.charEncoding.equalsIgnoreCase("UTF-8")
+ || this.charEncoding.equalsIgnoreCase("utf8")) {
+ setString(parameterIndex, x);
+ } else {
+ throw new SQLException(
+ "Can not call setNString() when connection character set isn't UTF-8");
+ }
+ }
/**
* Set a parameter to a java.sql.Time value.
| Thread |
|---|
| • Connector/J commit: r4851 - branches/branch_5_1/connector-j/src/com/mysql/jdbc | tikeda | 25 Jan |