You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Kai Grabfelder (JIRA)" <ib...@incubator.apache.org> on 2009/05/01 13:59:30 UTC

[jira] Commented: (IBATIS-584) Oracle Merge Into statement always returns 0

    [ https://issues.apache.org/jira/browse/IBATIS-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704968#action_12704968 ] 

Kai Grabfelder commented on IBATIS-584:
---------------------------------------

could you explain this issue a little bit more?

> Oracle Merge Into statement always returns 0
> --------------------------------------------
>
>                 Key: IBATIS-584
>                 URL: https://issues.apache.org/jira/browse/IBATIS-584
>             Project: iBatis for Java
>          Issue Type: Bug
>          Components: DAO
>    Affects Versions: 2.3.0
>         Environment: window xp, jdk 6, eclipse 3.2
>            Reporter: Dongyong Kim
>
> at executeUpdate(StatementScope statementScope, Connection conn, String sql, Object[] parameters)  in SqlExcutor
> --------------------------------------------------------------------------------
> public int executeUpdate(StatementScope statementScope, Connection conn, String sql, Object[] parameters) throws SQLException {
>     ErrorContext errorContext = statementScope.getErrorContext();
>     errorContext.setActivity("executing update");
>     errorContext.setObjectId(sql);
>     PreparedStatement ps = null;
>     setupResultObjectFactory(statementScope);
>     int rows = 0;
>     try {
>       errorContext.setMoreInfo("Check the SQL Statement (preparation failed).");
>       ps = prepareStatement(statementScope.getSession(), conn, sql);
>       setStatementTimeout(statementScope.getStatement(), ps);
>       errorContext.setMoreInfo("Check the parameters (set parameters failed).");
>       statementScope.getParameterMap().setParameters(statementScope, ps, parameters);
>       errorContext.setMoreInfo("Check the statement (update failed).");
>       ps.execute();
>       rows = ps.getUpdateCount();  
>      // can't get count if I use Oracle merge Into statement
>      //  int result = ps.executeUpdate();  << this is ok
>     } finally {
>       closeStatement(statementScope.getSession(), ps);
>     }
>     return rows;
>   }
> --------------------------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.