Skip to Content

First of all, credits to Jan from SAP for helping me out on this. I thought it is worthwhile to share it to you all. From SUP 2.1.3, Sybase creates a .udb file on the iOS native apps to keep the data synchronised from the unwired server. In the previous version it was SQLLite.

I normally prefer to have a look into the local db (called sandbox) to see if my native app queries work. It was a piece of cake when it was SQLite as there is a simple browser on sourceforge that anyone can download and use. I found it a little difficult when Sybase moved from SQLite to Ultralite. My existing SQLite browser did not work. If you face the same issue use this technique:

1. Every unwired server installation comes with Sybase Central as db editing tool for all Sybase databases. However each DB can be analysed by its respective plugin inside Sybase Central. Normally the Ultralite plugin is available in the tool. So first find Sybase Central: where your unwired server is installed

ultraliteexe.JPG

2. Next connect with ultralite plugin from connections:

openultraliteplugin.JPG

3. Specify the connection parameters: Before doing this, download the .udb file from you device onto the server. You must undertsand that if you use client object APIs then Sybase automatically creates the DB with an encryption key when it is needed by the messaging client. However AFAIK you can not get hold of the encryption key. So I manually created the DB using client object API methods and set my own encryption key. Here is an example of a key

f0317df41d7807d005e37ef4034d7ce7a0780bceb8f760820c4e8417cd3ddb5104e03f38035e80dc00b713b0fd0f9eba

The connection parameters are:

1. The user name (usually) : dba

2. Password: sql

3. The path to the UDB file

4. The encryption key

connect to ultralite.JPG

4. On successful connection, it takes you the DB browser where you can see the databases created on your iOS device. Use interactive SQL by performing a right click on the desired table to write queries and analyse data.

tableview.JPG

5. This is important if you HIT an error: If you get an error before you connect that says “database driver not found or not registered” then just do this

     1. From the command prompt on your server navigate to C:Windows\System32 and run the regsvr32 command. The command takes an argument, specify

     C:\Sybase\UnwiredPlatform\Servers\SQLAnywhere12\BIN32\ulodbc12.dll. This registers the ulodbc12.dll with the reg and the error  should go away.

cmd.JPG

Thats it for now, see you back in an other blog.

To report this post you need to login first.

19 Comments

You must be Logged on to comment or reply to a post.

  1. Jonathan Keogh

    Hi Inv,

    Thanks for presentation. I get below error. I think it is self explanatory i.e. “was created by a different version of the software”. However wondering if you knew an easy way around this ? i.e without installing a diffeerent version 😉

    Backward compatibility may not be possible

    Thanks,

    Johnny

    Could not connect to the database.

    Unable to start specified database: ‘C:\Users\i034154\Desktop\cA_FirstPhone4_0.udb’ was created by a different version of the software

    [ODBC] [UltraLite Database] Unable to start specified database: ‘C:\Users\i034154\Desktop\cA_FirstPhone4_0.udb’ was created by a different version of the software

              SQLCODE=-1005

              SQLSTATE=HY001

    Connection parameters:

              User=dba

              Password=***

              DBF=C:\Users\i034154\Desktop\cA_FirstPhone4_0.udb

    (0) 
          1. mousumi snai

            I had already checked that blog. When i run my android application , in my files there is data/data/databases i got .ulj file. How can i get .udb file for device database?

            (0) 
                      1. Jitendra Kansal

                        yeah.. i have seen your thread. unfortunately license for sup server (on my machine) has expired yesterday. 🙁 i will have to wait till i get new one.

                        (0) 
  2. Guven Bolukbasi

    Great article, each step is well described.

    I have one question regarding setting the encryption key:

    – I also set the encryption key manually (as you pointed out) via the changeEncryptionKey() method. However, when I re-launch the app, I get an exception from DB anytime I try to access it. It is described here in the SUP troubleshooting guide (http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01944.0230/doc/html/jwo1332300557256.html).

    – Were you able to find a solution for this? Calling startConnection() doesn’t help. What are your steps for initializing the application & DB on subsequent starts of the app?

    – I am working on iOS client code.

    Thanks,

    Guven.

    (0) 

Comments are closed.