第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

如何保持BLOB對象

- SQL Error: 17090, SQLState: null
- 不允許的操作: streams type cannot be used in batching
- Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not insert: [Students]
?at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
?at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
?at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
?at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2078)
?at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2427)
?at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
?at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
?at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
?at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
?at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
?at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
?at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
?at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
?at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
?at StudentsTest.tearDown(StudentsTest.java:34)
?at junit.framework.TestCase.runBare(TestCase.java:136)
?at junit.framework.TestResult$1.protect(TestResult.java:106)
?at junit.framework.TestResult.runProtected(TestResult.java:124)
?at junit.framework.TestResult.run(TestResult.java:109)
?at junit.framework.TestCase.run(TestCase.java:120)
?at junit.framework.TestSuite.runTest(TestSuite.java:230)
?at junit.framework.TestSuite.run(TestSuite.java:225)
?at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
?at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.sql.SQLException: 不允許的操作: streams type cannot be used in batching
?at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
?at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
?at oracle.jdbc.driver.OraclePreparedStatement.addBatch(OraclePreparedStatement.java:3775)
?at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:30)
?at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2062)
?... 24 more


部分代碼是這樣寫的

??InputStream?input?=?new?FileInputStream(file);
??byte[]?byteArray?=?new?byte[input.available()];
??input.read(byteArray);
??input.close();
??Students?students?=?new?Students("張三豐",?"男",?new?Date(),?"武當(dāng)山");
??Blob?pictrue?=?Hibernate.createBlob(byteArray);
?students.setPictrue(pictrue);
?System.out.println(students.getPictrue());
?session.save(students);

正在回答

3 回答

哦,我直接用的它給的jar包,就可以的。Blob?pictrue?=?Hibernate.createBlob(byteArray);這里是不是應(yīng)該傳input進(jìn)來呢?,因?yàn)閳D片文件在input里面。

0 回復(fù) 有任何疑惑可以回復(fù)我~

我也出錯(cuò)了難受

0 回復(fù) 有任何疑惑可以回復(fù)我~

兄弟,Hibernate.createBlob(byteArray);這個(gè)方法好像沒有???可以通過編譯?

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

car 提問者

有,是hibernate3.x的
2016-10-05 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

如何保持BLOB對象

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號