Creating objects dynamically from database
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Daelin_Lunaeri
Posted On:   Wednesday, September 28, 2005 03:59 AM

I've been combing through a multitude of books and websites trying to find something that addresses this, and so far have been unlucky. I have objects, where the fields of the objects are stored individually in fields in the table of the database. I can get the data into the program just fine, but I am having trouble instantiating objects for them. So, normally one would do: Object someName = new Object(); However, I won't know how many will be loaded, and I can't just name a bunch of empty objects to be used later. I need to create objects without . I've tried this: Object Object = new Object(); However, I just get null pointer exceptions or it will overwrite the same object   More>>


I've been combing through a multitude of books and websites trying to find something that addresses this, and so far have been unlucky. I have objects, where the fields of the objects are stored individually in fields in the table of the database. I can get the data into the program just fine, but I am having trouble instantiating objects for them.



So, normally one would do:


Object someName = new Object();

However, I won't know how many will be loaded, and I can't just name a bunch of empty objects to be used later. I need to create objects without .


I've tried this:


Object Object = new Object();

However, I just get null pointer exceptions or it will overwrite the same object over and over again. Any ideas?

   <<Less

Re: Creating objects dynamically from database

Posted By:   Almagest_FUTT  
Posted On:   Wednesday, September 28, 2005 12:25 PM

Could you please try to reformulate your question starting from another angle ?
About | Sitemap | Contact