• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about DB file

 
AutinHorse
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I begin the work for assignment. But I am little afraid about the DB file.
In the assignment, the columns are as "No", "Ori", "Des", "Car" and so on, need I take care the sequence of them? I mean, when the sun do test, they will use the same structure DB file or maybe change sequence of columns?
I think I need not treat it, and my program can treat only this DB file is OK, but I am little afraid of it.
Could some friends give me suggestion of it?
 
Steve Granton
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
As far as I'm aware the order of the fields shouldn't matter as they provide a getFieldInfo() method in the Data class. From there you can dynamically assign the correct fields and assuming you are using the MVC pattern then it shouldn't have any bearing on the order they are displayed in your GUI. Indeed, my understanding of the JTable is that the columns can be re-ordered by the user, by drag and drop, in the view without affecting the order in the underlying model.
I would argue that you should make it robust enough to cope even if they add extra columns and, theorectically, if they remove columns - though I don't think its a requirement of the SCJD certification.
I hope this helps. I would welcome comments on my thoughts in case I'm barking up the wrong tree!
Cheers,
Steve
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic