File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Insert statement for a 70 columns database table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Insert statement for a 70 columns database table" Watch "Insert statement for a 70 columns database table" New topic
Author

Insert statement for a 70 columns database table

Srikanth Raghavan
Ranch Hand

Joined: Oct 31, 2005
Posts: 389
Hi,

Do we have to hard-code the column names and indexes in our program?

I have a database table which contains 70 columns. And my insert statement is looking like a beast. I am hard-coding the column indexes and column names in my program, although I have it in one place in the form of an enum. Is this how all the JDBC programs work? I am smelling something wrong with this approach.

I don't know anything about Hibernate, but is it the solution for this problem?

-- Srikanth
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Hibernate (or any ORM) would remove the boiler plate code you have to write.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Insert statement for a 70 columns database table