Error in insert statement for HSQL DB
I have Spring data rest application & for unit testing these services, I am using Spring Boot & HSQL in memory databse. But while inserting data into the HSQL table at runtime, I am getting an error. While other insert statements are working, I am getting this error only for 1 insert statement.
Error
Caused by: java.sql.SQLException: Column count does not match in statement
Insert Statement in SQL file
Insert into countries (ID,COUNTRY,CODE) values (2,'UNITED STATES','US');
Note:- In the same application insert for other tables are working & retrieval of the data from the table is also successful.
Entity - Using this HSQL create the table.
@Entity
@Table(name = "COUNTRIES")
public class Country implements Describable, Serializable {
@Id
@SequenceGenerator(name="CountriesSeq",sequenceName="SEQ_COUNTRIES")
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CountriesSeq")
protected Integer id;
@Column(name = "CODE")
private String code;
@Column(name = "COUNTRY")
private String country;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
}
Thanks
This issue is resolved. The table had trigger on it which I didnt notice. Thanks for your input Acewin.
链接地址: http://www.djcxy.com/p/88634.html下一篇: HSQL DB的插入语句出错