InstantDB Project
About InstantDB
Project Mail Lists
Short History
Reporting Bugs
Screen Shots
3rd Party Examples
FAQs

Software
Downloads
Documentation
CVS Repositories
Roadmap
License

About Enhydra.org
Who We Are
News, Articles & Events
Getting Involved
Contact Us

Community
Demos
Contributions
Resources
Case Studies
On The Edge! -NEW-
Commercial Vendors


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

InstantDB: insert detection


Hi,

I was trying to insert a row into a resultset and read this row immediatly,
without querying the DB again. Is this supposed to work in instantDB? See
the code below.

As you might see in the code example below, I am trying to get the id-value
of a table where the id-column is marked as AUTO INCREMENT. Is there a smart
way to do this?


Connection con = Transact.getConnection ();
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
    ResultSet.CONCUR_UPDATABLE);

ResultSet uprs = stmt.executeQuery("SELECT * FROM usr");
uprs.moveToInsertRow();
uprs.updateString(2,"number 2");
uprs.updateString(3,"jhjh");
uprs.updateByte(4, (byte) 0);

uprs.insertRow();
uprs.moveToCurrentRow();
System.out.println("iserted"+uprs.rowInserted());

int id = uprs.getInt(1);
System.out.println("id="+id);

======
id is always returned as null

-Arno

-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.