public boolean store() throws SQLException  {      
        //check if the class was created or pulled from db
        if(this.id !=-1)
            return false;
        
        SQLiteJDBC db = new SQLiteJDBC();
        ResultSet resultSet = null;
        
        String sql = String.format(
            "INSERT INTO users (email,password,fname,lname,user_type)" +
            "VALUES ('%s','%s','%s','%s','%s');",
            this.email,this.password,this.fname, this.lname,this.type);
        
        if(db.updateQuery(sql)> 0)  {
             sql = String.format("SELECT * FROM users WHERE email='%s'",this.email);
            resultSet = db.query(sql);
        }
        if(resultSet.next()) {
            this.id = resultSet.getInt("user_id");
            db.close();
            return true;
        }
        
        db.close();
        return false;
    }