On Wed, Jul 23, 2008 at 5:37 AM, Gerd Wagner <ger...@t-...>
wrote:
> Here is a different approach that we use not for security reasons but
> merely for logging:
>
> Create a wrapper JDBC driver that wraps your original driver. Then register
> this driver instead of the original driver within SQuirreL. Any call that
> SQuirreL sends to the database will then pass through the wrapper. Here
> you'd be in control of everything. If you don't want a call to execute
> simply make the wrapper throw an SQLException. SQuirreL should handle such
> exceptions the way it does any other database exceptions.
>
> To create such a driver wrapper can be simplified a lot using JDKs Proxy
> API. See
> http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Proxy.html
>
This has the benefit that it is portable to other JDBC front-ends and you
can use the current version of SQuirreL unmodified. Nice!
Rob
|