This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
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
 
wood burning stoves
 
subject: Insert statement for a 70 columns database table