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 "Manikandan.R, ISDC Chennai" <ma...@hcl.in> on 2006/02/16 15:03:13 UTC

Error message - com.ibatis.common.jdbc.exception.NestedSQLExcepti on

Hi
In our web application we are trying to update a table. our query is,   
<update id="updateProjectMasterDetails"
parameterClass="com.tracker.dto.project.ProjectMasterDTO">
    UPDATE PROJECT_MASTER 
        SET
            ORG_HIERARCHY_ID = #orgHierarchyId#,
            PMO_NUMBER =  #pmoNumber#,
            STAR_PRO_NUMBER =  #starProNumber#,
            DESCRIPTION =  #description#,
            IMPACT_DETAIL =  #impactDetail#,
            STATUS =  #status#,
            PRIORITY =  #priority#,
            CATEGORY =  #category#,
            ESUBMIT_MODEL = #esubmitModel#,
            QUARTER_OF_IMPLEMENTATION = #quaterOfImpl#, 
            MODEL_OFFICE_1 =  #modelOffice1#,
            MODEL_OFFICE_2 =  #modelOffice2#,
            SIZE_OF_EFFORT =  #sizeOfEffort#,
            MEASUREMENT_VER_DETAIL =  #measurementVerDetail#,
            DEPARTMENT_INVL_DETAIL =  #invlOtherDepartments#,
            NINTY_DAY_ACTION_PLAN =  #nintyDayActionPlan#,
            PRIMARY_SYSTEM =  #primarySystem#,
            SECONDARY_SYSTEM =  #secondarySystem#,
            BUSINESS_OWNER =  #businessOwner#,
            PROJECT_OWNER =  #projectOwner#,
            BUSINESS_AREA_LEAD = #businessAreaLead#,
            PROJECT_LEAD =  #projectLead#,
            IT_LEAD_1 = #itLead1#,
            IT_LEAD_2 =  #itLead2#,
            IT_LEAD_3 =  #itLead3#,
            DATE_PLAN_CREATED =  #datePlanCreated:DATE#,
            COMPLETION_DATE_IMPACT =  #completionDateImpact:DATE#,
            QUARTER_OF_UPDATE =  #quarterOfUpdate#,
            PERCENTAGE_COMPLETE =  #percentageComplete#,
            PLANNED_START_DATE = #plannedStartDate:DATE#,
            PLANNED_END_DATE =  #plannedEndDate:DATE#,
            ACTUAL_START_DATE = #actualStartDate:DATE#,
            ACTUAL_END_DATE =  #actualEndDate:DATE#,
            MODIFIED_USER_ID =  #modifiedUserId#,
            MODIFIED_DATE =  SYSDATE
    WHERE 
        PROJECT_ID = #projectId#        
</update>
 
some times this query is executed without any error, particularly for
the first request after the application being started. For all the
subsequent requests we run in to following error. The error messages
also not consistent, most of the time error messages are either of the
following.
--- Check the parameter mapping for the 'actualStartDate' property.
--- Check the parameter mapping for the 'actualEndDate' property.
--- Check the parameter mapping for the 'projectId' property.
 
The data type in the DTO are
    actualStartDate - java.util.Date
    actualEndDate - java.util.Date
    projectId -  BigDecimal 
 
The date type of the corresoponding fields in tabel are (Data base is
Oracle 9i)
    actualStartDate - Date
    actualEndDate - Date
    projectId -  Number
 
The stack trace is as follow,
com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/tracker/dao/conf/sqlMap/projectMap.xml.  
--- The error occurred while applying a parameter map.  
--- Check the updateProjectMasterDetails-InlineParameterMap.  
--- Check the parameter mapping for the 'actualEndDate' property.  
--- Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
[2/15/06 23:08:24:225 GMT+05:30] 282fda15 SystemErr      
Caused by: 
[2/15/06 23:08:24:225 GMT+05:30] 282fda15 SystemErr
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
 
our working environment is webspher application server 5.0. we dont
understand the cause of the problem any help could be really
appreciated.
 
thanks in advance
Manikandan

Re: List of data as input

Posted by John Chien <jo...@ncmail.net>.
Thanks,

James, Steven wrote:

>try this guide http://cvs.apache.org/dist/ibatis/ibatis.java/docs/iBATIS-SqlMaps-2.pdf
>page 39...
> 
>The <iterate> tag will work fine to create and IN list..
> 
>steve.
>
>________________________________
>
>From: John Chien [mailto:john.chien@ncmail.net]
>Sent: Thu 16/02/2006 14:37
>To: user-java@ibatis.apache.org
>Subject: Re: List of data as input
>
>
>
>James:
>
>I am not quite sure if I can find the solution in the tutorial because
>the input data is any array or list.
>
>I have to write something like:
>
>SELECT name
>FROM Employee
>WHER title in (.....)
>
>where (.....) is the list of titles.
>Since I do not know the size of list of titles before hand, I do not quite know how to write the SQL statement.
>
>Thanks,
>
>John Chien
>
>
>
>
>
>James, Steven wrote:
>
>  
>
>>Hi John,
>>
>>If you download the ibatis quick start guide http://cvs.apache.org/dist/ibatis/ibatis.java/docs/iBATIS-SqlMaps-2-Tutorial.pdf you will find this out i no time.
>>
>>Good luck you already have way there....
>>
>>Steve..
>>
>>________________________________
>>
>>From: John Chien [mailto:john.chien@ncmail.net]
>>Sent: Thu 16/02/2006 14:13
>>To: user-java@ibatis.apache.org
>>Subject: List of data as input
>>
>>
>>
>>
>>Dear Sir:
>>
>>Suppose that I have a table called Employee which has the folloing fields:
>>
>>name,
>>date-of-birth,
>>title,
>>phone_number
>>
>>I want to write a SQL query using ibatis SQLMAP which will return a list
>>of names which have the matching titles
>>
>>The matching titles are containend in an array or list. The number of
>>the element in the array or list may vary.
>>How can I write a SQL to do the job ?
>>
>>SELECT name
>>    
>>
>>FROM Employee
>  
>
>>WHER title = ????
>>
>>
>>Thanks,
>>
>>John Chien
>>
>>
>>
>>
>>
>>This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
>>
>>
>>    
>>
>
>
>  
>

RE: List of data as input

Posted by "James, Steven" <st...@logicacmg.com>.
try this guide http://cvs.apache.org/dist/ibatis/ibatis.java/docs/iBATIS-SqlMaps-2.pdf
page 39...
 
The <iterate> tag will work fine to create and IN list..
 
steve.

________________________________

From: John Chien [mailto:john.chien@ncmail.net]
Sent: Thu 16/02/2006 14:37
To: user-java@ibatis.apache.org
Subject: Re: List of data as input



James:

I am not quite sure if I can find the solution in the tutorial because
the input data is any array or list.

I have to write something like:

SELECT name
FROM Employee
WHER title in (.....)

where (.....) is the list of titles.
Since I do not know the size of list of titles before hand, I do not quite know how to write the SQL statement.

Thanks,

John Chien





James, Steven wrote:

>Hi John,
>
>If you download the ibatis quick start guide http://cvs.apache.org/dist/ibatis/ibatis.java/docs/iBATIS-SqlMaps-2-Tutorial.pdf you will find this out i no time.
>
>Good luck you already have way there....
>
>Steve..
>
>________________________________
>
>From: John Chien [mailto:john.chien@ncmail.net]
>Sent: Thu 16/02/2006 14:13
>To: user-java@ibatis.apache.org
>Subject: List of data as input
>
>
>
>
>Dear Sir:
>
>Suppose that I have a table called Employee which has the folloing fields:
>
>name,
>date-of-birth,
>title,
>phone_number
>
>I want to write a SQL query using ibatis SQLMAP which will return a list
>of names which have the matching titles
>
>The matching titles are containend in an array or list. The number of
>the element in the array or list may vary.
>How can I write a SQL to do the job ?
>
>SELECT name
>FROM Employee
>WHER title = ????
>
>
>Thanks,
>
>John Chien
>
>
>
>
>
>This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
> 
>



Re: List of data as input

Posted by John Chien <jo...@ncmail.net>.
James:

I am not quite sure if I can find the solution in the tutorial because 
the input data is any array or list.

I have to write something like:

SELECT name
FROM Employee
WHER title in (.....)

where (.....) is the list of titles. 
Since I do not know the size of list of titles before hand, I do not quite know how to write the SQL statement.

Thanks,

John Chien





James, Steven wrote:

>Hi John,
> 
>If you download the ibatis quick start guide http://cvs.apache.org/dist/ibatis/ibatis.java/docs/iBATIS-SqlMaps-2-Tutorial.pdf you will find this out i no time.
> 
>Good luck you already have way there....
> 
>Steve..
>
>________________________________
>
>From: John Chien [mailto:john.chien@ncmail.net]
>Sent: Thu 16/02/2006 14:13
>To: user-java@ibatis.apache.org
>Subject: List of data as input
>
>
>
>
>Dear Sir:
>
>Suppose that I have a table called Employee which has the folloing fields:
>
>name,
>date-of-birth,
>title,
>phone_number
>
>I want to write a SQL query using ibatis SQLMAP which will return a list
>of names which have the matching titles
>
>The matching titles are containend in an array or list. The number of
>the element in the array or list may vary.
>How can I write a SQL to do the job ?
>
>SELECT name
>FROM Employee
>WHER title = ????
>
>
>Thanks,
>
>John Chien
>
>
>
>
>
>This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
>  
>

RE: List of data as input

Posted by "James, Steven" <st...@logicacmg.com>.
Hi John,
 
If you download the ibatis quick start guide http://cvs.apache.org/dist/ibatis/ibatis.java/docs/iBATIS-SqlMaps-2-Tutorial.pdf you will find this out i no time.
 
Good luck you already have way there....
 
Steve..

________________________________

From: John Chien [mailto:john.chien@ncmail.net]
Sent: Thu 16/02/2006 14:13
To: user-java@ibatis.apache.org
Subject: List of data as input




Dear Sir:

Suppose that I have a table called Employee which has the folloing fields:

name,
date-of-birth,
title,
phone_number

I want to write a SQL query using ibatis SQLMAP which will return a list
of names which have the matching titles

The matching titles are containend in an array or list. The number of
the element in the array or list may vary.
How can I write a SQL to do the job ?

SELECT name
FROM Employee
WHER title = ????


Thanks,

John Chien





This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

List of data as input

Posted by John Chien <jo...@ncmail.net>.
Dear Sir:

Suppose that I have a table called Employee which has the folloing fields:

name,
date-of-birth,
title,
phone_number

I want to write a SQL query using ibatis SQLMAP which will return a list 
of names which have the matching titles

The matching titles are containend in an array or list. The number of 
the element in the array or list may vary.
How can I write a SQL to do the job ?

SELECT name
FROM Employee
WHER title = ????


Thanks,

John Chien


Re: Error message - com.ibatis.common.jdbc.exception.NestedSQLExcepti on

Posted by Vincent NICOLAS <vi...@teamlog.com>.
Use java.sql.Date instead. Check if the projectId is not null.
Hope it helps.

Manikandan.R, ISDC Chennai a écrit :
> Hi
> In our web application we are trying to update a table. our query is,   
> <update id="updateProjectMasterDetails" 
> parameterClass="com.tracker.dto.project.ProjectMasterDTO">
>     UPDATE PROJECT_MASTER
>         SET
>             ORG_HIERARCHY_ID = #orgHierarchyId#,
>             PMO_NUMBER =  #pmoNumber#,
>             STAR_PRO_NUMBER =  #starProNumber#,
>             DESCRIPTION =  #description#,
>             IMPACT_DETAIL =  #impactDetail#,
>             STATUS =  #status#,
>             PRIORITY =  #priority#,
>             CATEGORY =  #category#,
>             ESUBMIT_MODEL = #esubmitModel#,
>             QUARTER_OF_IMPLEMENTATION = #quaterOfImpl#,
>             MODEL_OFFICE_1 =  #modelOffice1#,
>             MODEL_OFFICE_2 =  #modelOffice2#,
>             SIZE_OF_EFFORT =  #sizeOfEffort#,
>             MEASUREMENT_VER_DETAIL =  #measurementVerDetail#,
>             DEPARTMENT_INVL_DETAIL =  #invlOtherDepartments#,
>             NINTY_DAY_ACTION_PLAN =  #nintyDayActionPlan#,
>             PRIMARY_SYSTEM =  #primarySystem#,
>             SECONDARY_SYSTEM =  #secondarySystem#,
>             BUSINESS_OWNER =  #businessOwner#,
>             PROJECT_OWNER =  #projectOwner#,
>             BUSINESS_AREA_LEAD = #businessAreaLead#,
>             PROJECT_LEAD =  #projectLead#,
>             IT_LEAD_1 = #itLead1#,
>             IT_LEAD_2 =  #itLead2#,
>             IT_LEAD_3 =  #itLead3#,
>             DATE_PLAN_CREATED =  #datePlanCreated:DATE#,
>             COMPLETION_DATE_IMPACT =  #completionDateImpact:DATE#,
>             QUARTER_OF_UPDATE =  #quarterOfUpdate#,
>             PERCENTAGE_COMPLETE =  #percentageComplete#,
>             PLANNED_START_DATE = #plannedStartDate:DATE#,
>             PLANNED_END_DATE =  #plannedEndDate:DATE#,
>             ACTUAL_START_DATE = #actualStartDate:DATE#,
>             ACTUAL_END_DATE =  #actualEndDate:DATE#,
>             MODIFIED_USER_ID =  #modifiedUserId#,
>             MODIFIED_DATE =  SYSDATE
>     WHERE
>         PROJECT_ID = #projectId#       
> </update>
>  
> some times this query is executed without any error, *particularly for 
> the first request **after the application being started*. For all the 
> subsequent requests we run in to following error. The error messages 
> also not consistent, most of the time error messages are either of the 
> following.
> --- Check the parameter mapping for the 'actualStartDate' property.
> --- Check the parameter mapping for the 'actualEndDate' property.
> --- Check the parameter mapping for the 'projectId' property.
>  
> The data type in the DTO are
>     actualStartDate - java.util.Date
>     actualEndDate - java.util.Date
>     projectId -  BigDecimal 
>  
> The date type of the corresoponding fields in tabel are (Data base is 
> Oracle 9i)
>     actualStartDate - Date
>     actualEndDate - Date
>     projectId -  Number
>  
> The stack trace is as follow,
> com.ibatis.common.jdbc.exception.NestedSQLException:  
> --- The error occurred in com/tracker/dao/conf/sqlMap/projectMap.xml. 
> --- The error occurred while applying a parameter map. 
> --- Check the updateProjectMasterDetails-InlineParameterMap. 
> --- Check the parameter mapping for the 'actualEndDate' property. 
> --- Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
> Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
> [2/15/06 23:08:24:225 GMT+05:30] 282fda15 SystemErr     
> Caused by:
> [2/15/06 23:08:24:225 GMT+05:30] 282fda15 SystemErr      
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>  
> our working environment is webspher application server 5.0. we 
> dont understand the cause of the problem any help could be really 
> appreciated.
>  
> thanks in advance
> Manikandan


-- 
Vincent NICOLAS
Teamlog, Lyon