This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
 
Don't get me started about those stupid light bulbs.
 
subject: Insert statement for a 70 columns database table
 
It's not a secret anymore!