Working with BDB SQL API (libsqlite3.a) on iPhone Simulator

Hi,
I downloaded latest BDB and got a static library libsqlite3.a by compiling the code on Mac OS X (1.6.8 64bit).
I am now trying to use this library as a drop in replacement into a SQLite project.
I copied the SQLite database (with only one table) to a new Berkeley DB.
I want to access this new Berkeley DB with existing code using SQLite.
I followed following steps:
1. Added (copied) libsqlite3.a from build directory to my project
2. Added #import <db.h> and left #import <sqlite3.h> as it is
3. compiled the code and ran it in iPhone simulator
The code runs fine until I go to prepare a statement. Please see the snippet from the function below:
- (void)initializeDatabase {
NSMutableArray *todoArray =[[NSMutableArray alloc] init];
self.todos = todoArray;
[todoArray release];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"todo.db"];
if (sqlite3_open([path UTF8String], &database) == SQLITE_OK) {      // This is ok, opens berkeley DB
const char *sql = "SELECT pk FROM todo";
const char *tail;
sqlite3_stmt *statement;
if (sqlite3_prepare_v2(database, sql, -1, &statement, &tail) != SQLITE_OK) {    *// Fails here - table and records exist in Berkeley DB*
if (sqlite3_step(statement) == SQLITE_ROW) {
int primarykey = sqlite3_column_int(statement, 0);
Todo *td = [[Todo alloc] initWithPrimaryKey:primarykey database:database];
[todos addObject:td];
[td release];
} else {
NSAssert1(0, @"Failed to read from the table '%s'.", sqlite3_errmsg(database));
sqlite3_close(database);
sqlite3_finalize(statement);
} else {
NSAssert1(0, @"Failed to open database with message '%s'.", sqlite3_errmsg(database));
sqlite3_close(database);
The log dump:
GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 14578.
Pending breakpoint 1 - ""todoAppDelegate.m":109" resolved
Current language: auto; currently objective-c
/Users/kpotnis/Library/Application Support/iPhone Simulator/4.3.2/Applications/0322BCD5-4C71-498E-82EC-469133B7A935/Documents/todo.db: BDB0113 Thread/process 14578/2696754496 failed: BDB1507 Thread died in Berkeley DB library
Any thoughts?
Edited by: 868618 on Jul 11, 2011 4:51 AM

Hi,
I was looking over this and I was wondering if you've got the chance to progress with this issue or if you need assistance?
Thanks,
Bogdan Coman

Similar Messages

  • Binding parameters to dynamic VO with PL/SQL API call with no where clause

    Hi all,
    I am required to change exisiting queries to queries with "bind" parameters. Some of our VOs are dynamic and with PL/SQL api calls like below:
    String stmtStr = "selectXXX_API_UTILS.chk_urg_since_last_prg("
    + projectId + "," + PPCId + ",'XYZ_TASKS'," + taskId+ ")"
    +" from dual ";
    ViewObject tmpVO = transaction.createViewObjectFromQueryStmt(stmtStr);
    In this regard, I am unsure how to bind the PPCId and taskId parameters to the VO. setWhereClauseParams() would not work here as there is now where clause.
    Thanks in advance,
    Srini

    In case of preparedStatement, we mention bind parameters to be passed using "?". Then we pass paramters sequencially.
    But in the your case following is enough:
    int projectId = 100 ; (hardcoding values for example)
    int taskId = 500 ;
    String stmtStr = "selectXXX_API_UTILS.chk_urg_since_last_prg("
    + projectId + "," + PPCId + ",'XYZ_TASKS'," + taskId+ ")"
    +" from dual ";
    -Anand

  • [svn:osmf:] 13228: Updating ExamplePlayer to work with the latest API changes.

    Revision: 13228
    Revision: 13228
    Author:   [email protected]
    Date:     2009-12-30 04:33:34 -0800 (Wed, 30 Dec 2009)
    Log Message:
    Updating ExamplePlayer to work with the latest API changes.
    Modified Paths:
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/chromeless/ChromelessPl ayerElement.as
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/text/TextElement.as
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/traceproxy/TraceListene rProxyElement.as
    Added Paths:
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/text/TextDisplayObjectT rait.as
    Removed Paths:
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/text/TextViewTrait.as

    Revision: 13228
    Revision: 13228
    Author:   [email protected]
    Date:     2009-12-30 04:33:34 -0800 (Wed, 30 Dec 2009)
    Log Message:
    Updating ExamplePlayer to work with the latest API changes.
    Modified Paths:
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/chromeless/ChromelessPl ayerElement.as
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/text/TextElement.as
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/traceproxy/TraceListene rProxyElement.as
    Added Paths:
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/text/TextDisplayObjectT rait.as
    Removed Paths:
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/text/TextViewTrait.as

  • Sharepoint 2013 list view quick edit does not work with out remote API permissions

    sharepoint 2013 list view quick edit does not work with out remote API permissions.
    When I give Use Remote Interfaces  -  Use SOAP, Web DAV, the Client Object Model or SharePoint Designer interfaces to access the Web site it works which is not an ideal situation..
    MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint Lead

    This is true. If you use Fiddler to watch the requests from the list view quick edit you can see CSOM calls. For example when changing a value in a cell, when you tab out you will see the SetFieldValue and Update method calls on the list item.
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • The DB tools doesn't work with Microsoft SQL

    I am tring to write series of waveforms to a database. The DB tools doesn't work with Microsoft SQL, but when i replace the SQL with Access, it works fine. I have to use SQL in the application.
    Any advice pls?
    longing for your reply.
    Attachments:
    test.vi ‏47 KB

    Right off hand I would say the problem is that you are connecting through ODBC. Try the native SQL Server driver, your connect string should define the provider as "SQLOLEDB.1".
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Does Captivate work with Tin Can API? Yes it does!

    Hi guys,
    I don't know if you've been following the progress of Project Tin Can and the Tin Can API, but if not you can find out more here:
    http://scorm.com/tincan/
    You may be thinking - that's great but Captivate doesn't publish for Tin Can.
    Well, I'm here to tell you about a litle project that aims to allow you to take Captivate swfs and drop them into a Tin Can package that will communicate with the LRS. I've so far developed a proof of concept - a Captivate swf that reports to a TIn Can LRS and also successfully bookmarks. Its far from being a finished product and there's a lot of stuff like hard coded variables and missing functionality, but the basics are there.
    You can download the proof of concept here: http://tin-can-can.googlecode.com/files/poc.zip
    The project is called Tin-can-Can and is hosted at http://tin-can-can.googlecode.com
    I need your help to get it finished and make it awesome - whatever your skillset.
    It would be great ot have help with developing the javascript, but if you can't do Javascript I'd love you to get invovled too.
    I also need people who can test the wrapper, help to build the documentation wiki, design a logo, manage the code responsitory, publicise the project, give and collect feedback from users, make/organise/implement suggestions etc. etc.
    If you'd like to be involved, visit the project site for my email address and send me a mail explaining what you can and would like to do.
    Feel free to shoot me any questions about the project. Send any questions about Tin Can API generically to the guys at http://scorm.com/tincan/
    @garemoko

    Hi folks,My host are still being rubbish so I've re-written the site in static HTML, moved it across to Github and re-pointed the DNS. All the good content is not available again, but in a nicer and mobile friendlier format. http://www.tincanapi.co.uk
    The downside is that all of the urls have changed for the individual pages so any existing links to specific pages will get a lovely custom 404 error and need to be changed to point to the new location.
    Andrew
    Date: Fri, 15 Feb 2013 06:08:44 +0000
    Subject: Re: Does Captivate work with Tin Can API? Yes it does!
    From: [email protected]
    To: [email protected]
    Hi chip,
    I'm having massive problems with my host (123reg) these last 2 days and being at work, haven't had time to sort it. The site will be back up over the weekend, even if I have to change host.
    The code is still up on github at https://github.com/garemoko
    I'll probably move the whole site across to Github pages this weekend
    Andrew

  • What is the latest version of bluetooth that works with IOS 6.1.6 on an iphone 3gs

    what is the latest version of bluetooth that works with IOS 6.1.6 on an iphone 3gs??  I'm thinking of getting some bluetooth earbuds, but don't know if 6.1.6 will work with any bluetooth version beyond v2.1...Any thoughts, anybody???

    The iPhone 3GS supports Bluetooth 2.1 and earlier; all versions of Bluetooth are backwards compatible.
    (118058)

  • Is there an adapter can i get so square will work with the otterbox i have on my iphone

    Is there an adapter can i get so square will work with the otterbox i have on my iphone, I love the otterbox and want to keep it on all the time. not only does it protect my iphone it, it makes it easy for me to hold because I have trouble with my hands. please help

    That's a good question. The main problem with the Square readers is that the plug is designed to send data to devices, rendering most headphone extension cables useless.
    Reading another forum I saw this: http://www.amazon.com/gp/product/B001BN7XSM
    Give that a try. Claims to work perfectly for Square. NOT headphones.

  • Mail has stopped working with msn on my iMac, iPad and iPhone. No settings have been changed.

    Mail is no longer working with msn on my iMac, iPad and iPhone 6. No settings have been changed. I tried changing my password thinking I may have been hacked but it comes back saying wrong username and/or password. I have started the 2 way verification but nothing seems to work. Have I missed something?

    Upgrade your browser to Firefox 9 and check
    * getfirefox.com

  • I have a Powerbook G4 (don't laugh) with iPhoto '08. How does iCloud work with my computer. I have a iPhone 4 that has iCloud.

    I have a Powerbook G4 (don't laugh) with iPhoto '08. How does iCloud work with my computer. I have a iPhone 4 that has iCloud. Is iCloud pushing my phone's PhotoStream to my computer if it doesn't have the latest OS? Thanks so much for whoever can help!

    iCloud will not work with your computer because iCloud requires Lion. Lion requires an Intel Core 2 Duo processor or better. For you to have iCloud and PhotoStream you would need to buy a newer Mac Intel model meeting the requirements for Lion:
    Lion System Requirements
    Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor
    2GB of memory
    OS X v10.6.6 or later (v10.6.8 recommended)
    7GB of available space
    Some features require an Apple ID; terms apply.

  • How to get JDev 10.1.2/ADF working with MS SQL Server Identity Column

    Hello JDevTeam & JDevelopers,
    I want to use JDev/ADF with a MS SQL Server 2005 database that contains tables employing IDENTITY Columns.
    Using JDev/ADF and DBSequence with an Oracle database employing before triggers/sequences accomplishes what I am trying to do except I want to accomplish the same thing using a MSSQL Server 2005 database. Unfortunately I cannot change the database.
    I have been able to select records but I am unable to insert records (due to my lack of knowledge) when using MS/SQL Server Identity Columns with JDev/ADF.
    The following are the steps taken thus far.
    Step1: Create table named test in the 2005 MSSQL Server (see script below).
    Step2: Register 3rd Party JDBC Driver with JDeveloper; Using use Tools/Manage Libraries. Create a new entry in User Libraries with the following;
         Library Name     = Ms2005Jdbc
         Class Path     = C:\dev\Ms2005Jdbc\sqljdbc_1.0\enu\sqljdbc.jar
         (note: Latest TYPE 4 JDBC driver for Microsoft SQL Server 2005 - free at http://msdn.microsoft.com/data/ref/jdbc/)
    Step3:Create New Database Connection;
         Connection Name = testconn1
         Type = Third Party JDBC Driver
         Authentication Username = sa, Password = password, Check Deploy Password
         Connection
              Driver Class = com.microsoft.sqlserver.jdbc.SQLServerDriver     
              Library = Ms2005Jdbc     
              Classpath = C:\dev\Ms2005Jdbc\sqljdbc_1.0\enu
              URL = jdbc:sqlserver://192.168.1.151:1433;instanceName=sqlexpress;databaseName=test
         Test Connection = Success!
    Step5: Create a new application workspace using Web Application default template
    Step6: In Model project, Create new Business Components Diagram.
    Step7: Create new Entity Object. Goto to connections/testconn1, open tables and drag table test onto the diagram.
    Step8: Generate Default Data Model Components by right-clicking on Entity Object. Except all the defaults.
    When I test the Appmodule I select the view object and can scroll through all the records without error. If I try to insert a record, I get JBO-27014: Attribute testid in test is required.
    Going back to the EntityObject I deselect the Mandatory attribute and re-run the test. Now when I try to insert it accepts the value for testname but it does not update the PK testid like it would using an "JDev/ADF/DBSequence/Oracle database/before trigger/sequence" solution.
    Going back to the EntityObject and selecting refresh on insert does not solve this problem either. Changing the URL connection string and adding "SelectMethod=cursor" did not help and changing the SQl Flavor to SQLServer produced errors in the Business Components Browser. I've tried overriding isAttributeChanged() and other things as well.
    I am totally stuck! Can anyone provide a solution?
    Thanks for you help,
    BG...
    Create table named test
    use [testdb]
    go
    set ansi_nulls on
    go
    set quoted_identifier on
    go
    create table [test](
         [testid] [int] identity(0,1) not null,
         [testname] [nvarchar](50) collate sql_latin1_general_cp1_ci_as not null,
    constraint [pk_test] primary key nonclustered
         [testid] asc
    )with (pad_index = off, ignore_dup_key = off) on [primary]
    ) on [primary]

    Figured it out!
    When using the MS SQL Server 2000 Database with the MS JDBC 2000 Driver you specify the SQL Flavor to SQLServer. However setting the SQL Flavor to SQLServer with MS SQL Server 2005 Database and the MS JDBC 2005 Driver will *** fail ***.
    When working with the MS SQL Server 2005 Database and the MS JDBC 2005 Driver you set the SQL Flavor to SQL92 and the Type Map to Java.
    If using a named instance like I am you would specify the URL = jdbc:sqlserver://<db host ip address>:<listening port>;instanceName=<your instance name>;selectMethod=cursor;databaseName=<your database name> (note: leave out the < >)
    The 2005 Driver Class is different then the 2000 and is specified as com.microsoft.sqlserver.jdbc.SQLServerDriver
    Note: In a default MS SQL Server 2005 installation the listening port will change *** everytime *** the host is restarted! You can override this though.
    For the primary key you need to deselect the Mandatory attribute in the EntityObject editor.
    Set Refresh on insert/update = no.
    Set Updateable = never.
    Now my Primary Keys which get their values from the Identity Column are working with ADF in a predictable way.
    Simple enough but I have been away from this stuff for awhile.
    BG...

  • Hi, just bought an Idjay system and I can't get it to work with any of the following: I tried iphone 4s but it has IOS7 so the phone is not recognising when I am plugging the system in I have tried ITouchs,phones

    I have bought a Idjay system and I have the App on the 4S phone however the phone is not aknowledging the system. After googling we found that their is an issue with IOS7 for this system. So we tried an Itouch, its on IOS6 but doesnt work. Then tried an Ipad but the first version. Thought we had success when the Ipad seen the system connect to it. However I then went to download the App onto the Ipad but it needs IOS6 onwards and as its the first model of the Ipad the latest version is 5.1.1 so I cant download the App...
    Any suggestions? do you know how to get the 4S phone to work with it as that would be the ideal scenario?
    Thanks in advance

    They said that there shouldn't be any reason for it not to work. I bought it off ebay and the previous owner used it on the same devices that I am

  • Graphite base station not working with my Intel Based Mac Mini and iPhone.

    My Airport Express died after 2 years of use. I had to resort to plugging in my old but still functioning Graphite Airport base station. Since the set up assisant on my Mac mini does not work with the older base station, I used my G4 400 tower to set it up. I got it working and tested the connection. On to testing my iPhone. It sees the new network. Password is entered and the wifi icon shows full signal strength, but does not connect to the web. Next I try my Mac mini out on the new network and it too sees the network, but does not connect to the web. I double check the older G4 and the connection is still strong and fast. I shut the G4 down thinking that maybe the Graphite can only support one computer at a time, and the Mac mini and iPhone still can't connect to the web. I'm not sure what to do with this one. Is there a setting that I need to use? As far as security goes, the Graphite base station was set up with a WEP password. Any help would be great
    Message was edited by: Soriano

    I suggest using AirPort Admin Utility (version 4.2) to check the base station settings and change them, if necessary. (AirPort Admin Utility should be able to configure a Graphite base station from a computer running Mac OS X 10.4, even though AirPort Setup Assistant can't.)
    In the Network pane of AirPort Admin Utility, please make sure that "Distribute IP addresses" and "Share a single IP address (using DHCP and NAT)" are checked, and that everything else is unchecked. I am assuming that the Graphite is the only router in your local network and that there are no computers connected via Ethernet.
    The Access Control pane of AirPort Admin Utility should list either all of the relevant AirPort ID's or nothing. You can find the AirPort ID of an OS X computer by looking at System Preferences>Network>Show:AirPort>AirPort.
    The Internet pane of AirPort Admin Utility should be set in accordance with your Internet provider's requirements. Most likely, it should be set to Connect Using:Ethernet and Configure:Using DHCP.
    After verifying the settings, power down the computers, base station and cable or DSL modem for a few minutes, then start them up sequentially, leaving time for each to get fully up and running: first the modem, then the base station, and finally the computers.
    The network preferences on the Mac Mini and the iPhone are also relevant. I assume that the preferences are unchanged from those that worked with the AirPort Express.
    I hope this helps.

  • Existing Apple ID is not longer working with Face Time and Message on the iPhone after iOS 6

    After the IOS 6 update on my iPhone the Apple ID is not longer working with Face Time and Message. Each time I try to log in I receive the message that the password or the user is not right. But they are, because on all other devices and all other parts of the iPhone (iCloud, AppStore, iTunes) they are working. Other Apple IDs are working fine.
    What's wrong? Any idea?
    Thanks

    Blue
    It sounds like you restored from an old back-up.  Did you back-up just before your software update?  It will use your last one and if your last back-up was a ywear old then it will use that one.
    In general, if you are getting these messages on your iPhones select logout (when you get that Apple Id request) and then log back in with your newer ID.
    Sorry for your losses.
    Cheers

  • Airport working with my desktop, but cannot get my Iphone to recognize base station

    Airport express, brand new, seems to be working with my desktop, just fine, and playing Itunes thru airport. However, cannot get my Iphone 5 to recognize base station. Seems to periodically work, but not consistently. Is there any setting change on the iphone that will help?

    Hi myedscape,
    Happy Holidays!  If your iPhone 5 is not consistently connecting to your new Airport Express, try these troubleshooting steps:
    iOS: Troubleshooting Wi-Fi networks and connections - Apple Support
    http://support.apple.com/en-us/TS1398
    Be sure you're in range of your Wi-Fi router (access point).
    Tap Settings > Wi-Fi and turn Wi-Fi off and on. If your Wi-Fi setting is dimmed, follow these steps.
    Confirm that your Wi-Fi router and cable or DSL modem are connected to power, turned on, and connected to the Internet. If not, refer to your network administrator or Internet service provider (ISP) for assistance.
    Restart your iOS device.
    Tap Settings > Wi-Fi and locate the Wi-Fi network to which you're connected.
    Tap  and Forget this Network.
    Try to connect to your desired Wi-Fi network. 
    Note: You may need to enter your Wi-Fi password again if your network requires one.
    Turn your Wi-Fi router off and on2. If your ISP also provides cable or phone service, check with them before attempting this step to avoid interruption of service.
    Update your device to the latest version of software.
    Update your Wi-Fi router to the latest firmware2. For AirPort Base Stations, install updates using the AirPort Utility.
    Reset network settings by tapping Settings > General > Reset > Reset Network Settings. Note: This will reset all network settings including:
    previously connected Wi-Fi networks and passwords
    recently used Bluetooth accessories
    VPN and APN settings
    iOS and OS X: Recommended settings for Wi-Fi routers and access points - Apple Support
    http://support.apple.com/en-us/HT202068
    Airport Express Setup Guide
    manuals.info.apple.com/MANUALS/1000/MA1613/en_US/airport_express_80211n_2nd_gen _setup_guide.pdf
    I hope this information helps ....
    - Judy

Maybe you are looking for