Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-07-2007, 03:17 PM
Member
 
Join Date: Jun 2007
Posts: 17
javadev is on a distinguished road
problem with hibernate and oracle 8i
hello everyone,

i am using hibernate with oracle 8i and sql-server2000

i am trying to insert value which have sequence field(identity in sql-server).

when i tries it ,it throws following an exception

org.hibernate.exception.GenericsJDBCException: could not get next sequence value

i am using <generator class="native"/>.

it works well with sql-server2000.

if any one has a idea please help me.

thanks in advance,
Javadev
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-08-2007, 02:11 AM
Senior Member
 
Join Date: Mar 2007
Posts: 136
goldhouse is on a distinguished road
you need to have sequence for it , just execute "create sequence hibernate_sequence " in the oracle prompt then it will work
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-08-2007, 01:42 PM
Member
 
Join Date: Jun 2007
Posts: 17
javadev is on a distinguished road
hi goldhouse,

thanks for u r help...

i have already created sequence...
but i can`t get it.
i use following for id.
<generator class="native">
<param name="sequence">sq_hibernate_sequence</param>
</generator>


but i am confused that how i get next sequence value and how i can set it and insert into table?????

if u have an idea please help me.

thanks in advance.
javadev
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 08-09-2007, 12:43 AM
Senior Member
 
Join Date: Mar 2007
Posts: 136
goldhouse is on a distinguished road
You are mixing up

either

<generator class="sequence">
<param name="sequence">sq_hibernate_sequence</param>
</generator>

or
<generator class="native">
</generator>
In the second case , you need to have a sequence named 'hibernate_sequence'
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 08-09-2007, 03:21 PM
Member
 
Join Date: Jun 2007
Posts: 17
javadev is on a distinguished road
hello goldhouse,

when i am creating hibernate_sequence it works fine.

but i have two tables with two different sequences.how i can use existing sequences for particular table.

thanks in advance.
javadev
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
composite-id problem hibernate javadev Database 13 01-28-2008 09:12 AM
Hibernate 2.1.8 / Oracle 10 / Tomcat 5.0.28 : Data not retrieved from the database scastro Database 4 08-09-2007 11:41 PM
oracle problem Peter Database 1 07-09-2007 05:19 AM
can hibernate work with Oracle 10g javadev Database 4 07-08-2007 09:47 PM
Log4J, problem with Hibernate and Spring Marcus Advanced Java 1 06-06-2007 04:22 AM


All times are GMT +3. The time now is 04:55 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org