Subject Re: Cursors
Author Roman Rokytskyy
> The Application schould manage a running competition
> ( and there ate some Tables for the
> appointments, the results, etc. (Its my first bigger Project and my
> first Java Project with a Database)

Should this be a Web application or Swing application (I assume Swing)?

> My mayor Problem is to build a living table-model.
> It should contain the formated Data of a Database and the Data
> should be updateable through the Table.

Here's the sketch of the solution without scrollable/updatable cursors.

Usually your table contains a primary key (something like record ID).
If you don't have such key (which is most likely a database design
error), you can use RDB$DB_KEY field (it exists in each table, it is a
unique row identifier).

So, each your SELECT statement should contain reference to this
primary key, something like

SELECT user_id, first_name, last_name, age from users_table

Your table model does not show the first column to the user (or you
can show it, however you should disable editing for this column).

Then you read your table data into memory and allow scrolling there.
If size of result set is very big, you can read only its part using

When somebody updates or deletes record, you execute corresponding
UPDATE or DELETE statement with the ID of the user to update:

UPDATE users_table
first_name = ?,
last_name = ?
user_id = ?


DELETE FROM users_table WHERE user_id = ?

After updating or deleting the record you should re-read your visible
part of the result set.

> Also you should can insert new Data.

This task is performed by simple INSERT command. Only be sure that you
re-read the visibl part of the result set.

Hope this helps.

BTW, did you consider using Borland Delphi or C++ Builder for it?
There are components that emulate cursor scrolling on the client side.

Best regards,
Roman Rokytskyy