How to completely reload a TFDManager in C++ Builder? - c++builder

In my C++Builder application, i'm trying to do a configuration form where the user could change the database that FireDAC uses on runtime, to do that, i'm editing the FDConnectionDefs.ini file and saving it. So far it works using RefreshConnectionDefFile, but if i used the database once in my runtime, it won't reload and i have to close the program for the changes to actually being applied to my DB usage. How can i completly reload my TFDManager ?

Related

Under what circumstances does the page cache in SQLite get cleared?

I use sqlite in an iOS app. Sometimes I replace a sqlite file at runtime and close and reopen my connections to it. But sqlite often seems to return query results from the old file when connected to the new file. My guess so far is that it's somehow keeping and using the page cache from the old file.
So my question is this: under what circumstances does SQLite's page cache get dropped?
Got it. I was walking through all my connections and closing and reopening each. When I simply closed them all (and let them get reopened later on demand as needed), the cache appeared to get cleared. My guess is that the cache is per-file and not per-connection, and it gets reset when all the connections to the file are closed. This can be tricky to achieve in a multithreaded environment.

Bind sqlite database with custom iOS framework

I have developed a custom ios framework for achieving some task, which is working perfectly but I have to add my sqlite database separately in my test app. I want to bind my sqlite database with my custom framework so that it will automatically added in any app where user want to user that framework.
I also don't want to show sqlite database to anyone. can anyone please tell me the best way to achieve this.
I believe you're looking to ship a sqlite database with your app, and have it installed invisibly to the user. Just add the database to your NSBundle, by including it in the application. The important part is that you must copy this bundled database to the file system (you probably want to also mark it as not being in the cloud), because the NSBundle'd files are read-only. So, here's your strategy: 1) on startup, check to see if the database is in the file system. 2) if not, copy it from the NSBundle to the file system, 3) open the database in the file system.
Maybe there is a better solution to your question but here is a suggestion on what you could: Programmatically create the database in your framework. As for hiding the database here is the solution to that! You may also encrypt the sqlite file.
Cheers

Update data from a sqlite file in other viewControllers

I'm developing my first iOS application .
In this application , I am using Storyboard and it got some Views and TableViews use information captured from a SQLite file.
This file SQLite suffers updates constantly , so I created a PHP system that always updates and offers that SQLite file through a URL of my site .
In my application I've created a View configuration , which checks for a new SQLite file to download, and if you have , download this file and replace the existing database with the new. With that my application is always updated .
My problem is right there. When the user opens the application , it goes straight to a view that captures the information from the database and list in a table .
If, then, you go to the View configuration and update the database, that my first view will be updated only when the user restarting application.
Do not know if has to understand what is happening, but it seems like after reading the SQLite first, my application writes a kind of Cache.
I need it as soon as you download and replace the database, I can force the application to update the information, even though the other Views have already been accessed or not.
Now appreciate the patience and help of all.
hugs

No data in tables when copying sqlite database to ios app

I'm using core data and am pre-populating it using a SQlite database that I provide in the bundle. It's been working fine for a while, however I've just edited the database and when I copy it over there is no data displayed. So I opened the database that is on the ios simulator, in base, and I found an sqlitemaster table that contains lots of SQL statements such as CREATE TABLE..., but the tables I want don't contain any data.
What's weirder is that after a while the database is fine and all the data is in it as normal. Is this because the statements in the sqlitemaster table were executed?
Has this happened to anybody else? I don't know whether it's because I've upgraded to iOS 7 or not? If anybody could point me in the right direction that would be great
The latest iOS Core Data SQLite backend uses journaling. You should notice .shm and .wal files in the same directory as what you assumed was your main sqlite backing store for Core Data. This data eventually gets into the main file, but journaling optimizes some situations for Core Data configured with SQLite.
As a developer, you generally never care about this from within the app, but if you are trying to inspect the persisted Core Data graph via the actual file, you'll need to be aware.
I've had a look around and the journaling was causing it to go all weird. Found this post which shows the same problem I had. If anyone else has this look at that post

error making connection with database in xcode? cannot connect with the database

i am using sqlite manager thourgh the add-on on firefox.
i have made an empty database and that database is stored where my crud app is stored.
Note! : this is my first crud Application on IOS i am facing problem connecting with database and for crud it is obvious to first connect to database.
The Steps I have Followed Are:
open sqlite manager form firefox made a db named productsDB.sqlite and save this to the same folder where i create my app.
i have include the libsqlite3.0.dylib also.
Then i have add the database into the Application by right click and add file....
Then i have write the code for connectivity by passing it into string.
Getting error while inserting data to my table in database using 'storyboard' i.e "no visible interface..."?
this links leads to the connectivity code.
I am using storyboard.
For learners like me i would suggest them to make a simple core data app once you made it then you will know how to import add an isolated db.
By the way core data itself make an sqlite db for you.
so first go through the core data as it is the first step to play with db programming in IOS.

Resources