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]

RE: InstantDB: insert detection


Arno,

It does say in the documentation that:

"...if you use a results set to update an underlying table, you will not see
that change refelected in the results set itself. However, as soon as you
query the table again, any updated values will become visible in the new
results set."  

http://instantdb.enhydra.org/software/documentation/jdbc.html 

David Good


-----Original Message-----
From: Arno Schatz [mailto:arno@lutris.com]
Sent: 10 May 2000 23:15
To: instantDB
Subject: 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.

-----------------------------------------------------------------------------
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.