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

SQL Anywhere 12.0.1 » UltraLite - Java Programming » Tutorial: Building a BlackBerry application » Part 2: Using MobiLink to synchronize the BlackBerry application


Lesson 1: Setting up your MobiLink consolidated database

Data synchronization requires a MobiLink consolidated database for the UltraLite database to synchronize with. In this lesson, you create a SQL Anywhere database.

 Set up a consolidated database
  1. Create a working directory to store the SQL Anywhere database.

    This tutorial assumes that you are working in the c:\HelloBlackBerry\database directory.

  2. Run the following command to create an empty SQL Anywhere database:

    dbinit HelloBlackBerry.db
  3. Create an ODBC data source to connect to the database.

    1. Click Start » Programs » SQL Anywhere 12 » Administration Tools » ODBC Data Source Administrator.

    2. Click the User DSN tab, and then click Add.

    3. In the Create New Data Source window, click SQL Anywhere 12 and click Finish.

    4. Click the ODBC tab.

    5. In the Data Source Name field, type HelloBlackBerry.

    6. Click the Login tab.

    7. In the User ID field, type DBA.

    8. In the Password field, type sql.

    9. From the Action list, click Start And Connect To A Database On This Computer.

    10. In the Database File field, type c:\tutorial\database\HelloBlackBerry.db.

    11. In the Server Name fields, type HelloBlackBerry.

    12. Disable the Stop Database After Last Disconnect option.

    13. Click OK.

    14. Click OK on the ODBC Data Source Administrator window.

  4. Run the following command to start Interactive SQL and connect to the SQL Anywhere database:

    dbisql -c dsn=HelloBlackBerry
  5. Execute the following SQL statement in Interactive SQL to create the Names table on the consolidated database:

    CREATE TABLE Names (
        Name varchar(254), 
        PRIMARY KEY (ID)
  6. Close Interactive SQL.

    Click File » Exit.