Escaping the schema name sounds like a good idea, since we may make the syntax more liberal later. There's a method called IdUtil.normalToDelimited() that does this in the embedded driver. Unfortunately, this code cannot be called from ij, since derby.jar is not guaranteed to be on the classpath, but you can look at the method to see how to escape the identifier. Using a prepared statement sounds simpler and cleaner, though, so I think I would have preferred that.
One minor issue with the patch: Derby's code uses tab size 4. The patch uses spaces for indentation, which is fine, but to match the surrounding code, it should use four spaces for each indentation level, not eight.
By the way, JDBC 4.0 has a method in DatabaseMetaData called getFunctions() which is similar to the getProcedures() method used by SHOW PROCEDURES. This method is implemented in Derby's JDBC 3.0 drivers too, so we may consider using that method instead of querying the system tables directly. The benefit of using getFunctions() is that it will be more portable and work against other databases that have implemented that meta-data call. Since ij is compiled against the JDBC 3.0 libraries, we will need to use reflection to call it. I think it would be something along these lines:
DatabaseMetaData dbmd = theConnection.getMetaData();
getFuncs = dbmd.getClass().getMethod("getFunctions", ...);
catch (NoSuchMethodException nsme)
throw new ijException.notAvailableForDriver(...);
ResultSet rs = (ResultSet) getFuncs.invoke(dbmd, ...);