Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

is it good habit to create separate methods which differs 1 or 2 columns in fetching records ?

Ranch Hand
Posts: 529
Eclipse IDE MySQL Database Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should I create two separate methods for fetching records from MySQL database in which one method returns same columns with same conditions but has only one or two columns more than the another one?

For example. Just to view the account information of an employee I write a method getActiveEmpInfo(String MembId) to fetch employee name, account status, balance. For updating the employee information I have to fetch its all information so I write another method getActiveEmpAllInfo(String empId) which fetches few more columns like mobile number and address than getActiveEmpInfo(String MembId) method. so for the difference of two and sometime one column I created another separate method with meaningful name which suits its functionality.

I may have to fetch the record from 4000- 5000 employee rows. Actually it's not just about fetching employee information but also what about queries where I have to fetch sales records of 5 years from 60,00,000 rows( Maximum) from different tables. so is It good practice to create such separate methods for one or two column differences ?

The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
Garden Master Course kickstarter
    Bookmark Topic Watch Topic
  • New Topic