Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

iBatis, AS400: generated primary key value in code  RSS feed

Imre Tokai
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i'm using DB2, AS400 database.

in User.xml i have:
<insert id="addUser" parameterClass="UserForm">
username, passwordfirstname, lastname, role

in i have
sqlMapper.insert("addUser", user);

Primary key is generated by iBatis (or database). How can i get this value?
For now, i'm using SELECT MAX(pKey) but it's not the happiest way for solving this problem.

I found this example.
How should i write the <insert> for making this work?

I checked
but still no luck

Hope to get answer soon!

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!