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

SQL Anywhere 10.0.1 » MobiLink - Server Administration » Writing Synchronization Scripts in Java » MobiLink server API for Java Reference

MobiLink server API for Java Reference Next Page

DBConnectionContext interface



Interface for obtaining and accessing information about the current database connection. A DBConnectionContext instance is passed to the constructor of classes containing scripts. If context is required for a background thread or beyond the lifetime of a connection, use the ServerContext class.

See also

The following example shows you how to create a class level DBConnectionContext instance to use in your synchronization scripts. The DBConnectionContext getConnection method obtains a java.sql.Connection instance representing the current connection with the MobiLink consolidated database.

import java.sql.*;

public class OrderProcessor {
  DBConnectionContext _cc;

  public OrderProcessor( DBConnectionContext cc ) {
    _cc = cc;

  // The method used for the handle_DownloadData event.
  public void HandleEvent() 
    throws SQLException {
    java.sql.Connection my_connection = _cc.getConnection();
     // ... 

 // ...


A DBConnectionContext instance should not be used outside the thread that calls into your Java code.

getConnection method
getDownloadData method
getProperties method
getRemoteID method
getServerContext method
getVersion method