Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Problem with OJB

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a problem with an autoincrement field with SQL server database, table is the follow:
create table Person(
id int primary key IDENTITY (1, 1) NOT NULL ,
nombre varchar(30));
in this case OJB intents to insert the id, which generates an error :
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert explicit value for identity column in table 'test' when IDENTITY_INSERT is set to OFF

the same problem occurs with autoincrement fields of Mysql
is there away to tell OJB, not to insert id in the test table, because it's an autoincrement??
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Old thread but... has anyone come across an answer to this? I am about to come up to a similar problem where it is easier to use mysql autoincrement for key generation.
 
Andrew Edwards
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To answer my own question, just in case anyone searching finds this post,

http://db.apache.org/ojb/docu/guides/sequencemanager.html#native
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
andrew you helped me out, thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic