org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.GenericJDBCException: 无效的列索引; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: 无效的列索引 org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.GenericJDBCException: 无效的列索引; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: 无效的列索引 at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:321) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:403) at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
原因:当输入的字段有单引号,会报无效的列索引,解决办法,在input框里添加条件
<input id="txt_gps_equipment_no" type="text" οnkeyup="LimitEscape(this)" οnblur="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="32">