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.
Connect to the sample database from Interactive SQL.
Run the following command:
dbisql -c "DSN=SQL Anywhere 16 CustDB"
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', 'authenticate_user', 'MobiLinkAuth.authenticateUser'); COMMIT;
For .NET, execute the following SQL statements:
CALL ml_add_dnet_connection_script( 'custdb 16.0', 'authenticate_user', 'MobiLinkAuth.authenticateUser'); COMMIT;
Discuss this page in DocCommentXchange.
|Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0|