seraph
seraph

Reputation: 33

Using nvarchar cfsqltype in coldfusion with jtds jdbc

Firstly, my cconfig is:
Language: ColdFusion 10(and installed update 11)
DB is MS SQL Server 2012
Using the jtds jdbc(tried versions 1.2.6, 1.2.8 and 1.3.0)

I'm currently having a problem running queries where I use cfqueryparam with a cfsqltype of cf_sql_nvarchar. The problem is the page just hangs. If I look at the application log of ColdFusion, I see the error of: "net.sourceforge.jtds.jdbc.JtdsPreparedStatement.setNString(ILjava/lang/String;)V The specific sequence of files included or processed is:" followed by the test filename.

I'm running a very basic select query on a nvarchar column, but the page doesn't load and that error is logged.

I know it's gotta be something to do with the jtds jdbc as if I connect through the regular sql driver it'll work perfectly.

So did anybody experience this before? If so, what was your resolution?

Thanks

Upvotes: 2

Views: 752

Answers (2)

Leigh
Leigh

Reputation: 28873

I did a quick search and the results suggest jtds does not support setNString(). I checked the driver source for 1.3.1, and as mentioned in the comments here the method is not implemented:

"..while getNString is implemented the code just consists of // TODO Auto-generated method stub and throw new AbstractMethodError();.."

So it sounds like you may need to use cf_sql_varchar, combined with the "String Format" setting, like in previous versions. Obviously, the other option is to use a different driver (one that does support setNString(), such as Adobe's driver or the MS SQL Server driver).

Upvotes: 2

Scott Stroz
Scott Stroz

Reputation: 7519

Try using cf_sql_varchar. cf_sql_nvarchar is not a valid option according to the Documentation and you should use cf_sql_varchar

Upvotes: 1

Related Questions