DERBY-6169: Reduce visibility of classes and methods under impl/sql

Changes to prevent exposing package-private classes outside the
package via public or protected fields or methods:

- Reduce visibility to package or private if possible

- Remove the code if it's not actually used

- Use public interfaces rather than implementation classes in the
  method signatures if the methods have to be public

git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1481816 13f79535-47bb-0310-9956-ffa450edef68