Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Not A Problem
-
3.0 Beta 4, 3.0 Beta 9
-
None
-
Ibatis jar: ibatis-3-core-3.0.0.227.jar
JDK: java version "1.6.0_14"
Application Server: JBoss 5.10
BBDD: Informix 9
OS: Ubuntu 9.10 64bits
Description
I have a simple POJO:
public class Participante implements java.io.Serializable{
private Integer nroPartic;
private String cveTipoPartic;
private String codPartic;
private String nomPartic;
private String nemoPartic;
private String codAge;
private String email;
// Gettter y Setters ...
}
My mapped update is:
<update id="actualizaParticipante" parameterType="patito.vo.Participante">
UPDATE participante
SET
cvetipopartic = ${cveTipoPartic},
codpartic = ${codPartic},
nompartic = ${nomPartic},
nemopartic = ${nemoPartic},
codage = ${codAge},
email = ${email}
WHERE
nroPartic = ${nroPartic}
</update>
Code for execute the update is:
public void actualizaParticipante(Participante participante) {
SqlSession sqlSession = sqlSessionFactory.openSession();
try
finally
{ sqlSession.close(); }}
But when the app run throw the following exception:
-
-
- Error updating database. Cause: java.sql.SQLException: A syntax error has occurred.
- The error may exist in patito/dao/subasta/SubastaDAO.xml
- The error may involve patito.dao.subasta.SubastaDAO.actualizaParticipante
- The error occurred while executing an update
- SQL: UPDATE participante SET cvetipopartic = X, codpartic = 1111 , nompartic = FONDO XXXXXXXXX XXXXXXXXX (XXXX) , nemopartic = FDO.RAL , codage = 1234, email = tabata@mail.com WHERE nroPartic = 5432
- Cause: java.sql.SQLException: A syntax error has occurred.
-
Formatting the SQL:
UPDATE participante
SET
cvetipopartic = X,
codpartic = 1111 ,
nompartic = FONDO XXXXXXXXX XXXXXXXXX (XXXX) ,
nemopartic = FDO.RAL ,
codage = 1234,
email = tabata@mail.com
WHERE nroPartic = 5432
<strong> IBATIS is not adding the single quotes for String java data type. <strong>