jTDS JDBC Driver: getNString() throws error

和自甴很熟 提交于 2019-12-05 06:27:12

getNString was added with Java 1.6/JDBC 4.0. Looks like your driver is too old.

What type is your primary key ? I had exactly the same problem as you are described, that is : I could retrieve the data stored as NVARCHAR using the classic getString() method but the updates would not work, even having set the sendStringParametersAsUnicode option to true... until I changed the primary key from NVARCHAR back to VARCHAR. Now it works for me. The updates did not actually produce any errors, it just appears the primary key could not be found and hence nothing happened... Still, I was hoping to be able to use unicode storage for some fields without setting sendStringParametersAsUnicode option to true, but I am under the impression that it is not possible, unless maybe by typing the concerned columns as byte[] instead of NVARCHAR and setting them using the setBytes() method (as suggested here/)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!