UltraLite User's Guide
Developing UltraLite Applications
Adding synchronization to your application
For Java examples, see Initiating synchronization.
The following code fragment initiates TCP/IP synchronization in an embedded SQL application. The MobiLink user name is Betty Best
, with password TwentyFour
, the script version is default
, and the MobiLink synchronization server is running on the host machine test.internal
, on port 2439
:
auto ul_synch_info synch_info; ULInitSynchInfo( &synch_info ); synch_info.user_name = UL_TEXT("Betty Best"); synch_info.password = UL_TEXT("TwentyFour"); synch_info.version = UL_TEXT("default"); synch_info.stream = ULSocketStream(); synch_info.stream_parms = UL_TEXT("host=test.internal;port=2439"); ULSynchronize( &sqlca, &synch_info );
The following code fragment initiates TCP/IP synchronization in a C++ API application. The MobiLink user name is 50
, with an empty password, the script version is custdb
, and the MobiLink synchronization server is running on the same machine as the application (localhost
), on the default port (2439):
auto ul_synch_info synch_info; conn.InitSynchInfo( &synch_info ); synch_info.user_name = UL_TEXT( "50" ); synch_info.version = UL_TEXT( "custdb" ); synch_info.stream = ULSocketStream(); synch_info.stream_parms = UL_TEXT("host=localhost"); conn.Synchronize( &synch_info );
The following code fragment for an embedded SQL application on the Palm Computing Platform is called when the user exits the application. It allows HotSync synchronization to take place, with a MobiLink user name of 50
, an empty password, a script version of custdb
. The HotSync conduit communicates over TCP/IP with a MobiLink synchronization server running on the same machine as the conduit (localhost
), on the default port (2439):
auto ul_synch_info synch_info; ULInitSynchInfo( &synch_info ); synch_info.name = UL_TEXT("Betty Best"); synch_info.version = UL_TEXT("default"); synch_info.stream = ULConduitStream(); synch_info.stream_parms = UL_TEXT("stream=tcpip;host=localhost"); ULPalmExit( &sqlca, &synch_info );