JAVA + Hibernate 사용중 발생하는 오류 정리
JAVA(SWING) + HIBERNATE 사용중 발생하는 오류를 정리
1. Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
=> list에서 item을 get 하려는데 리스트의 길이가 0이네요. 0번을 빼올려는데 0번째 아이템이 없으므로 인덱스에러 뿜뿜.
2. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
=> 쿼리를 실행하고 나서 결과를 RETUEN 할 때 해당하는 데이터가 없을때 발생.
3. parenttables is not mapped => BEAN 클래스명을 적어야함
4. Exception in thread "AWT-EventQueue-0" org.hibernate.exception.JDBCConnectionException: Error calling Driver#connect
=> 데이터베이스 드라이브 접속을 할수 없을때 (드라이버 확인)
5. org.hibernate.hql.internal.ast.QuerySyntaxException: TestTables is not mapped [from 테이블명 order by 필드명 asc]
=> hibernate가 데이터베이스 해당 테이블에 액세스 할 수 없을때 ( hibernate XML 확인)
6. Exception in thread "main" org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
=> hibernate.cfg.xml 에서 entiity연결 확인
7. org.hibernate.exception.SQLGrammarException: could not extract ResultSet
=> db에 해당 테이블이 없을때 ( DB 확인 )