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 Warren Bell <wa...@clarksnutrition.com> on 2005/08/18 01:49:22 UTC

preparation failed "UndeclaredThrowableException"

I am getting a preparation falied "UndeclaredThrowableException" when I
call:

return (Integer) executeQueryForObject("getTaxable", item);

The SQL Map is:

  <select id="getTaxable" parameterClass="item"
resultClass="java.lang.Integer">
    SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain,
ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK =
ecrs_StockInventoryLinkTax.ILT_INV_FK AND ecrs_v_InventoryMaster.INV_CPK =
ecrs_StockInventoryLinkTax.ILT_INV_CFK AND
ecrs_StockInventoryLinkTax.ILT_TAX_FK = ecrs_TaxMain.TAX_PK AND
ecrs_v_InventoryMaster.INV_ScanCode = #upc:CHAR#
  </select>

What am I doing wrong?

Thanks,

Warren Bell



RE: preparation failed "UndeclaredThrowableException"

Posted by Warren Bell <wa...@clarksnutrition.com>.
My mistake, SQL SELECT incorrect.

-----Original Message-----
From: Warren Bell [mailto:warren@clarksnutrition.com]
Sent: Thursday, August 18, 2005 7:09 AM
To: user-java@ibatis.apache.org; lmeadors@apache.org
Subject: RE: preparation failed "UndeclaredThrowableException"


Yes, item is a type alias. I run this SELECT in a db client, and it works
fine. I am running this on Sybase, using an ODBC driver on Windows. I have
not had any luck using Sybase's JDBC driver. I know that ODBC drivers can be
a problem, and I am wondering if that may be the cause. Here is the Ibatis
exception info:

com.ibatis.dao.client.DaoException: Error executing query for object.
Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in
com/clarks/spanky/persistence/sqlmapdao/sql/sybase/item-sybase.xml.
--- The error occurred while executing query.
--- Check the
    SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain,
ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK =
ecrs_StockInventoryLinkTax.ILT_INV_FK AND ecrs_v_InventoryMaster.INV_CPK =
ecrs_StockInventoryLinkTax.ILT_INV_CFK AND
ecrs_StockInventoryLinkTax.ILT_TAX_FK = ecrs_TaxMain.TAX_PK AND
ecrs_v_InventoryMaster.INV_ScanCode = ?
  .
--- Check the SQL Statement (preparation failed).
--- Cause: java.lang.reflect.UndeclaredThrowableException
Caused by: java.lang.reflect.UndeclaredThrowableException
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in
com/clarks/spanky/persistence/sqlmapdao/sql/sybase/item-sybase.xml.
--- The error occurred while executing query.
--- Check the
    SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain,
ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK =
ecrs_StockInventoryLinkTax.ILT_INV_FK AND ecrs_v_InventoryMaster.INV_CPK =
ecrs_StockInventoryLinkTax.ILT_INV_CFK AND
ecrs_StockInventoryLinkTax.ILT_TAX_FK = ecrs_TaxMain.TAX_PK AND
ecrs_v_InventoryMaster.INV_ScanCode = ?
  .
--- Check the SQL Statement (preparation failed).
--- Cause: java.lang.reflect.UndeclaredThrowableException
Caused by: java.lang.reflect.UndeclaredThrowableException
##########

-----Original Message-----
From: Larry Meadors [mailto:larry.meadors@gmail.com]
Sent: Thursday, August 18, 2005 5:12 AM
To: user-java@ibatis.apache.org
Subject: Re: preparation failed "UndeclaredThrowableException"


We need more info...can you give us a stack trace?

Is "item" a type alias?

Larry


On 8/17/05, Warren Bell <wa...@clarksnutrition.com> wrote:
> I am getting a preparation falied "UndeclaredThrowableException" when I
> call:
>
> return (Integer) executeQueryForObject("getTaxable", item);
>
> The SQL Map is:
>
>   <select id="getTaxable" parameterClass="item"
> resultClass="java.lang.Integer">
>     SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain,
> ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK =
> ecrs_StockInventoryLinkTax.ILT_INV_FK AND ecrs_v_InventoryMaster.INV_CPK =
> ecrs_StockInventoryLinkTax.ILT_INV_CFK AND
> ecrs_StockInventoryLinkTax.ILT_TAX_FK = ecrs_TaxMain.TAX_PK AND
> ecrs_v_InventoryMaster.INV_ScanCode = #upc:CHAR#
>   </select>
>
> What am I doing wrong?
>
> Thanks,
>
> Warren Bell
>
>
>




RE: preparation failed "UndeclaredThrowableException"

Posted by Warren Bell <wa...@clarksnutrition.com>.
Yes, item is a type alias. I run this SELECT in a db client, and it works
fine. I am running this on Sybase, using an ODBC driver on Windows. I have
not had any luck using Sybase's JDBC driver. I know that ODBC drivers can be
a problem, and I am wondering if that may be the cause. Here is the Ibatis
exception info:

com.ibatis.dao.client.DaoException: Error executing query for object.
Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in
com/clarks/spanky/persistence/sqlmapdao/sql/sybase/item-sybase.xml.
--- The error occurred while executing query.
--- Check the
    SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain,
ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK =
ecrs_StockInventoryLinkTax.ILT_INV_FK AND ecrs_v_InventoryMaster.INV_CPK =
ecrs_StockInventoryLinkTax.ILT_INV_CFK AND
ecrs_StockInventoryLinkTax.ILT_TAX_FK = ecrs_TaxMain.TAX_PK AND
ecrs_v_InventoryMaster.INV_ScanCode = ?
  .
--- Check the SQL Statement (preparation failed).
--- Cause: java.lang.reflect.UndeclaredThrowableException
Caused by: java.lang.reflect.UndeclaredThrowableException
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in
com/clarks/spanky/persistence/sqlmapdao/sql/sybase/item-sybase.xml.
--- The error occurred while executing query.
--- Check the
    SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain,
ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK =
ecrs_StockInventoryLinkTax.ILT_INV_FK AND ecrs_v_InventoryMaster.INV_CPK =
ecrs_StockInventoryLinkTax.ILT_INV_CFK AND
ecrs_StockInventoryLinkTax.ILT_TAX_FK = ecrs_TaxMain.TAX_PK AND
ecrs_v_InventoryMaster.INV_ScanCode = ?
  .
--- Check the SQL Statement (preparation failed).
--- Cause: java.lang.reflect.UndeclaredThrowableException
Caused by: java.lang.reflect.UndeclaredThrowableException
##########

-----Original Message-----
From: Larry Meadors [mailto:larry.meadors@gmail.com]
Sent: Thursday, August 18, 2005 5:12 AM
To: user-java@ibatis.apache.org
Subject: Re: preparation failed "UndeclaredThrowableException"


We need more info...can you give us a stack trace?

Is "item" a type alias?

Larry


On 8/17/05, Warren Bell <wa...@clarksnutrition.com> wrote:
> I am getting a preparation falied "UndeclaredThrowableException" when I
> call:
>
> return (Integer) executeQueryForObject("getTaxable", item);
>
> The SQL Map is:
>
>   <select id="getTaxable" parameterClass="item"
> resultClass="java.lang.Integer">
>     SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain,
> ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK =
> ecrs_StockInventoryLinkTax.ILT_INV_FK AND ecrs_v_InventoryMaster.INV_CPK =
> ecrs_StockInventoryLinkTax.ILT_INV_CFK AND
> ecrs_StockInventoryLinkTax.ILT_TAX_FK = ecrs_TaxMain.TAX_PK AND
> ecrs_v_InventoryMaster.INV_ScanCode = #upc:CHAR#
>   </select>
>
> What am I doing wrong?
>
> Thanks,
>
> Warren Bell
>
>
>



Re: preparation failed "UndeclaredThrowableException"

Posted by Larry Meadors <la...@gmail.com>.
We need more info...can you give us a stack trace? 

Is "item" a type alias?

Larry


On 8/17/05, Warren Bell <wa...@clarksnutrition.com> wrote:
> I am getting a preparation falied "UndeclaredThrowableException" when I
> call:
> 
> return (Integer) executeQueryForObject("getTaxable", item);
> 
> The SQL Map is:
> 
>   <select id="getTaxable" parameterClass="item"
> resultClass="java.lang.Integer">
>     SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain,
> ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK =
> ecrs_StockInventoryLinkTax.ILT_INV_FK AND ecrs_v_InventoryMaster.INV_CPK =
> ecrs_StockInventoryLinkTax.ILT_INV_CFK AND
> ecrs_StockInventoryLinkTax.ILT_TAX_FK = ecrs_TaxMain.TAX_PK AND
> ecrs_v_InventoryMaster.INV_ScanCode = #upc:CHAR#
>   </select>
> 
> What am I doing wrong?
> 
> Thanks,
> 
> Warren Bell
> 
> 
>