try { JSONObject json = jParser.makeHttpRequest(url_list_rs, "GET", params); catch(ConnectionException ex) { ex.printStackTrace(); }
try { BluetoothDiscoverer.findPrinters(this, new DiscoveryHandler() { public void foundPrinter(DiscoveredPrinter printer) { String macAddress = printer.address; //I found a printer! I can use the properties of a Discovered printer (address) to make a Bluetooth Connection } public void discoveryFinished() { //Discovery is done } public void discoveryError(String message) { //Error during discovery } }); } catch (ConnectionException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); }
MutationBatch m = CassandraAstyanaxConnection.getInstance().getKeyspace().prepareMutationBatch(); ColumnListMutation<String> clm = m.withRow(CassandraAstyanaxConnection.getInstance().getEmp_cf(), userId); for(String key: attributeMap.keySet()){ clm.putColumn(key, attributeMap.get(key), null); } try { m.execute(); } catch (ConnectionException e) { e.printStackTrace(); }
@Override protected void internalRun() { try { OperationResult<Rows<K, C>> result = ks.prepareQuery(cfData).withRetryPolicy(retry) .setConsistencyLevel(consistencyLevel).getKeySlice(keys) .withColumnSlice(new ColumnSlice<C>(columnSlice)).execute(); for (Row<K, C> row : result.getResult()) { callback.apply(row); } } catch (ConnectionException e) { e.printStackTrace(); } } };
@Override protected void internalRun() { try { OperationResult<Rows<K, C>> result = ks.prepareQuery(cfData).withRetryPolicy(retry) .setConsistencyLevel(consistencyLevel).getKeySlice(keys) .withColumnSlice(new ColumnSlice<C>(columnSlice)).execute(); for (Row<K, C> row : result.getResult()) { callback.apply(row); } } catch (ConnectionException e) { e.printStackTrace(); } } };
Assert.fail(); LOG.info(e.getMessage()); e.printStackTrace();
} catch (NotFoundException e) { } catch (ConnectionException e) { e.printStackTrace(); Assert.fail();