sql server query running slow from java

前端 未结 13 1945
渐次进展
渐次进展 2020-12-05 12:21

I have a java program that runs a bunch of queries against an sql server database. The first of these, which queries against a view returns about 750k records. I can run t

13条回答
  •  粉色の甜心
    2020-12-05 12:49

    Be sure that your JDBC driver is configured to use a direct connection and not a cusror based connection. You can post your JDBC connection URL if you are not sure.

    Make sure you are using a forward-only, read-only result set (this is the default if you are not setting it).

    And make sure you are using updated JDBC drivers.

    If all of this is not working, then you should look at the sql profiler and try to capture the sql query as the jdbc driver executes the statement, and run that statement in the management studio and see if there is a difference.

    Also, since you are pulling so much data, you should be try to be sure you aren't having any memory/garbage collection slowdowns on the JVM (although in this case that doesn't really explain the time discrepancy).

提交回复
热议问题