Hello! The exception will not appear if you replace your code with the following one:
try{
Statement st = database.getStatement(); // Create the statement which partially locks some database objects
st.execute( "DELETE * FROM table1" ); // Perform required operations
database.releaseStatement( st ); // Release the statement - it unlocks all locked objects
}catch(SQLException ex){
System.out.println( "Error de SQLException (2):"+ ex );
}
The resaon for your problem was that you did not release the statement, so your table was locked, and you could not
execute your query more than once.
AnyLogic API Reference guide says:
public java.sql.Statement getStatement() - The method returns statement (creates if necessary).
Caller is responsible to invoke releaseStatement(Statement) after all needed operations with given statement are
complete (i.e. this method locks current Database object until releaseStatement(Statement) call)

