You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Bhatnagar, Manjeet {PBG}" <ma...@pepsi.com> on 2007/04/19 18:03:35 UTC

DTD problem with new release 2.2 - handling multiple ResultSet

I am trying to use this new feature in new release 2.2 for handling
multiple result set returning from a stored procedure.

In my SqlMap when i am defining 

<storedProcedureResultSets id="myResultSets">
		<storedProcedureResultSet resultMap="custCount" />
		<storedProcedureResultSet resultMap="custDetails" /> 
		<storedProcedureResultSet resultMap="custGrpDetails" /> 
	</storedProcedureResultSets>

I am geting an error : 
XML Parser Error.  Cause: org.xml.sax.SAXException: Error: URI=null
Line=75: Element type "storedProcedureResultSets" must be declared.

because the DTD i am using is :

<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-2.dtd">

and the above element is not defined in this DTD. 

Do we have a new DTD to support this multiple Resultset feature.

I appreciate , if someone can help me manage this problem of handling
multiple resultset using Ibatis. I don't want to go JDBC way.



Thanks
Manjeet Bhatnagar
(914) 767-6402


RE: DTD problem with new release 2.2 - handling multiple ResultSet

Posted by "Bhatnagar, Manjeet {PBG}" <ma...@pepsi.com>.
Hey Jeff,
 
 I tried to implement  as per your specification but i get the following
error:
 
 
 
 
 
 
Here is the XML Map I am using
 
------------------------------------------------------------------------
--------------------------------
<!-- Below procedure returning 3 result sets -->

<parameterMap id="myParameterMap" class="map">

<parameter property="pzId" javaType="java.lang.String"
jdbcType="varchar" mode="IN" />

<parameter property="selectedKA" javaType="java.lang.String"
jdbcType="varchar" mode="IN" />

<parameter property="selectedKAD" javaType="java.lang.String"
jdbcType="varchar" mode="IN" /> 

<parameter property="city" javaType="java.lang.String"
jdbcType="varchar" mode="IN" /> 

<parameter property="state" javaType="java.lang.String"
jdbcType="varchar" mode="IN" /> 

<parameter property="zip" javaType="java.lang.String" jdbcType="varchar"
mode="IN" /> 

</parameterMap>

<resultMap id="custCount" class="com.pbg.ssd.dto.cdw.CustCountDTO">

<result property="cofCount" column="tot_cust"/>

<result property="cofInCgCount" column="cust_in_grps"/>

</resultMap>

<resultMap id="custDetails" class="com.pbg.ssd.dto.cdw.CustDetailsDTO">

<result property="custName" column="cust_name"/>

<result property="custId" column="cust_id"/>

<result property="city" column="city"/>

<result property="state" column="state"/>

<result property="zipCode" column="zip_code"/>

<result property="segName" column="segment_name"/>

<result property="format" column="format"/>

<result property="custGroup" column="cust_group"/>

</resultMap>

<resultMap id="custGrpDetails"
class="com.pbg.ssd.dto.cdw.CustGrpDetailsDTO">

<result property="custGrpName" column="cust_grp_name"/>

<result property= "custMatchCount" column="cust_match_cnt"/>

<result property="custInGrpCnt" column="cust_in_grp"/>

</resultMap>

 

<select id="getCustomerCounts"
resultMap="custCount,custDetails,custGrpDetails"
parameterMap="myParameterMap">

{CALL NDS_GetCustGroupInfo(?,?,?,?,?,?)}

</select>

------------------------------------------------------------------------
--------------------------------


________________________________

	From: Jeff Butler [mailto:jeffgbutler@gmail.com] 
	Sent: Thursday, April 19, 2007 12:51 PM
	To: user-java@ibatis.apache.org
	Subject: Re: DTD problem with new release 2.2 - handling
multiple ResultSet
	
	
	The XML you are using was never implemented - the top of the
WIKI page you pulled this from clearly says that the page is obsolete.
	 
	Multiple result sets are implemented by specifying a comma
delimited list of result maps...
	 
	<select id="fred" resultMap="rs1, rs2. rs3">
	   ...
	</select>
	 
	Jeff Butler
	
	 
	On 4/19/07, Bhatnagar, Manjeet {PBG}
<ma...@pepsi.com> wrote: 

		I am trying to use this new feature in new release 2.2
for handling
		multiple result set returning from a stored procedure. 
		
		In my SqlMap when i am defining
		
		<storedProcedureResultSets id="myResultSets">
		               <storedProcedureResultSet
resultMap="custCount" />
		               <storedProcedureResultSet
resultMap="custDetails" /> 
		               <storedProcedureResultSet
resultMap="custGrpDetails" />
		       </storedProcedureResultSets>
		
		I am geting an error :
		XML Parser Error.  Cause: org.xml.sax.SAXException:
Error: URI=null 
		Line=75: Element type "storedProcedureResultSets" must
be declared.
		
		because the DTD i am using is :
		
		<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map
2.0//EN"
		" http://www.ibatis.com/dtd/sql-map-2.dtd
<http://www.ibatis.com/dtd/sql-map-2.dtd> ">
		
		and the above element is not defined in this DTD.
		
		Do we have a new DTD to support this multiple Resultset
feature.
		
		I appreciate , if someone can help me manage this
problem of handling 
		multiple resultset using Ibatis. I don't want to go JDBC
way.
		
		
		
		Thanks
		Manjeet Bhatnagar
		(914) 767-6402
		
		



RE: DTD problem with new release 2.2 - handling multiple ResultSet

Posted by "Bhatnagar, Manjeet {PBG}" <ma...@pepsi.com>.
 

Hey Jeff,

 

Sorry about the previous email. It got sent before finishing.

 

I tried to implement as per your specification. I created 3 ResultMap's
and used it in the select Query but I get the following error:

 

 
------------------------------------------------------------------------
--------------------------------

 

 

Caused by: java.lang.RuntimeException: ###############Could not
initialize DaoConfig.  Cause: com.ibatis.dao.client.DaoException: Error
while configuring DaoManager.  Cause:
com.ibatis.sqlmap.client.SqlMapException: There was an error while
building the SqlMap instance.  

--- The error occurred in com/pbg/ssd/ibatis/xml/ValidateCustGrp.xml.  

--- The error occurred while parsing a mapped statement.  

--- Check the getCustomerCounts statement.  

--- Check the result map name.  

--- Cause: com.ibatis.sqlmap.client.SqlMapException: There is no result
map named validateCustGrp.custCount,custDetails,custGrpDetails in this
SqlMap.

Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no result
map named validateCustGrp.custCount,custDetails,custGrpDetails in this
SqlMap.

Caused by: com.ibatis.sqlmap.client.SqlMapException: There was an error
while building the SqlMap instance.  

--- The error occurred in com/pbg/ssd/ibatis/xml/ValidateCustGrp.xml.  

--- The error occurred while parsing a mapped statement.  

--- Check the getCustomerCounts statement.  

--- Check the result map name.  

--- Cause: com.ibatis.sqlmap.client.SqlMapException: There is no result
map named validateCustGrp.custCount,custDetails,custGrpDetails in this
SqlMap.

Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no result
map named validateCustGrp.custCount,custDetails,custGrpDetails in this
SqlMap.########################

            at
com.pbg.ssd.ibatis.config.DaoConfig.<clinit>(DaoConfig.java:22)

 

 
------------------------------------------------------------------------
-------------------------------

 

Here is the XML Map I am using

 

------------------------------------------------------------------------
--------------------------------

<!-- Below procedure returning 3 result sets -->

<parameterMap id="myParameterMap" class="map">

<parameter property="pzId" javaType="java.lang.String"
jdbcType="varchar" mode="IN" />

<parameter property="selectedKA" javaType="java.lang.String"
jdbcType="varchar" mode="IN" />

<parameter property="selectedKAD" javaType="java.lang.String"
jdbcType="varchar" mode="IN" /> 

<parameter property="city" javaType="java.lang.String"
jdbcType="varchar" mode="IN" /> 

<parameter property="state" javaType="java.lang.String"
jdbcType="varchar" mode="IN" /> 

<parameter property="zip" javaType="java.lang.String" jdbcType="varchar"
mode="IN" /> 

</parameterMap>

<resultMap id="custCount" class="com.pbg.ssd.dto.cdw.CustCountDTO">

<result property="cofCount" column="tot_cust"/>

<result property="cofInCgCount" column="cust_in_grps"/>

</resultMap>

<resultMap id="custDetails" class="com.pbg.ssd.dto.cdw.CustDetailsDTO">

<result property="custName" column="cust_name"/>

<result property="custId" column="cust_id"/>

<result property="city" column="city"/>

<result property="state" column="state"/>

<result property="zipCode" column="zip_code"/>

<result property="segName" column="segment_name"/>

<result property="format" column="format"/>

<result property="custGroup" column="cust_group"/>

</resultMap>

<resultMap id="custGrpDetails"
class="com.pbg.ssd.dto.cdw.CustGrpDetailsDTO">

<result property="custGrpName" column="cust_grp_name"/>

<result property= "custMatchCount" column="cust_match_cnt"/>

<result property="custInGrpCnt" column="cust_in_grp"/>

</resultMap>

 

<select id="getCustomerCounts"
resultMap="custCount,custDetails,custGrpDetails"
parameterMap="myParameterMap">

{CALL NDS_GetCustGroupInfo(?,?,?,?,?,?)}

</select>

------------------------------------------------------------------------
--------------------------------

 


________________________________

	From: Jeff Butler [mailto:jeffgbutler@gmail.com] 
	Sent: Thursday, April 19, 2007 12:51 PM
	To: user-java@ibatis.apache.org
	Subject: Re: DTD problem with new release 2.2 - handling
multiple ResultSet
	
	
	The XML you are using was never implemented - the top of the
WIKI page you pulled this from clearly says that the page is obsolete.
	 
	Multiple result sets are implemented by specifying a comma
delimited list of result maps...
	 
	<select id="fred" resultMap="rs1, rs2. rs3">
	   ...
	</select>
	 
	Jeff Butler
	
	 
	On 4/19/07, Bhatnagar, Manjeet {PBG}
<ma...@pepsi.com> wrote: 

		I am trying to use this new feature in new release 2.2
for handling
		multiple result set returning from a stored procedure. 
		
		In my SqlMap when i am defining
		
		<storedProcedureResultSets id="myResultSets">
		               <storedProcedureResultSet
resultMap="custCount" />
		               <storedProcedureResultSet
resultMap="custDetails" /> 
		               <storedProcedureResultSet
resultMap="custGrpDetails" />
		       </storedProcedureResultSets>
		
		I am geting an error :
		XML Parser Error.  Cause: org.xml.sax.SAXException:
Error: URI=null 
		Line=75: Element type "storedProcedureResultSets" must
be declared.
		
		because the DTD i am using is :
		
		<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map
2.0//EN"
		" http://www.ibatis.com/dtd/sql-map-2.dtd
<http://www.ibatis.com/dtd/sql-map-2.dtd> ">
		
		and the above element is not defined in this DTD.
		
		Do we have a new DTD to support this multiple Resultset
feature.
		
		I appreciate , if someone can help me manage this
problem of handling 
		multiple resultset using Ibatis. I don't want to go JDBC
way.
		
		
		
		Thanks
		Manjeet Bhatnagar
		(914) 767-6402
		
		



Re: DTD problem with new release 2.2 - handling multiple ResultSet

Posted by Jeff Butler <je...@gmail.com>.
The XML you are using was never implemented - the top of the WIKI page you
pulled this from clearly says that the page is obsolete.

Multiple result sets are implemented by specifying a comma delimited list of
result maps...

<select id="fred" resultMap="rs1, rs2. rs3">
   ...
</select>

Jeff Butler


On 4/19/07, Bhatnagar, Manjeet {PBG} <ma...@pepsi.com> wrote:
>
> I am trying to use this new feature in new release 2.2 for handling
> multiple result set returning from a stored procedure.
>
> In my SqlMap when i am defining
>
> <storedProcedureResultSets id="myResultSets">
>                <storedProcedureResultSet resultMap="custCount" />
>                <storedProcedureResultSet resultMap="custDetails" />
>                <storedProcedureResultSet resultMap="custGrpDetails" />
>        </storedProcedureResultSets>
>
> I am geting an error :
> XML Parser Error.  Cause: org.xml.sax.SAXException: Error: URI=null
> Line=75: Element type "storedProcedureResultSets" must be declared.
>
> because the DTD i am using is :
>
> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
> "http://www.ibatis.com/dtd/sql-map-2.dtd">
>
> and the above element is not defined in this DTD.
>
> Do we have a new DTD to support this multiple Resultset feature.
>
> I appreciate , if someone can help me manage this problem of handling
> multiple resultset using Ibatis. I don't want to go JDBC way.
>
>
>
> Thanks
> Manjeet Bhatnagar
> (914) 767-6402
>
>