-->
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.  [ 2 posts ] 
Author Message
 Post subject: what's the difference between the jdbc and hibernate?
PostPosted: Tue Jan 13, 2004 1:52 am 
Newbie

Joined: Mon Jan 12, 2004 6:26 am
Posts: 10
whe i use the connection which get from jdbc to call a procedure,it works well.but when i use the connection which get from Hibernate.getSession().connection(),it does't work.my code as follow:


CallableStatement cs;
try {

cs = connection.prepareCall("{call sp_zyjs_match(?,?,?,?)}");
cs.registerOutParameter(4, Types.VARCHAR);
cs.setInt(1,1);
cs.setString(2, "1000000000");
cs.setString(3,"admin");
cs.execute();
String outParam=cs.getString(4);
System.out.println("message = " + outParam);

......

the error is:

java.lang.NullPointerException
at oracle.jdbc.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:535)
at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1642)
at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:745)
at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:1083)
at OracleProdedure.callProcedure(OracleProdedure.java:91)
at OracleProdedure.main(OracleProdedure.java:121)


can anyone tell me why?? thanks!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 5:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
One post is enough - http://forum.hibernate.org/viewtopic.php?t=927033


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

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.