Announcement Announcement Module
Collapse
No announcement yet.
jdbc + maprow+ mappingsqlquery Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • jdbc + maprow+ mappingsqlquery

    Hi

    I have one class and this class has MANY methods, each method has one inner class that extends mappingsqlquery and implements maprow.

    All maprow methods are equals (chunk of code at bottom). Is there any form to have only one maprow method for all my mappingsqlquery inner classes?

    Maybe create a public class than implement this maprow funcionality and call this class from mappingsqlquery inside all my classes or something similar?

    I don't know have to do it.

    protected Object mapRow(ResultSet rs, int rowNum) throws SQLException {
    int cuantos = rs.getInt("cuantos");
    return cuantos;
    }

    Because I don't want to have the same code againg and again.


    I have to use JDBC + mappingsqlquery because I have a lot of methods equals and I can't rewrite all my system, My system have many thousand of lines (this change is because of checkstyle,that show to me errors that say "duplicate code")


    Please Help me!!!

    Thanks!!


    P.S. I have many methods with this equal maprows inner classes becauses I use many select count(*) cuantos from X table, I need to know how many records has differents tables.
    Last edited by eliud; Nov 14th, 2010, 09:48 AM.
Working...
X