SQLite Forum

How to remove a column and guide from the docs
Login
> I made a script that works when I execute it from CLI, but when I try to work with sqlite jdbc it fails with

 > `A table in the database is locked (database table is locked)`

 > on the "drop old table" line. 

Indicates that there is an statement outstanding (executing as in not reset/finalized) against the table you are trying to drop.  You cannot drop a table while it is in use by an executing statement.

That is, if you do a:

`select * from x`

and have commenced executing that statement, then you must reset it before the statement

`drop table x`

can proceed.  You are being prevented from dropping the floor out from underneath your own feet.