simple jdbc wrapper

前端 未结 8 1002
青春惊慌失措
青春惊慌失措 2021-01-01 21:35

To implement data access code in our application we need some framework to wrap around jdbc (ORM is not our choice, because of scalability).

The coolest framework I

8条回答
  •  感动是毒
    2021-01-01 22:11

    The one I prefer: Dalesbred. It's MIT licensed.

    A simple example of getting all rows for a custom class (Department).

    List departments = db.findAll(Department.class,
        "select id, name from department");
    

    when the custom class is defined as:

    public final class Department {
        private final int id;
        private final String name;
    
        public Department(int id, String name) {
            this.id = id;
            this.name = name;
        }
    }
    

    Disclaimer: it's by a company I work for.

提交回复
热议问题