This week's book giveaway is in the Reactive Progamming forum. We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line! See this thread for details.
You really shouldn't assume people will be able to infer things from code like that. They might be able to guess but the more details you give, the easier it is to give helpful advice.
It seems to me that you're trying to use a String, which is what I'm guessing preferenceFieldName is, to figure out which getter method to invoke inside your loop. Using the Reflection API is one choice but it's not ideal. It's hard to justify using the Reflection API in business logic like this.
The obvious brute force way would be to have a series of if-else statements like so:
Since you'd only have a limited number of these getUserpXX() methods in EmployeeMaster, it's still manageable albeit a bit tedious when you have more than a few properties.
You might be able to use a Map<String, IntSupplier> and lambdas or method references to whittle a long if-else-if-else series of statements down to a few lines of code.
The declaration has nothing to do with the leading comment. In other words, userp12 isn't an object, it is a variable of primitive type int.
Also that line isn't the loop. Loop is somewhere down below. So I'd suggest remove those comments completely in order not to clutter code even more.
Class EmployeeMaster to me somehow doesn't read fluently. EmployeeMaster constructor accepting database Connection and ResultSet also isn't intuitive. Seems like this EmployeeMaster just facilitates some work space for the need of some dirty work to do.
You may want to explain in a bit more abstract words what are you trying to achieve?