`

Tips

阅读更多
 

1. HttpURLConnection连接时,客户端或服务器端出现僵死或者说无法应也不报任何错的情况

  1. //设置连接主机的超时时间 ms   
  2. System.setProperty("sun.net.client.defaultConnectTimeout""300000");   
  3. //设置从主机读取数据的超时时间   
  4. System.setProperty("sun.net.client.defaultReadTimeout""300000");   

 

2. [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode.

If you pass "SelectMethod=cursor" attribute in connectio url, will allow more than one active statement per connection." jdbc:microsoft:sqlserver://localhost:1433;SelectMethod=cursor;","user","pwd"The reason for this is;When SelectMethod is set to direct, SQL Server does not support multiple active statements on a single connection within a transaction; however, when auto-commit mode is enabled (the default), the Microsoft SQL Server JDBC driver provides the ability to have multiple JDBC statements open on a single JDBC connection. This is done by cloning physical SQL Server connections as needed. To avoid cloning physical SQL Server connections in this circumstance, you should create only one Statement, PreparedStatement, CallableStatement, or DatabaseMetaData object per JDBC Connection object. Be sure to invoke the "close" methods on these objects when you are finished with them, that is, before creating another object of the types described.Sridhar PaladuguMicrosoft Developer SupportJDBC Webdata
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics