Been using net.sourceforge.jtds.jdbc.Driver as my driver from MSSQL for all my applications. I had trouble with performance in a prepared statement, and learned that sendStringParametersAsUnicode=false should fix the problem. Unfortunately, I can't seem to get the driver to accept the value. I CAN get the Microsoft driver com.microsoft.sqlserver.jdbc.SQLServerDriver to accept the parameter just fine:
jdbc:sqlserver://servername:1433;databaseName=dbname;sendStringParametersAsUnicode=false
works in a persistence.xml, and in my ds.xml. Prepared statements go quickly, 100 in 22 seconds.
However, I can't seem to get the same performance boost out of JTDS. It still hangs around the prepared statement, taking several seconds on each iteration.
I've tried several variations on the string, and see the same lag in my tests (persistence.xml with Hibernate.connection.url) and Server with JTA and ds.xml.
jdbc:jtds:sqlserver://server:1433/dbname;sendStringParametersAsUnicode=false
jdbc:jtds:sqlserver://server:1433;sendStringParametersAsUnicode=false;databaseName=dbname
jdbc:jtds:sqlserver://server:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;socketKeepAlive=true;databaseName=dbname
Everything I've read states the Microsoft driver is slower, and my company had issues with it in the past. I'd really like to use JTDS if possible, but can't wait for a prepared statement for 10 seconds!
Anyone had any ideas?
Thanks