select * TABLEA where uid in (101,102,103) order by creation_time limit 5"The problem here is with the 'limit 5' part of the query
Unfortunately, Derby does not currently support a way to limit the results directly in the SQL. See https://issues.apache.org/jira/browse/DERBY-581 for information about the current status of this request. We'd love to have help implementing this, if you are interested! You can use the JDBC Statement.setMaxRows() as somewhat of a workaround. thanks, bryan
