Package org.ytreza.app.noterex.database.exception

Examples of org.ytreza.app.noterex.database.exception.ItemException


        note.setId(keys.getInt(1));
      }
      keys.close();
    } catch (SQLException e) {
      e.printStackTrace();
      throw new ItemException(Type.INSERT_ERROR,e);
    }
  }
View Full Code Here


      updateStatement.setString(3, note.getKeywords());
      updateStatement.setInt(4, note.getId());
      updateStatement.executeUpdate();
    } catch (SQLException e) {
      e.printStackTrace();
      throw new ItemException(Type.UPDATE_ERROR,e);

    }
  }
View Full Code Here

     
      if (note != null) {
        return note; 
      }
    } catch (SQLException e) {
      throw new ItemException(Type.SELECT_ERROR, e);
    }

    throw new ItemException(Type.ITEM_MISSING);
  }
View Full Code Here

      while (result.next()) {
        list.add(new Note(result.getInt("id"), this));
      }
      result.close();
    } catch (SQLException e) {
      throw new ItemException(Type.SELECT_ERROR, e);
    }
    return list;
  }
View Full Code Here

     
      if (note != null) {
        return note; 
      }
    } catch (SQLException e) {
      throw new ItemException(Type.SELECT_ERROR, e);
    }

    throw new ItemException(Type.ITEM_MISSING);
  }
View Full Code Here

  public void delete(Note note) throws ItemException {
    try {
      deleteNoteStatement.setInt(1, note.getId());
      deleteNoteStatement.executeUpdate();
    } catch (SQLException e) {
      throw new ItemException(Type.DELETE_ERROR,e);
    }
  }
View Full Code Here

  public Iterator<Note> Iterator() throws ItemException {
    try {
      ResultSet result = selectAllStatement.executeQuery();
      return new NoteIterator(result,this);
    } catch (SQLException e) {
      throw new ItemException(Type.SELECT_ERROR, e);
    }
  }
View Full Code Here

        tag.setId(keys.getInt(1));
      }
      keys.close();
    } catch (SQLException e) {
      e.printStackTrace();
      throw new ItemException(Type.INSERT_ERROR,e);

    }
  }
View Full Code Here

      updateStatement.setString(1, tag.getLabel());
      updateStatement.setInt(2, tag.getId());
      updateStatement.executeUpdate();
    } catch (SQLException e) {
      e.printStackTrace();
      throw new ItemException(Type.UPDATE_ERROR,e);

    }
  }
View Full Code Here

     
      if (tag != null) {
        return tag; 
      }
    } catch (SQLException e) {
      throw new ItemException(Type.SELECT_ERROR, e);
    }

    throw new ItemException(Type.ITEM_MISSING);
  }
View Full Code Here

TOP

Related Classes of org.ytreza.app.noterex.database.exception.ItemException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.