André Rothe | 4 Jan 2008 16:37
Picon
Picon

General access problem

Hi,

I think in the mailing list could be a lot of JDBC experienced users, so 
  it could be, that I get an answer for a general problem:

I select some data from a table ADDRESS. The selection is sorted by 
different columns. The table has a primary key column id.

------------------------------------------
id  name    street      city      postcode
------------------------------------------
1   bob     mainstreet  leipzig   04107
2   alice   2nd street  berlin    01200
3   nate                munich
------------------------------------------

The application displays the records in a JTable and the user can change 
the order of the records, like name, street and so on. The order is 
processed by McKoi, I create a dynamic SQL statement and exchange the 
ORDER BY part.

If the user selects a row, the JTable returns an index, which I can use 
to get data from the Resultset by absolute(index).

Now I try to insert a new record. The id is taken from a sequence.

---------------------------------------
4   dave    jump st.   hamburg    30567
---------------------------------------

(Continue reading)


Gmane