File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Insert statement for a 70 columns database table

 
Srikanth Raghavan
Ranch Hand
Posts: 389
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate (or any ORM) would remove the boiler plate code you have to write.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic