User loginUser(String login, String password, boolean rememberUser) {
Dao<User, Integer> usersDao;
ConnectionSource connectionSource;
User user = null;
try {
connectionSource = new JdbcConnectionSource(connectionString, userName, userPass);
usersDao = DaoManager.createDao(connectionSource, User.class);
QueryBuilder<User, Integer> queryBuilder = usersDao.queryBuilder();
queryBuilder.where().like(User.LOGIN_FIELD_NAME, login).and().like(User.PASSWORD_FIELD_NAME, password);
user = usersDao.queryForFirst(queryBuilder.prepare());
connectionSource.close();