Error que me tira en ibatis!!

258 views
Skip to first unread message

Karina Sanchez

unread,
May 2, 2011, 3:41:32 PM5/2/11
to jav...@googlegroups.com
Alguien me puede ayudar con el siguiente problema:

Tengo una tabla que se llama webContacts, de la cual tiene uno de sus campos es id type number
Despues tengo el pojo Webcontacts.java

public

class WebContact implements Serializable {

    private String id;

    //ademas atributos;
 

   public

String getId() {

      return id;

  }

   public void setId(String id) {

       this.id = id;

   }

}

Despues tengo el xml de WebContacts.xml

<

resultMap id="contactSector"
class="webContact">

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

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

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

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

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

</resultMap>

<

select id="getDatosMails" resultMap = "contactSector" resultClass = "ar.com.nextel.webcontacts.pojos.WebContact" parameterClass="java.lang.String">

SELECT web_contacts.email_adress, web_contacts.comments_from_contact,

web_contacts.sector_id,

sectores_web_contacts.email_sector

FROM web_contacts, sectores_web_contacts

WHERE web_contacts.id = #id:VARCHAR# AND sectores_web_contacts.id = web_contacts.sector_id;

</select>

 

Y ademas en el clase WebContactsSqlMapDao.java

public

class WebContactsSqlMapDao extends BaseSqlMapDao implements WebContactsDao{

          public

WebContact getDatosMails(String id) throws WebContactsException {

                       WebContact contacto =

null;

                      try{

                           contacto = (WebContact)

this.queryForObject("getDatosMails", id);

                           logger.debug("El contacto fue obtenido.");

                        }

catch(Exception e){

                                logger.error("Error al intentar obtener el contacto con id " + id);

                               logger.error("Stack Trace: ", e);

                              throw new WebContactsException(e);

                         }

                         return contacto;

            }

}

No se lo que estoy haciendo mal que me esta tirando un error:

 

Stack Trace:

com.ibatis.dao.client.DaoException

: Failed to execute queryForObject - id [getDatosMails], parameterObject [206359]. Cause: com.ibatis.common.jdbc.exception.NestedSQLException:

--- The error occurred in ar/com/nextel/webcontacts/dao/persistance/sqlmapdao/sql/WebContacts.xml.

--- The error occurred while applying a parameter map.

--- Check the getDatosMails-InlineParameterMap.

--- Check the statement (query failed).

--- Cause:

java.sql.SQLException: ORA-00911: invalid character

Caused by:

java.sql.SQLException: ORA-00911: invalid character

Caused by:

com.ibatis.common.jdbc.exception.NestedSQLException:

--- The error occurred in ar/com/nextel/webcontacts/dao/persistance/sqlmapdao/sql/WebContacts.xml.

--- The error occurred while applying a parameter map.

--- Check the getDatosMails-InlineParameterMap.

--- Check the statement (query failed).

--- Cause:

java.sql.SQLException: ORA-00911: invalid character

 

 

 

 

 

 

 




--
Kary

Pablo Codeiro

unread,
May 2, 2011, 4:01:29 PM5/2/11
to jav...@googlegroups.com
Creo que tu query tiene un punto y coma que no deberia estar.

(digo, porque te tira: "ORA-00911: invalid character", y el punto y coma está al vicio en la query)

SELECT web_contacts.email_adress, web_contacts.comments_from_contact,

web_contacts.sector_id,

sectores_web_contacts.email_sector

FROM web_contacts, sectores_web_contacts

WHERE web_contacts.id = #id:VARCHAR# AND sectores_web_contacts.id = web_contacts.sector_id;


2011/5/2 Karina Sanchez <karinap...@gmail.com>

--
www.JavaSOS.com
Grupo de colaboración Java/J2ee para desarrolladores de habla hispana.

Pablo Codeiro

unread,
May 4, 2011, 6:37:16 PM5/4/11
to jav...@googlegroups.com
Y, te funciono?

2011/5/2 Pablo Codeiro <cutr...@gmail.com>

Karina Sanchez

unread,
May 4, 2011, 9:47:07 PM5/4/11
to jav...@googlegroups.com
gracias!!!
 
me funciono la query en ibatis!!
 
Saludos.

2011/5/4 Pablo Codeiro <cutr...@gmail.com>



--
Kary
Reply all
Reply to author
Forward
0 new messages