Results 1 to 4 of 4
- 06-28-2007, 01:48 PM #1
Senior Member
- Join Date
- Jun 2007
- Posts
- 119
- Rep Power
- 0
org.hibernate.exception.GenericJDBCException: could not insert
Hi,
I am new to hibernate and would like to store a image using Blob in oracle database.
I am creating a java.sql.Blob instance using Hibernate.createBlob(InputStream in) method. But when i try to save the object into the database this error appears
mmm any ideas?Java Code:org.hibernate.exception.GenericJDBCException: could not insert: [user.Product] at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException (ErrorCodeConverter.java:92) at org.hibernate.exception.ErrorCodeConverter.convert (ErrorCodeConverter.java:80) at org.hibernate.exception.JDBCExceptionHelper.convert (JDBCExceptionHelper.java:43) at org.hibernate.persister.BasicEntityPersister.insert (BasicEntityPersister.java:1683) at org.hibernate.persister.BasicEntityPersister.insert (BasicEntityPersister.java:2012) at org.hibernate.action.EntityInsertAction.execute (EntityInsertAction.java:42) at org.hibernate.impl.ActionQueue.executeActions (ActionQueue.java:232) at org.hibernate.impl.ActionQueue.executeActions (ActionQueue.java:137) at org.hibernate.event.AbstractFlushingEventListener.performExecutions (AbstractFlushingEventListener.java:255) at org.hibernate.event.DefaultFlushEventListener.onFlush (DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:814) at org.hibernate.transaction.JDBCTransaction.commit (JDBCTransaction.java:75) at oracle.jdbc.dbaccess.DBError.throwSqlException (DBError.java:179) at oracle.jdbc.driver.OraclePreparedStatement.addBatch (OraclePreparedStatement.java:4073)
- 07-04-2007, 01:57 PM #2
Senior Member
- Join Date
- Jun 2007
- Posts
- 110
- Rep Power
- 0
Are you mapping your blob to byte[] array?
- 07-04-2007, 02:00 PM #3
Senior Member
- Join Date
- Jun 2007
- Posts
- 164
- Rep Power
- 6
Here that is the problem
Dadidadida: 06/01/2005 - 07/01/2005
- 07-12-2010, 07:15 AM #4
Member
- Join Date
- Jul 2010
- Posts
- 1
- Rep Power
- 0
Hi
Hi, I am trying to insert xml data into database of clob type which is around 25000 characters. but when i am inserting data it is accepting only 2500 character and if it above that it is throwing an error saying,
Can you please tell me what is the issue with this.
org.hibernate.exception.GenericJDBCException: could not insert: [Hibernate.XmlPojo1]
at org.hibernate.exception.ErrorCodeConverter.handled NonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert (ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.BasicEntityPersiste r.insert(BasicEntityPersister.java:1869)
at org.hibernate.persister.entity.BasicEntityPersiste r.insert(BasicEntityPersister.java:2200)
at org.hibernate.action.EntityInsertAction.execute(En tityInsertAction.java:46)
at org.hibernate.engine.ActionQueue.execute(ActionQue ue.java:239)
at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:223)
at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:136)
at org.hibernate.event.def.AbstractFlushingEventListe ner.performExecutions(AbstractFlushingEventListene r.java:274)
at org.hibernate.event.def.DefaultFlushEventListener. onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.j ava:730)
at org.hibernate.impl.SessionImpl.managedFlush(Sessio nImpl.java:324)
at org.hibernate.transaction.JDBCTransaction.commit(J DBCTransaction.java:86)
at Demo.Demo.main(Demo.java:109)
Caused by: java.sql.SQLException: Data size bigger than max size for this type: 20316
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:114)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:156)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.j ava:775)
at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java :82)
at oracle.jdbc.driver.OraclePreparedStatement.setItem (OraclePreparedStatement.java:771)
at oracle.jdbc.driver.OraclePreparedStatement.setStri ng(OraclePreparedStatement.java:1136)
at org.hibernate.type.StringType.set(StringType.java: 24)
at org.hibernate.type.NullableType.nullSafeSet(Nullab leType.java:62)
at org.hibernate.type.NullableType.nullSafeSet(Nullab leType.java:39)
at org.hibernate.persister.entity.BasicEntityPersiste r.dehydrate(BasicEntityPersister.java:1617)
at org.hibernate.persister.entity.BasicEntityPersiste r.dehydrate(BasicEntityPersister.java:1594)
at org.hibernate.persister.entity.BasicEntityPersiste r.insert(BasicEntityPersister.java:1850)
... 11 more
Similar Threads
-
SQL Insert Help!!!!
By shaungoater in forum New To JavaReplies: 1Last Post: 06-14-2008, 03:14 AM -
Trouble with factory method - unhandled exception type Exception
By desmond5 in forum New To JavaReplies: 1Last Post: 03-08-2008, 06:41 PM -
How do insert a Graphic
By carl in forum New To JavaReplies: 1Last Post: 08-01-2007, 05:30 AM -
how to insert tables into JTextPane
By osval in forum AWT / SwingReplies: 1Last Post: 07-29-2007, 09:11 AM -
org.hibernate.ejb.Version <clinit> INFO: Hibernate EntityManager 3.2.0.CR1
By Heather in forum JDBCReplies: 2Last Post: 06-30-2007, 03:01 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks