JTable is java swing component.
JTable loads data throw model class that implements TableModel
interface.
public int getRowCount();
public int getColumnCount();
public Object getValueAt(int rowIndex, int columnIndex);
I have implemented such model class like that. (It loads data from DB
to ArrayList<Record> list)
public int getRowCount() { return list.size(); }
public Object getValueAt(int rowIndex, int columnIndex) { return
list.get(rowIndex).get(columnIndex); }
I have not found "good" implementation to load data from DB in GUI
elements.
Other languages (e.g. Delphi) has GUI components that is possible to
link with database.
I do not like my current ArrayList implementation.
Thank You
On Oct 31, 6:31 pm, "Thomas Mueller" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> > What is the best way to show H2 content in jTable?
>
> I don't know JTable. I suggest to use Google and search for "jtable
> jdbc" or (if you use Hibernate) "jtable hibernate".
>
> > getValueAt - "SELECT * FROM table1 WHERE id = ?"
> > My idea is to cache ResultSet in case next getValueAt would point to
> > same row.
>
> Hm, that would work, but probably it's not very efficient. I wouldn't
> do that unless the table is very big.
>
> > e.g. I saw JaQu on your site and it return List object. Will it work
> > faster/smoother?
>
> JaQu is still quite new. Lots of functionality is missing. Unless you
> are OK with a very limited feature set, I would rather use some other
> technology, for example JDBC, iBatis, or Hibenate.
>
> Regards,
> Thomas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---