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
2. Next connect with ultralite plugin from connections:
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
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.
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.
Thats it for now, see you back in an other blog.
Hi,
I am also facing same issue when i connected to Ultralite DB,Thanks for giving information.
Cheers,
Syam.
Is that a question? Are you having problems opening the DB?
regards
lnv
Hi,
No,Now i am able to access DB.
Thanks,
Syam.
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
Hi Lakshminarayanan,
i have .udb file created by ultralite DB and i just want to open this file to see the records.
is then any IDE or Utility to do that.
Request an urgent reply.
Regards,
Jitendra Kansal
Lakshminarayanan V
Hi Jitendra,
Try using the SQLite Database Browser plugin for Eclipse
http://blog.kwyps.com/2011/07/how-to-view-sqlite-database-on-your.html
You can even try using it to open with SQL Anywhere 12
Check this link
http://infocenter.sybase.com/help/topic/com.sybase.help.sqlanywhere.12.0.0/pdf/uladmin12.pdf
Hope this helps,
Thanks,
Iam not getting the udb file , can anyone please tell me how can i find this file??
Hi Mousumi,
Did you check
http://scn.sap.com/community/developer-center/mobility-platform/blog/2013/04/29/how-to-accessread-device-database
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?
udb file is for ios platform.
for android, you need to search in DDMS
file explorer> data>data>package>.db file
Rgrds,
Jitendra
hi i had already checked that but there is no .db file. I want to send you a screenshot for that but image is not attached .
you can raise a new thread and share possible screenshots.
http://scn.sap.com/community/developer-center/mobility-platform
Rgrds,
Jitendra
ok thanks
i had started a new thread , can u please check it?
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.
hey u didnot replied yet about ultralitedb.
i have replied..
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.
Solved the problem.
I was setting the encryption key in the SynchronizationProfile instead of the ConnectionProfile.
Thanks.