We tried using Microsoft JDBC Driver 2.0 with SQL Server 2005. The problem we were running into was - when calling a stored procedure, the driver was generating the following sql statements -
declare @P1 int
set @P1=1
exec sp_prepexec @P1 output, N'@P0 int', N'EXEC getEmployeeManagers @P0', 50
select @P1
So stored procedures run in the sp_prepexec
statements. And later when you close the statement, the sp_unprepare
gets called. This seems to be the default behavior of the MS driver. The problem with this is, the overhead to generate a prepared statement and then to close it has performance impact. Why can't the driver just do this -
exec getEmployeeManagers @P0=50
We are now using the jTDS driver and it seems to be performing great.