JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » JDBC/SQL討論區 » Microsoft SQL Server  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 Re:關於select for update的問題 [Re:koji]
honienglon





發文: 59
積分: 0
於 2011-02-08 09:05 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
koji wrote:
你可以先試試看

koji


不行, 出了exception

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.
  at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:201)
  at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForObject(MappedStatement.java:120)
  at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:518)
  at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:493)
  at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
  at org.springframework.orm.ibatis.SqlMapClientTemplate$1.doInSqlMapClient(SqlMapClientTemplate.java:273)
  at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:209)
  ... 48 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.
  at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
  at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
  at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
  at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source)
  at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
  at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
  at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
  at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
  at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(Unknown Source)
  at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169)
  at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:185)
  at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221)
  at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189)
  ... 54 more


我不想用selectMethod=cursor, 因為DB的效能會變慢


reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
1384 關於select for update的問題 honienglon 92 2011-02-07 16:32
1284 Re:關於select for update的問題 koji 15 2011-02-07 18:19
1240 Re:關於select for update的問題 honienglon 2336 2011-02-08 09:05
1202 Re:關於select for update的問題 kenshin520 202 2011-02-23 14:41
» JWorld@TW »  JDBC/SQL討論區 » Microsoft SQL Server

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8