 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
FGB Guest
|
Posted: Thu Jul 24, 2003 3:47 am Post subject: Autogenerating Prepared Statements |
|
|
I have a database with about 200 tables. Most of my inserts are quite
simple: INSERT INTO TABLE_NAME ( ... ) VALUES ( ...)
I'm thinking about writing a program to auto-generate Prepared
Statements, 1 for each table in the database.
It should be possible to do this by querying the database for meta data
about it's tablespace.
Has anyone ever done this or know of some code/tool that does?
Thanks,
Fred Burkley
|
|
| Back to top |
|
 |
Chris Smith Guest
|
Posted: Thu Jul 24, 2003 12:09 pm Post subject: Re: Autogenerating Prepared Statements |
|
|
FGB wrote:
| Quote: | I have a database with about 200 tables. Most of my inserts are quite
simple: INSERT INTO TABLE_NAME ( ... ) VALUES ( ...)
I'm thinking about writing a program to auto-generate Prepared
Statements, 1 for each table in the database.
It should be possible to do this by querying the database for meta data
about it's tablespace.
Has anyone ever done this or know of some code/tool that does?
|
I have done it, actually for insert, delete, select, and update
statements, matching them to JavaBeans property accessors and mutators
in a data access object. Actually, once you've done that, you've
essentially got the basis for a REALLY simple O/R mapper.
I can't give out my code, really, because it's proprietary. I will be
happy to answer questions about how to do it, though. Not really
difficult, if not trivial either; it took all of a three-day weekend to
put it together and have confidence that it works.
--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
|
|
| Back to top |
|
 |
Daniel Hagen Guest
|
Posted: Fri Jul 25, 2003 12:32 pm Post subject: Re: Autogenerating Prepared Statements |
|
|
You might want to take a look at JDO (www.jdocentral.com)
Regards
Daniel
FGB <au714 (AT) osfn (DOT) org> wrote
| Quote: | I have a database with about 200 tables. Most of my inserts are quite
simple: INSERT INTO TABLE_NAME ( ... ) VALUES ( ...)
I'm thinking about writing a program to auto-generate Prepared
Statements, 1 for each table in the database.
It should be possible to do this by querying the database for meta data
about it's tablespace.
Has anyone ever done this or know of some code/tool that does?
Thanks,
Fred Burkley
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|