-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Use the hibernate take the picture that oracle , Error?
PostPosted: Sun Feb 12, 2006 10:44 pm 
Newbie

Joined: Thu Dec 15, 2005 10:27 pm
Posts: 2
Software environment:
oracle 9i
hibernate 3.0.5

hibernate.cfg.xml

<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.datasource">jdbc/pool/lbs</property>
<property name="hibernate.jdbc.batch_size">0</property>
<property name="hibernate.connection.provider_class">org.hibernate.connection.DatasourceConnectionProvider</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>

java file
import java.sql.Blob;
public void setHEADPICIMAGE(Blob HEADPICIMAGE) {
this.HEADPICIMAGE = HEADPICIMAGE;
}
public Blob getHEADPICIMAGE() {
return HEADPICIMAGE;
}
Map file:
<property
name="HEADPICIMAGE"
type="java.sql.Blob"
column="HEADPICIMAGE"
/>

The mistake hint:
java.lang.NullPointerException
at oracle.sql.LobPlsqlUtil.plsql_getChunkSize(LobPlsqlUtil.java:1215)
at oracle.sql.LobPlsqlUtil.plsql_getChunkSize(LobPlsqlUtil.java:121)
at oracle.jdbc.dbaccess.DBAccess.getLobChunkSize(DBAccess.java:955)
at oracle.sql.LobDBAccessImpl.getChunkSize(LobDBAccessImpl.java:111)
at oracle.sql.BLOB.getChunkSize(BLOB.java:228)
at oracle.sql.BLOB.getBufferSize(BLOB.java:242)
at oracle.sql.BLOB.getBinaryStream(BLOB.java:124)

Analyze:
Blob blob = ih.getHEADPICIMAGE() ;
Time blob adjusted to try of object is not for empty.But adjust to use
InputStream in = blob.getBinaryStream();
ot time throw a NullPointerException


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.