@Override
	public void insert(MyUser user) {
		String name = user.getUserName();
		String pass = passwordEncoder.encode(user.getPassWord());
		
		long votes = user.getTotalVotes();
		String role = "ROLE_USER";
		if (findByName(name) != null) {
			return;
		}
		
		String sql = "INSERT INTO users(username, password, votes, enabled) VALUES (?,?,?,TRUE)";
		String sql2 = "INSERT INTO user_roles(username, role) VALUES(?, ?)";
		Connection conn = null;
		try {
			conn = dataSource.getConnection();
			PreparedStatement ps = conn.prepareStatement(sql);
			ps.setString(1, name);
			ps.setString(2, pass);
			ps.setLong(3,votes);
			ps.executeUpdate();
			ps.close();
			
			ps = conn.prepareStatement(sql2);
			ps.setString(1, name);
			ps.setString(2, role);
			ps.executeUpdate();
			ps.close();
			
		} catch (SQLException e) {
			throw new RuntimeException(e);
 
		} finally {
			if (conn != null) {
				try {
					conn.close();
				} catch (SQLException e) {}
			}
		}
	}