0% found this document useful (0 votes)
15 views1 page

Understanding Interceptor Classes

An interceptor is a software pattern that allows extending or modifying aspects of a program without recompiling. With Connector/J, interceptors are enabled by specifying classes that implement interceptor interfaces in the connection string. The connection properties control three types of interceptors: connection lifecycle interceptors, exception interceptors, and query interceptors.

Uploaded by

sandeep
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views1 page

Understanding Interceptor Classes

An interceptor is a software pattern that allows extending or modifying aspects of a program without recompiling. With Connector/J, interceptors are enabled by specifying classes that implement interceptor interfaces in the connection string. The connection properties control three types of interceptors: connection lifecycle interceptors, exception interceptors, and query interceptors.

Uploaded by

sandeep
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

 Interceptor Classes

An interceptor is a software design pattern that provides a transparent way to extend or modify
some aspect of a program, similar to a user exit. No recompiling is required. With Connector/J,
the interceptors are enabled and disabled by updating the connection string to refer to different
sets of interceptor classes that you instantiate.

The connection properties that control the interceptors are explained in Section 6.3,
“Configuration Properties”:
 connectionLifecycleIntercep
tors, where you specify the fully
qualified names of classes that
implement
the [Link]
[Link]
nterceptor interface. In these
kinds of interceptor classes, you
might log events such as rollbacks,
measure the time between
transaction start and end, or count
events such as calls
to setAutoCommit().
 exceptionInterceptors, where
you specify the fully qualified
names of classes that implement
the [Link].
ExceptionInterceptor interface.
In these kinds of interceptor
classes, you might add extra
diagnostic information to
exceptions that can have multiple
causes or indicate a problem with
server
settings. exceptionInterceptor
s classes are called when handling
an Exception thrown from
Connector/J code.
 queryInterceptors, where you
specify the fully qualified names of
classes that implement
the [Link]
[Link] interface. In
these kinds of interceptor classes,
you might change or augment the
processing done by certain kinds of
statements, such as automatically
checking for queried data in
a memcached server, rewriting
slow queries, logging information
about statement execution, or route
requests to remote servers.

 PREV   HOME   UP   NEXT 

You might also like