In this lesson, you create a SQL Anywhere database.
Prérequis
This lesson assumes that you have installed the required software and completed part one of this tutorial. See Tutorial: Building a BlackBerry application.
Contexte et remarques
Data synchronization requires a MobiLink consolidated database for the UltraLite database to synchronize with.
Create a working directory to store the SQL Anywhere database.
This tutorial assumes that you are working in the c:\HelloBlackBerry\database directory.
Run the following command to create an empty SQL Anywhere database with a DBA user ID of DBA and password of sql:
dbinit -dba DBA,sql HelloBlackBerry.db |
Create an ODBC data source to connect to the database.
Click Start » Programs » SQL Anywhere 16 » Administration Tools » ODBC Data Source Administrator.
Click the User DSN tab, and then click Add.
In the Create New Data Source window, click SQL Anywhere 16 and 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.
In the Password field, type sql.
From the Action list, click Start And Connect To A Database On This Computer.
In the Database File field, type c:\tutorial\database\HelloBlackBerry.db.
In the Server Name fields, type HelloBlackBerry.
Disable the Stop Database After Last Disconnect option.
Click OK.
Click OK on the ODBC Data Source Administrator window.
Run the following command to start Interactive SQL and connect to the SQL Anywhere database:
dbisql -c dsn=HelloBlackBerry |
Execute the following SQL statement in Interactive SQL to create the Names table on the consolidated database:
CREATE TABLE Names ( ID UNIQUEIDENTIFIER NOT NULL DEFAULT newID(), Name varchar(254), PRIMARY KEY (ID) ) |
Close Interactive SQL.
Click File » Exit.
![]() |
Discuter à propos de cette page dans DocCommentXchange.
|
Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0 |