public UserDTO setUser( UserDTO user ) throws DAOException{
		
		query =  "";
		query += "INSERT INTO chat_user \n";
		query += "( nickname, passwd, register_date, status, email ) \n";
		query += "VALUES \n";
		query += "( ?, ?, now( ), ?, ? ) \n";
		
		try{
			connection = DBManager.getConnection( );
			statement =  connection.prepareStatement( query, Statement.RETURN_GENERATED_KEYS );
			statement.clearParameters( );
			
			statement.setString( 1 , user.getNickname( ) );
			statement.setString( 2 ,  user.getPasswd( ) );
			statement.setInt( 3 ,  Definitions.USER_STATUS_ACTIVE );
			statement.setString( 4, user.getEmail( ) );
			
			if( statement.executeUpdate( ) == -1 ){
				logger.error( "Can't insert user into database:DBERROR" );
				throw new DataBaseException( );
			} else{
				resultSet = statement.getGeneratedKeys( );
				if( resultSet != null && resultSet.next( ) ){
					user.setId( resultSet.getInt( 1 ) );
				}
				else{
					logger.error( "Can't retrieve generated key:DBERROR" );
				}
			}
		} catch( SQLException e ) {
			logger.error( "Can't get prepared statement from connection:DBERROR" );
			throw new DAOException( );
		} catch ( DataBaseException e ) {
			logger.error( "Unable to insert user register:DBERROR" );
			throw new DAOException( );
		} finally{
			try {
				statement.close( );
			} catch ( SQLException e ) {
				logger.error( "Can't close statement:DBERROR" );
			}
			try {
				resultSet.close( );
			} catch ( SQLException e ) {
				logger.error( "Can't close result set:DBERROR" );
			}
			try {
				connection.close( );
			} catch ( SQLException e ) {
				logger.error( "Can't close connection:DBERROR" );
			}
		}
		return user;
	}