Skip to content

Commit 2c9dfea

Browse files
committed
fixes #482 As MyBatis requires Java 6 since version 3.2.0, we can use the setNString/getNString methods.
1 parent 8b71304 commit 2c9dfea

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/main/java/org/apache/ibatis/type/NStringTypeHandler.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,25 @@ public class NStringTypeHandler extends BaseTypeHandler<String> {
2828
@Override
2929
public void setNonNullParameter(PreparedStatement ps, int i, String parameter, JdbcType jdbcType)
3030
throws SQLException {
31-
// ps.setNString(i, ((String) parameter));
32-
ps.setString(i, parameter);
31+
ps.setNString(i, parameter);
3332
}
3433

3534
@Override
3635
public String getNullableResult(ResultSet rs, String columnName)
3736
throws SQLException {
38-
// return rs.getNString(columnName);
39-
return rs.getString(columnName);
37+
return rs.getNString(columnName);
4038
}
4139

4240
@Override
4341
public String getNullableResult(ResultSet rs, int columnIndex)
4442
throws SQLException {
45-
return rs.getString(columnIndex);
43+
return rs.getNString(columnIndex);
4644
}
4745

4846
@Override
4947
public String getNullableResult(CallableStatement cs, int columnIndex)
5048
throws SQLException {
51-
// return cs.getNString(columnIndex);
52-
return cs.getString(columnIndex);
49+
return cs.getNString(columnIndex);
5350
}
5451

55-
}
52+
}

0 commit comments

Comments
 (0)