Data synchronization requires a consolidated database for UltraLiteJ to synchronize with. In this lesson, you create a SQL Anywhere database.
In your application directory, create a subdirectory to hold the SQL Anywhere database called c:\tutorial\database.
Run the following command from c:\tutorial\database to create an empty SQL Anywhere database:
dbinit HelloBlackBerry.db |
Create an ODBC data source to connect to the database.
Open the ODBC Data Source Administrator.
Choose Start » Programs » SQL Anywhere 12 » Administration Tools » ODBC Data Source Administrator.
Click the User DSN tab to create an ODBC data source for the current user.
Click Add.
From the list of drivers, choose SQL Anywhere 12, and then click Finish.
Click the ODBC tab.
In the Data Source Name field, type HelloBlackBerry.
Click the Login tab.
In the User ID field, type DBA and in the Password field type sql.
These are the default login name and password for all SQL Anywhere databases, and should not be used in a production environment.
Click the Database tab, type HelloBlackBerry as the Server Name and c:\tutorial\database\HelloBlackBerry.db as the Database File. Click OK.
Run the following command to start Interactive SQL and connect to the SQL Anywhere database:
dbisql -c dsn=HelloBlackBerry |
Execute the following statement to create a table in the database:
CREATE TABLE Names ( ID UNIQUEIDENTIFIER NOT NULL DEFAULT newID(), Name varchar(254), PRIMARY KEY (ID) ); |
Close Interactive SQL.
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |