• Post Reply Bookmark Topic Watch Topic
  • New Topic

Storing multiple rows of a table in a java variable  RSS feed

 
Kerin Kapoor
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can i store multiple rows of a table in a two dimensional string array in java.. The table has 3 columns and approximately 10,000 rows..

Could any one provide some pointers for coding to achieve this...

Thanks in advance!..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about a List of beans?
 
Kerin Kapoor
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply..

I'm new to java, so can you be bit more specific??
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A bean is a class that possesses data properties -- ideal for representing a single row of a table and its columns. Lists are part of the Java collection classes. Click on: java.util.List

A List has the advantage that you don't need to know how big to make it in advance like you do with an array.

If you are just starting out, you might want to become familiar with these concepts.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But, if your aim is to learn more about arrays, then an array of arrays (there's not really any such thing as a 2-d array in Java) could do if you know how big to make it in advance.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!