Contents Index Create a directory to hold your files Lesson 2: Run the UltraLite generator

UltraLite Static Java User's Guide
  Tutorial: Build an Application Using Java

Lesson 1: Add SQL statements to your reference database


The reference database for this tutorial is the UltraLite 9.0 Sample database. In a later step, you use this same directory as a consolidated database for synchronization. These two uses are separate, and in your work you may use different databases for the two roles.

Add the SQL statements to the reference database using the ul_add_statement stored procedure. In this simple application, use the following statements:

When you add a SQL statement, you must associate it with an UltraLite project. Here, we use a project name of Product. You must also add a name for the statement, which by convention is in upper case.

To add the SQL statements to the reference database

  1. Start Sybase Central, and connect to the UltraLite 9.0 Sample data source using the Adaptive Server Anywhere plug-in.

  2. Add a project to the database:

  3. Add the INSERT statement to the Product project.

    This operation in Sybase Central is equivalent to executing the following stored procedure call:

    call ul_add_statement( 'Product', 'InsertProduct',
       'INSERT INTO ULProduct( prod_id, price, prod_name)
        VALUES (?,?,?) ' )
  4. Add the SELECT statement to the Product project.

    This operation in Sybase Central is equivalent to executing the following stored procedure call:

    call ul_add_statement( 'Product', 'SelectProduct',
      'SELECT prod_id, prod_name, price FROM ULProduct')
  5. Close Sybase Central.

You have now added the SQL statements to the database, and you are ready to generate the UltraLite database.

For more information, see ul_add_project system procedure, and ul_add_statement system procedure.


Contents Index Create a directory to hold your files Lesson 2: Run the UltraLite generator