can JavaBean read the table fields at the run time?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sarah_chi
Posted On:   Thursday, August 8, 2002 06:34 PM


I am not sure if this is a good design, but I am thinking of writing some generic javabean which will communicate with database and read in all the fields from some specific table. This bean should be reusable for every table in the database, is there a way to read the database fields at run time?


Thanks.

Re: can JavaBean read the table fields at the run time?

Posted By:   Claudia_Silva  
Posted On:   Tuesday, September 3, 2002 07:04 AM

I try to develop a bean that can read more than one DB, but it would be useful (in the earlier time) if read from one DB. And then read all tables (depend of the login and password of the user, maybe the admin). But I don't sure if it can be a good bean. First it would responds to requests of other beans that needs something data from tables belongs a specific DB. For do this, the bean should connect to the DB, then responds, and later terminate the connection. The request bean should, in run time, knows the structure of the tables and then makes something with this data, later this bean should be "clean".
What do you think about it?
Thanks.

Re: can JavaBean read the table fields at the run time?

Posted By:   Horatiu_Ripa  
Posted On:   Friday, August 30, 2002 04:28 AM

getMetadata() method of ResultSet retrieves the number, types and properties of this ResultSet object's columns.
About | Sitemap | Contact