Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
紧接在 MobiLink 服务器开始对下载进行准备之前处理任何语句。
在下表中,说明部分提供 SQL 数据类型。如果您使用 Java 或 .NET 编写脚本,则应该使用相应的数据类型。 请参见SQL-Java 数据类型和SQL-.NET 数据类型。
在 SQL 脚本中,可以按名称或使用问号指定事件参数。不建议使用问号,建议您使用命名参数。不能在一个脚本中混合使用名称和问号。如果使用问号,则参数必须按照如下所示的顺序并且仅当没有指定任何后继参数时才是可选的(例如,如果您想使用参数 2,则必须使用参数 1)。如果使用命名参数,则可以按照任何顺序指定任意参数子集。
无。
MobiLink 服务器执行该事件是对下载的信息进行处理的第一步。下载信息是在单独的一个事务中进行处理的。执行此事件是此事务中的第一步操作。
下面的示例调用 ml_add_connection_script,将事件指派给名为 SetDownloadParameters 的存储过程。
CALL ml_add_connection_script ( 'Lab', 'begin_download', 'CALL SetDownloadParameters( {ml s.last_table_download}, {ml s.username} )' )
以下对 MobiLink 系统过程的调用在同步脚本版本 ver1 时将名为 beginDownloadConnection 的 Java 方法注册为 begin_download 连接事件的脚本。
CALL ml_add_java_connection_script( 'example_ver', 'begin_download', 'ExamplePackage.ExampleClass.beginDownloadConnection' )
以下是 Java 方法 beginDownloadConnection 示例。它调用一个 Java 方法 (prepDeleteTables),该方法使用先前设置的 JDBC 连接准备删除表。
public void beginDownloadConnection( Timestamp ts, String user ) throws java.sql.SQLException { prepDeleteTables ( _syncConn, ts, user ); }
以下对 MobiLink 系统过程的调用在同步脚本版本 ver1 时将名为 BeginDownload 的 .NET 方法注册为 begin_download 连接事件的脚本。
CALL ml_add_dnet_connection_script( 'ver1', 'begin_download', 'TestScripts.Test.BeginDownload' )
以下是 .NET 方法 BeginDownload 示例。它调用一个 .NET 方法 (prepDeleteTables),该方法使用先前设置的数据库连接准备删除表。
public void BeginDownload( DateTime timestamp, string user ) { prepDeleteTables ( _syncConn, ts, user ); }