I가 최대 절전 모드에서 다음 개체 :SQLStateConverter.handledNonSpecificException 최대 절전 모드
@Entity
public class Contact implements Serializable {
private static final long serialVersionUID = 1L;
@Temporal(TemporalType.DATE)
private Date birthday;
}
나 최대 절전 모드의이 메서드를 호출 :
org.hibernate.exception.GenericJDBCException: could not load an entity: [com.mycompany.model.Contact#3]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
}
: 나는 다음과 같은 예외가
public Object get(Class entityClass, Serializable id) throws HibernateException {
return get(entityClass.getName(), id);
}
이 간단한 코드를 사용해 보았습니다.
Statement st = conn.createStatement();
ResultSet res = st.executeQuery("select registration_date from contact where contact_id=3");
Date i = res.getDate(1);
그리고 제대로 작동합니다.
무엇이 문제입니까?
Date
의 유형은 두 경우 모두 java.util.Date
입니다.
편집을 할
는나는 그것을 더 이상 디버깅 및 예외는 것을보고 :이
Bad format for DATE '517' in column 2.
날짜 : 1985년 5월 17일
데이터베이스의 날짜 컬럼의 데이터 유형은 무엇이며 어떤 RDBMS입니까? – centic
@centic 유형은 날짜 및 데이터입니다. RDMBS는 무엇을 의미합니까? 나는 mysql이다. – Dejell