Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » MobiLink - Getting Started » MobiLink tutorials » Tutorial: Using Java or .NET for custom user authentication


Lesson 2: Registering your Java or .NET scripts for the authenticate_user event

SQL Anywhere ships with a SQL Anywhere sample database (CustDB) that is already set up for synchronization. The CustDB ULCustomer table, for example, is a synchronized table supporting a variety of table-level scripts. In this lesson, you register the MobiLinkAuth authenticateUser method for the authenticate_user synchronization event. You add this script to CustDB, the MobiLink sample database.


This lesson assumes you have completed all preceding lessons. See Lesson 1: Creating a Java class for custom authentication (server-side).

This lesson assumes that you have the roles and privileges listed in the Privileges section at the start of this tutorial: Tutorial: Using Java or .NET for custom user authentication.

Context and remarks

CustDB is designed to be a consolidated database server for both UltraLite and SQL Anywhere clients. The CustDB database has an ODBC data source named SQL Anywhere 16 CustDB.

  1. Connect to the sample database from Interactive SQL.

    Run the following command:

    dbisql -c "DSN=SQL Anywhere 16 CustDB"
  2. Use the ml_add_java_connection_script or ml_add_dnet_connection_script stored procedure to register the authenticateUser method for the authenticate_user event.

    For Java, execute the following SQL statements:

    CALL ml_server.ml_add_java_connection_script(
        'custdb 16.0',

    For .NET, execute the following SQL statements:

    CALL ml_add_dnet_connection_script(
        'custdb 16.0',


The authenticateUser method is registered for the authenticate_user event.

 See also