Your questions are somewhat ambiguous. You need to be more specific on your question.
What are you trying to load ? How is your database table like ? Using the "select * from xxxtable" SQL statement is indeed very very memory intensive. It would be better if you can use conditions in the SQL statement to specify exactly what you want and simply take the results returned for your own use. You can lookup H2 database website for more in-depth ways to manipulate SQL statements to fit into your situation. Also, you may want to read up on the W3 Schools SQL tutorials on the basic SQL manipulations ( http://www.w3schools.com/sql/default.asp). On Monday, June 18, 2012 1:04:38 AM UTC+8, vicenrico wrote: > > Hello. As I'm a newbie, I would like to better learn use of databases. > Which is the best method to load a database, supposing I have about > 4000-5000 rows that consist of 30 columns. > > I don't know if it's better to load "Select * from table" and load all the > objects into an array or it's better take row by row when constructing > table (jface tableviewer in my case) . > I mean: > > Form1: > > select * from table > arraylist<movie> moviesList=new arraylist<movie> > iterate trough resultset filling movieslist > > > OR > > > Form2: > > With tableviewer whenever it needs to be redraw: > > tableviewer.setdata(xxx) > load a movieobject from the table > fill the item of the tableviewer. > > > The problem with form1 is memory comsumption, and the problem with form2 > is when the list must be redraw can call this method a lot of times. > > Do you know alternative ways of database loading. I know about chunks > loading but I don't like because I don't know methods to do the > replacement: less recent used, and so on... > > Sorry for the question, I know it's a very newbie question, but I'm > beginning and I don't know how real people load databases: all objects in a > list, or when needed by the table. > > Thanks!!! > > > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/DCrkePtuEZAJ. 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.
