I may be mistaken, but the code looks so simple that this seems like a driver bug. Are you using a correct version of your
JDBC driver (that is, version recommended with the SQL Server you're using)? Can you
test this code with jTDS driver instead of Microsoft's one?