Hi,

I tried in this way and now I got it working. I removed explicit casting.

Thanks.

Krishna.

public List getMonthdao() throws DaoException
{
return  super.getList("UserCheckSQL.getMonthsList", null);
}
}



Brandon Goodin <[EMAIL PROTECTED]> wrote:
try this:

public List getMonthdao() throws DaoException
{
return (List) super.getList("UserCheckSQL.getMonthsList", null);
}
}

Brandon

On Fri, 17 Dec 2004 12:59:46 -0800 (PST), Krishna Mohan
<[EMAIL PROTECTED]>wrote:
> Hi,
>
> I am using Struts 1.1 with back end as ibatis sql-maps 2.0 ./ tomcat
> server 5.0.30
>
> My target is to display the month names on a jsp and not able to do it.
> I am getting [class java.lang.ClassCastException] .
>
> can you pls tell me where I am doing the mistake.
>
> From the service method, I am instantiating a dao class, which is making a
> call to the getList method of BaseDAO.
> Here with System.out.println statements , I have observed that it has
> created list of beans. But in the EmployeeDAO , it is throwing the error
> as
> java.lang.ClassCastException.
>
>
>
> > "http://www.ibatis.com/dtd/sql-map-2.dtd">
>
>
>
>
>

>
> SELECT MONTHDESC from mt_month
>

>

>
> My service method is as follows:
>
> public class UserService {
>
> private static EmployeeDAO dao = new EmployeeDAO();
>
> public List getMonthNames() throws DaoException
> {
> return dao.getMonthdao();
> }
>
> }
>
> ------------------------------------------
> EmployeeDAO
> ------------------------------------------
>
> public class EmployeeDAO extends BaseDAO {
>
> public List getMonthdao() throws DaoException
> {
> return (List) super.getList("getMonthsList", null);
> }
> }
>
> ------------------------------
> BaseDAO - method signature.
> -----------------------------
> public List getList(String statementName, Object parameterObject) throws
> DaoException
>
>
> Thanks
> Krishna.
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com


Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.

Reply via email to