registerDatabaseChangeNotification参数配置源码

registerDatabaseChangeNotification

DatabaseChangeRegistration registerDatabaseChangeNotification(Properties options)
                                                              throws SQLException
Creates a new database change registration.

This method creates a new database change registration in the database server with the given options. It also opens a listening socket which will be used by the database to send notifications. Note that if there already is a listening socket (created by a different registration), then it will be used by this registration as well.

This method returns a DatabaseChangeRegistration object that can then be used to associate a statement with this registration.

The registration will continue to live after this connection is closed. You need to explicitly unregister it to destroy it in the server and release the resources in the driver.

This method uses one roundtrip.

Parameters:
options - Possible options are ([] means default):
  • OracleConnection.NTF_QOS_RELIABLE:
  •         "true"/["false"]. Set this option to "true" to make the notifications persistent which comes at a performance cost.
  •          将此选项设置为“true”,使通知持久化,以性能为代价。
  • OracleConnection.NTF_QOS_PURGE_ON_NTFN:
  •         "true"/["false"]. Set this option to "true" and the registration will be expunged on the first notification event.
  •          将此选项设置为“true”,注册会在第一次通知事件后撤销。
  • OracleConnection.NTF_TIMEOUT:
  •          value in seconds "60"/["0"]. Specifies the time in seconds after which the registration is automatically expunged by the database. The default is "0": the registration lives until explicitly deregistered.
  •        以秒为单位值“60”/[“0”]。指定其后的注册会自动通过数据库在指定的时间内撤销。默认值为“0”:注册会持续到明确注销。
  • OracleConnection.NTF_LOCAL_TCP_PORT:
  •          "1234"/[NTF_DEFAULT_TCP_PORT]. This option lets you specify what TCP port the driver should use for the listening socket. If you don't specify a port, the driver will use NTF_DEFAULT_TCP_PORT and if it's already used, it will increment it by one until it finds one that is available.
  •        此选项允许您指定驱动程序应该使用什么TCP端口监听套接字。如果不指定端口,驱动程序将使用NTF_DEFAULT_TCP_PORT,如果它已经使用,  它将+1直到找到一个可用的端口。
  • OracleConnection.NTF_LOCAL_HOST:
  •         example "212.121.134.12". Use this option to manually specify the IP address of the machine that will receive the notifications from the server. Use this option with caution: only specify the IP address of the local machine when the driver is unable to find it out on its own (it uses InetAddress.getLocalHost() ). For example if the machine on which runs the JDBC driver is a VPN client, you may have to specify the IP address of the VPN client which the driver cannot find out on its own. This option should not be used to attempt to have a different remote host receive the notifications from the server.
  •          使用此选项可以手动指定从服务器接收通知的机器的IP地址。请谨慎使用此选项:只有当驱动程序无法找到它自身指定的本地计算机的IP地址(它使用InetAddress.getLocalHost())。例如,如果在其上运行的JDBC驱动程序是一个VPN客户机,您可能需要指定VPN客户端的IP地址,因为驱动无法找到自身的ip地址。这个选项不应被用来试图找不同的远程主机来从服务器收到通知。
  • OracleConnection.DCN_NOTIFY_ROWIDS:
  •         "true"/["false"]. Use this option to have the server send the ROWIDs of the row that have changed within the notification event. By default this feature is turned off.
  •          要取得更改记录的rowid,默认情况下功能关闭
  • OracleConnection.DCN_IGNORE_INSERTOP:
  •         "true"/["false"]. Use this option to tell the server to ignore INSERT operations.
  •          使用此选项用来告诉服务器忽略insert操作。
  • OracleConnection.DCN_IGNORE_UPDATEOP:
  •           "true"/["false"]. Use this options to tell the server to ignore UPDATE operations.
  •            使用此选项用来告诉服务器忽略UPDATE操作。
  • OracleConnection.DCN_IGNORE_DELETEOP:
  •           "true"/["false"]. Use this options to tell the server to ignore DELETE operations.
  •           使用此选项用来告诉服务器忽略DELETE操作。
  • OracleConnection.DCN_NOTIFY_CHANGELAG:
  •           "30"/["0"]. This is an int value (specified as a String), that can be used to specify the number of transactions by which the client is willing to lag behind. This option can be used by the client as a throttling mechanism for database change events. When this option is chosen, ROWID level granularity of information will not be available in the events, even if the DCN_NOTIFY_ROWIDS option was set to "true".
  •           “30”/ [“0”]。这是一个int值(指定为字符串),可用于指定交易的次数,其中客户端主动延迟。这个选项可以被客户端用作节流机制,用于针对数据库的改变的事件。当选择此选项时,信息ROWID级别的信息粒度在事件中不可用,即使DCN_NOTIFY_ROWIDS选项设置为“true”。
  • OracleConnection.DCN_QUERY_CHANGE_NOTIFICATION:
  •     "true"/["false"]. Use this option to activate query change notification instead of object change notification. Note that this option is only available in the database server starting in 11.1.
  •     使用此选项可激活查询更改通知而非对象更改通知。请注意,此选项仅在数据库服务器11.1版本可用。
  • OracleConnection.DCN_BEST_EFFORT:
  •             "true"/["false"]. If a query has been successfully registered, by default there will be no FALSE positives. If this option is selected during registrations, then registrations on complex queries may still be allowed but notifications may have some FALSE positives, because full pruning may not be performed if determined to be too expensive. In the worst case notifications will be generated in response to any DML/DDL changes to underlying objects. Note that this option is ignored if the DCN_QUERY_CHANGE_NOTIFICATION isn't turned on. AsDCN_QUERY_CHANGE_NOTIFICATION, this option is only available in the database server starting in 11.1.
  •             如果查询已成功注册,默认情况下不会有FALSE 量。如果注册时选择此选项,然后在复杂的查询注册仍是允许的,但通知可能有一定FALSE量,因为如果确定是太耗内存就无法进行全面撤销。在最坏的情况下,响应于任何DML/ DDL更改到底层对象,通知将会生成。
  • 注意,如果DCN_QUERY_CHANGE_NOTIFICATION未接通则此选项被忽略。
  • OracleConnection.NTF_GROUPING_CLASS: OracleConnection.NTF_GROUPING_CLASS_TIME/[OracleConnection.NTF_GROUPING_CLASS_NONE].
  •        Notification Grouping Class, the criterion or dimension for grouping. The only supported class is OracleConnection.NTF_GROUPING_CLASS_TIME meaning grouping by time, that is, the user specifies a time value and a single notification gets published at the end of that time. To use grouping at least this option must be specified to a value other than the default OracleConnection.NTF_GROUPING_CLASS_NONE, which is no grouping.
  •         通知分组类别,标准或维度进行分组。唯一支持类是OracleConnection.NTF_GROUPING_CLASS_TIME意味着按时间分组,也就是说,用户指定一个时间值并且在时间结束时一个单独的通知会公布。要使用分组至少要给这个选项指定一个指,而不是默认OracleConnection.NTF_GROUPING_CLASS_NONE,因为它没有分组。
  • OracleConnection.NTF_GROUPING_VALUE:
  •         "1200/["600"]. Notification Grouping Value, the value of the grouping class. The value must be an integer number. For the TIME grouping class, this value represents a number of seconds, meaning the time after which grouped notifications are sent. If not specified, it defaults to 600 sec.
  •         “1200 /[”600“]。通知分组值,分组类的值。该值必须是一个整数,对于在TIME分组类中,此值表示的秒数,这意味着分组通知后的时间被发送了。如果没有指定,则默认为600秒。
  • OracleConnection.NTF_GROUPING_TYPE: OracleConnection.NTF_GROUPING_TYPE_LAST/[OracleConnection.NTF_GROUPING_TYPE_SUMMARY].
  •         Notification Grouping Type, the format of grouping notification. It can either contain the summary of all events (default) or the last event in the group.
  •         通知分组类型,分组通知的格式。它可以包含所有事件(默认)或该组中的最后一个事件的概述。
  • OracleConnection.NTF_GROUPING_START_TIME:
  •        When to start grouping? Notification grouping can start from a user-specified time that should a valid timestamp with time zone, that is an instance oforacle.sql.TIMESTAMPTZ. If this option is not specified when using grouping, it defaults to current system time. For example if prop was the option properties, and conn the connection object, you would call:prop.put(OracleConnection.NTF_GROUPING_START_TIME,new TIMESTAMPTZ(conn,"2007-06-21 10:10:00.0"));.
  •         何时开始分组?通知分组可以从应与时区的有效时间戳,即oracle.sql.TIMESTAMPTZ的实例的用户指定的时间开始。如果使用分组时没有指定这个选项,则默认为当前系统时间。例如,如果prop 是此选项的properties,conn是此选项的Connection对象,你会使用:prop.put(OracleConnection.NTF_GROUPING_START_TIME,new TIMESTAMPTZ(conn,"2007-06-21 10:10:00.0"));.
  • OracleConnection.NTF_GROUPING_REPEAT_TIME: "100"/[NTF_GROUPING_REPEAT_FOREVER].
  •        How many times do grouping? Grouping notifications will be sent as many times as specified by the notification grouping repeat count and after that revert to regular notifications. If not specified, it will default to: NTF_GROUPING_REPEAT_FOREVER - keep sending grouping notifications forever.
  •        多少次确定分组?通知分组重复计数的次数决定了分组通知将被发送多少次,之后恢复到常规的通知。如果没有指定,将默认为:NTF_GROUPING_REPEAT_FOREVER - 永远保持发送分组的通知。
Returns:
DatabaseChangeRegistration
Throws:
SQLException
Since:
11.1



---------------------------------------------------------------------

我翻译完再放上来

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值