java
Map map = new HashMap();
map.put("respCode", "100");
getSqlMapClientTemplate().insert("getPhotos",map);
return (String)map.get("respCode");
-----------------------------------------------------------
xml
<parameterMap class="map" id="swapParameters">
<parameter property="respCode" javaType="java.lang.String" jdbcType="varchar2" mode="OUT"/>
</parameterMap>
<procedure id="getPhotos" parameterMap="swapParameters" >
{call getPhoto(?)}
</procedure>
---------------------------------------------------------------
oracle sql
create or replace procedure getPhoto(respCode out varchar2)
as
begin
respCode := 'aaa';
end;===============================================================
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation: encountered SQLException [
--- The error occurred in com/rm/yjzq/dao/impl/sql/yjzq.xml.
--- The error occurred while executing update procedure.
--- Check the {call getPhoto(?)}.
--- Check the output parameters (register output parameters failed).
--- Cause: java.sql.SQLException: 无效的列类型: -99999999]; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/rm/yjzq/dao/impl/sql/yjzq.xml.
--- The error occurred while executing update procedure.
--- Check the {call getPhoto(?)}.
--- Check the output parameters (register output parameters failed).
--- Cause: java.sql.SQLException: 无效的列类型: -99999999
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/rm/yjzq/dao/impl/sql/yjzq.xml.
--- The error occurred while executing update procedure.
--- Check the {call getPhoto(?)}.
--- Check the output parameters (register output parameters failed).
--- Cause: java.sql.SQLException: 无效的列类型: -99999999
求高手急救,在网上找了很多的例子,但是都不是正确的,只好发帖求教。
原来是一个入参一个出参,现在直接出参还是不对。
Map map = new HashMap();
map.put("respCode", "100");
getSqlMapClientTemplate().insert("getPhotos",map);
return (String)map.get("respCode");
-----------------------------------------------------------
xml
<parameterMap class="map" id="swapParameters">
<parameter property="respCode" javaType="java.lang.String" jdbcType="varchar2" mode="OUT"/>
</parameterMap>
<procedure id="getPhotos" parameterMap="swapParameters" >
{call getPhoto(?)}
</procedure>
---------------------------------------------------------------
oracle sql
create or replace procedure getPhoto(respCode out varchar2)
as
begin
respCode := 'aaa';
end;===============================================================
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation: encountered SQLException [
--- The error occurred in com/rm/yjzq/dao/impl/sql/yjzq.xml.
--- The error occurred while executing update procedure.
--- Check the {call getPhoto(?)}.
--- Check the output parameters (register output parameters failed).
--- Cause: java.sql.SQLException: 无效的列类型: -99999999]; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/rm/yjzq/dao/impl/sql/yjzq.xml.
--- The error occurred while executing update procedure.
--- Check the {call getPhoto(?)}.
--- Check the output parameters (register output parameters failed).
--- Cause: java.sql.SQLException: 无效的列类型: -99999999
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/rm/yjzq/dao/impl/sql/yjzq.xml.
--- The error occurred while executing update procedure.
--- Check the {call getPhoto(?)}.
--- Check the output parameters (register output parameters failed).
--- Cause: java.sql.SQLException: 无效的列类型: -99999999
求高手急救,在网上找了很多的例子,但是都不是正确的,只好发帖求教。
原来是一个入参一个出参,现在直接出参还是不对。
这个地方还不如改成函数