ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: MySQLSyntaxErrorException
Date Thu, 24 May 2007 23:52:26 GMT
Loose the extraneous comma after candidate_surname.

-----Original Message-----
From: Okan Çetin [mailto:okancetin@gmail.com] 
Sent: vrijdag 25 mei 2007 1:41
To: user-java@ibatis.apache.org
Subject: MySQLSyntaxErrorException

Hello,
Candidate.xml:

<insert id="insertCandidate" parameterClass="Candidate">
    insert into candidate (
      candidate_name,
      candidate_surname,
    )
    values (
       #candidate_name#, #candidate_surname#
    )
  </insert>

But it causes this error:

com.ibatis.common.jdbc.exception.NestedSQLException: --- The error
occurred in ibatis/Candidate.xml. --- The error occurred while
applying a parameter map. --- Check the
insertCandidate-InlineParameterMap. --- Check the statement (update
failed). --- Cause:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error
in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near ') values ( 'sample',
'sample' )' at line 1

What is the problem?

Thanks,

Mime
View raw message