Question: So I'm working on a project right now, and it should be a simple one, but I'm having difficulties.

I'm trying to read in data from a bluetooth dongle that is gathering info from a bluetooth weight scale. It measures data then fires the data to the PC.

Any suggestions on how to do this? I've tried searching for reference assemplbies, etc.

Thanks.

Answer: 
> 
> Is it guaranteed that cancel() will always work?
> 
> 
> 

No. At least not in my experience. I think I even had to deal with drivers that simply threw an UnsupportedOperationException

> 
> Is it guaranteed that cancel() will not block and (more or less) return immediately
> 
> 
> 

No. Depending on the statement being executed, sometimes the cancel() might wait until the first row of a query is returned. Again this is highly dependent on the driver.
From the same javadoc:

> 
> if both the DBMS and driver support aborting an SQL statement
> 
> 
> 

That limits the guarantee. The other limitation is that `Statement.cancel()` is implemented by the concrete driver, in other words, the implementation is not part of the Java RE.

So cancelling really *should* be thread safe, but you'll have to ask the vendor of your actual driver/DBMS.