How to Insert data from login form into database table - blackberry

I am new to blackberry, i am doing application in eclipse,i got an situation, how to insert values into the database when entering the data in the login form which contain 2 fields username and password in blackberry applications, please provide solution.

It's quite difficult to understand what are you asking here.
Do you want to add login form data to a local (mobile) database? Or you want to add it to a centralized (to all applications) server?
In the former case, you need to use BlackBerry APIs to create and populate databases using Persistent Object Store (which is always available for BlackBerry Apps) or use any other database you can separately install in BlackBerry. Also consider using SQLite (integrated with BlackBerry OS 5 or superior).
In the latter case, you need to send login data through HTTP (or any other TCP based protocol) and once data is on you application server, you can insert it on any database it supports: MySQL, PostgreSQL, Oracle, SQLServer, Sybase, you name it.

http://docs.blackberry.com/en/developers/deliverables/8673/JDE_5.0_SQLiteGuide.pdf
DataStorage concept comes here.For this first of all learn how data can be inserted to a database table..The above link is a guide which helps you to learn everything about how table can be created,stored retrieved.
Store the data you entered in a variable viz.username,password using persistent storage..
Use these variable names in the Insertion syntax..

Related

Sharing database between multiple swift apps

I need to be able to have 3 swift apps which can communicate with each other. Think of app 1 as a base app which communicates with a server and stores info in a local DB and app 2 and 3 need to read (and POSSIBLY write) to that DB created in app 1.
Looking on the net, this appears to be possible with 'app groups'.If all 3 apps are under the same app group, will they automatically have a 'shared folder' where I can create and/or store a Realm DB? Would app 2 and 3 use NSFileManager then to interact with this shared file? I can't seem to find any examples of this in action.
You need a central database to read and write to, from multiple client apps, that is an API at its simplest. In other words, you need an API for your Apps. It is possible that you might be thinking this is more challenging than a shared folder and shared Realm DB but that is not the case, you are actually making the problem more complex by trying to reinvent the wheel of how N number mobile apps share data with each other, it is of no matter that N number apps all reside on the same device, in iOS an app is in a Sandbox, and you trying to circumvent that.
My guess is that your approach to this problem is centered on using Realm DB, but Realm DB is probably not the right tool for the job as Realm DB is a LOCAL database serving ONE app, if Realm DB was designed to work with multiple apps it would be an API tool like Firebase or Amazon S3.
You need to create an API and the API just has one database backing it.
Say for example, App1 needs to save a picture that App2 needs to be able to retrieve and view.
Your API will have a method called:
SavePicture(byte[] picture)
Now App1 saves the picture by calling your API and the picture is saved, either in the database or on the server hard drive, either way there is a record in the database for the saved picture.
Now App2 wants new pictures, say there is a refresh button on App2, the refresh button touch calls your API, another method called
[byte[]] GetPictures()
The GetPictures API method returns an Array of byte[], each being an image, that App2 can display.
You might want to checkout Firebase, this seems to be a third party tool that people use that are not familiar with building APIs, or learn how to build an API, using PHP, Ruby on Rails, ASP.NET Web API, Python, etc. with a database that could be MySQL, PostgreSQL, Sql Server, MongoDB, RavenDB, etc.

Update iOS database via file or via json?

I'm currently updating an app which I developed quite a long time ago. I'm wondering what's the best way to update the sqlite database via REST api.
I'm thinking about the following process:
When the user is opening the app the device will send the current database version (locally stored in a .plist) to a REST webservice.
The webservice compares the client version to the web version - if there is a new one available I would like to send the entire database to the client (no delta updates).
Now I'm thinking what's the better way to "send" the data to the client. Download a sqlite? Or create a JSON at the webservice (what means somehow overhead). The sqlite is currently about 100 kb.
Anyone an idea?
If
there is no user data to preserve and there won't be any in the future, e.g. if your database is completely static
it is safe to assume its size is not going to increase significantly
your database model hasn't changed and is highly unlikely to change in the future
you're 86% sure that you'll never again be requiring a proper api to a similar online database, featuring delta updates and a generic format like json
go ahead and transmit that replacement sqlite. Otherwise, do it properly!

Updating iOS Local Database from server

In iOS, I've had experience working with local-only SQL, and server-only SQL accessed over PHP.
My question is, the app that I'm planning to write will have a local database and a remote database, which is probably pretty common. I'm planning to basically have the iOS app update from certain tables in the server's database.
My question is: Is there a simple or common way to compare the list of columns in a given table, and copy any that are changed or missing from the server to the local database?
Example, if I had a table full of data, and then added a new column on the server, is there a standard way to have the local iOS database reflect that new column?
The idea that I came up with was start both databases as a blank new database, and then any change I add a new SQL script on the server to update the local DB- then, if the iOS device detects a new database revision it would run the update scripts and anything missing would be added. I was just hoping there would be a better way, as this could get messy.
If you use Sqlite in both sides, which would be a zero risk choice for future development, and if you develop a migration system of your own (check Entity Framework Migrations or https://github.com/mocra/fmdb-migration-manager for ideas), you can simply compare latest migration versions and transfer them accordingly. This would be the wisest choice, in my humble opinion.
You should choose webservice for making updates to your iOS app database with Server database. That will be quite easy and efficient way and also Json and xml libraries are powerful way to parse your data. Let me know if you have further queries!

iOS backend service manual data storage

I've searched about best iPhone backend services and best recommended are parse.com, stackmob... But what I'm interested is which one is best for storing own data by hand and then using that data for iOS ?
As I read the docs on all of these sites they are always refering to saving games data or any other data from the iPhone to the backend. But I would like to store my own data manually (so on www.parse.com website for example) on that backend and then use it/retrieve it on iPhone. Is that good aproach? Are those backends even used for those kind of stuff or should I create my own database for that?
If they are used, which one is the best? From all the recommendations and reviews looks like parse.com is prolly the best one.
Thanks.
Hmm, manually typing into Parse.com could be tedious although it is allowed with a clean UI. I suggest you put all your data in an Excel sheet, write an Excel formula to generate CURL commands and run the CURL command in a terminal that would save the data to your Parse.com account.
https://www.parse.com/docs/rest#objects-creating
EDIT
This question is old and parse.com is dead but there are many more options now.
Firebase
Use Swift Vapor/Perfect to create your own backend on AWS
Parse.com is good you can update data manually in parse.com table.
steps create parse.com account-> create your app -> click on the dashboard-> left side click to add class analogous to table-> add rows in your class manually or through API->fill data in columns.
Best part you don't have to pay till you generate enough traffic. so if your app is not a success you save on back-end development.
If on a later date you want higher capacity you can upgrade or you can export your database and port it to your own server.

Which database can be used with Xcode and at the same time be populated through a website?

We are trying to create an iPhone application that will automatically receive data from a database. Which is a database that will work with Xcode. Our goal is that users can go to our website and input information. That data will be recorded to a database. Once the user downloads our app, the info should then be retrieved from the database and included in the app. We are wondering what database is suitable. It must be able to receive information from a website AND submit it to an application.
You're unlikely to find a iOS "aware" database that can automatically sync content over the internet.
However, you can of course obtain the data over the internet yourself and then insert it into the local database on the device, in which case the popular (and supported out of the box) SQLite would seem like an obvious choice.
As #Deepak also suggests, you could use Core Data which is a (sort-of, ish) ORM that can automatically use SQLite as it's underlying storage mechanism.
The solution that most people use in this case is to use an RDBMS like MySQL and build a web-service layer on top of the database for the entities that your iPhone app is interested in.
This way, when a user goes to the web-app, they can add the data that you allow them to add there, and later on they can access the same data from the iPhone app via the web-service layer also.
Couchbase's new iOS-Couchbase framework is in beta right now - all the functionality of Apache CouchDB on your favourite developer platform - at https://github.com/couchbaselabs/iOS-Couchbase. the iOS release is new but we're looking for it to go places!
Its awesome sync abilities would allow you to pull down any relevant content from your website via HTTP/JSON, or further formats using shows and lists if needed. Pushing data the other way is just as easy. Sync can be continuous, or on demand, bidirectional or one way.
Take a look at some of the Couch App frameworks (not for iOS but for your website)
http://techzone.couchbase.com/community/articles/couchdb/recipes
http://www.mail-archive.com/user#couchdb.apache.org/msg13928.html lots of comments on this thread
A+
Dave

Resources