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.
 
 
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
 "http://www.ibatis.com/dtd/sql-map-2.dtd">
 
<sqlMap namespace="UserCheckSQL">
<resultMap id="get-Months-List"  class="com.Monthdom">
      <result property="month" column="MONTHDESC"/> 
 </resultMap>
 <statement  id="getMonthsList"  resultMap="get-Months-List">
      SELECT MONTHDESC from mt_month   
 </statement>
</sqlMap>
 
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

Reply via email to