public boolean addChat(@NotNull ChatImpl chat){
  int updatedRows=0;
  try {
    final PreparedStatement preparedStatement=connetion.getPreparedStatement("INSERT INTO Chat (id, accessHash, isChannel) " + "VALUES (?,?,?)");
    preparedStatement.setInt(1,chat.getId());
    if (chat.getAccessHash() == null) {
      preparedStatement.setNull(2,Types.BIGINT);
    }
 else {
      preparedStatement.setLong(2,chat.getAccessHash());
    }
    preparedStatement.setBoolean(3,chat.isChannel());
    updatedRows=preparedStatement.executeUpdate();
  }
 catch (  SQLException e) {
    BotLogger.error(LOGTAG,e);
  }
  return updatedRows > 0;
}

public boolean addChat ( @ NotNull ChatImpl chat ) { int updatedRows = 0 ; try { final PreparedStatement preparedStatement = connetion . getPreparedStatement ( "INSERT INTO Chat (id, accessHash, isChannel) " + "VALUES (?,?,?)" ) ; preparedStatement . setInt ( 1 , chat . getId ( ) ) ; if ( chat . getAccessHash ( ) == null ) { preparedStatement . setNull ( 2 , Types . BIGINT ) ; } else { preparedStatement . setLong ( 2 , chat . getAccessHash ( ) ) ; } preparedStatement . setBoolean ( 3 , chat . isChannel ( ) ) ; updatedRows = preparedStatement . executeUpdate ( ) ; } catch ( SQLException e ) { BotLogger . error ( LOGTAG , e ) ; } return updatedRows > 0 ; }
adds a chat to the database
