hi,
i have a problem with inserting a row to the table. I'm using struts2 + hibernate + postgre. The problem is that, i have a table which have 8 columns and when i try to insert a new row to the table, i get the following error.
Code:
Hibernate:
select
nextval ('kisi_pk_seq')
Hibernate:
insert
into
kisi
(ad, adres, cep_no, dogum_tarihi, mail, soyad, tel_no, DTYPE, id)
values
(?, ?, ?, ?, ?, ?, ?, 'Kisi', ?)
24.May.2009 02:34:32 org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: null
24.May.2009 02:34:32 org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Tpilı iş girişi 0 insert into kisi (ad, adres, cep_no, dogum_tarihi, mail, soyad, tel_no, DTYPE, id) values (mahmut, malatya, 5333699129, 3886-08-01 +03:00:00, g@hotmail.com, tuncer, 5333699129, 'Kisi', 450) durduruldu. Nedenini görmek için getNextException fonksiyonu çağırın.
24.May.2009 02:34:32 org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: 42703
24.May.2009 02:34:32 org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: ERROR: column "dtype" of relation "kisi" does not exist
24.May.2009 02:34:32 org.hibernate.event.def.AbstractFlushingEventListener performExecutions
SEVERE: Could not synchronize database state with session
org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.AKS.util.HibernateUtil.save(HibernateUtil.java:56)
at com.AKS.veriTabani.KisiVeriTabani.kisiEkle(KisiVeriTabani.java:16)
at com.AKS.veriTabani.deneme.main(deneme.java:12)
Caused by: java.sql.BatchUpdateException: Tpilı iş girişi 0 insert into kisi (ad, adres, cep_no, dogum_tarihi, mail, soyad, tel_no, DTYPE, id) values (mahmut, malatya, 5347699129, 3886-08-01 +03:00:00, g@hotmail.com, tuncer, 5347699129, 'Kisi', 450) durduruldu. Nedenini görmek için getNextException fonksiyonu çağırın.
at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2528)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1344)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:344)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2663)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 10 more
The problem is the table doesn't have a column with type DTYPE. And i guess i am getting the error because of it. Just to be sure i have tried to insert to an another table and there wasn't any column with type DTYPE and neither an error. Here is the result of that query:
Code:
Hibernate:
insert
into
sehir
(ad, kod)
values
(?, ?)
(Sorry, some parts of the outputs are Turkish)So, what can be the problem?
thanks in advance..