UltraLite User's Guide
Tutorial: Build an Application Using Java
The UltraLite generator writes out two Java files. One contains the SQL statements, as an interface definition, which is here named ISampleSQL.java. You can use this interface definition in your main application code. The second file holds the code that implements the queries and the database, and is here named SampleDB.java.
To generate the UltraLite database code
Open a command prompt, and go to your JavaTutorial directory.
Run the UltraLite generator with the following arguments (all on one line):
ulgen -a -t java -c "dsn=UltraLite 9.0 Sample" -j Product -s ISampleSQL -f SampleDB
The arguments have the following meanings:
-a Generate SQL string names in upper case. The InsertProduct and SelectProduct statements come to INSERT_PRODUCT and SELECT_PRODUCT.
-t The language of the generated code. Generate Java code instead of C code.
-c The connection string to connect to the database.
-j The UltraLite project name. This name corresponds to the project name you provided when you added the SQL statement to the database. The generator produces code only for those statements associated with this project.
-s The name of the interface that contains the SQL statements as strings.
-f The name of the file that holds the generated database code and query execution code.