Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
vingilot
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind
Accepted Solution

Sql database, help getting started

looking to setup my first sql database for an app and was wondering a couple things. I know many of the sample apps show this process in detail and I will use them but I was additionally wondering how to create the database? The sample apps contain a .db file, which I know is for the database but is it created within the app? Or separately and can I just name it .db like with qml's or is there a more advanced creation process? Any documentation or personal experience with this would be welcome and appreciated.

Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: Sql database, help getting started

View qt documentation :

Http://qt-project.org/doc/qt-4.8/qtsql.html

 

I worked in qt project to access and create SqlLite db, and yes, you can create db on the fly.

 

Hope this help you.

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: Sql database, help getting started

More especific link :

 

Http://qt-project.org/doc/qt-4.8/qsqldatabase.html

 

Click on "More" link

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
Developer
vingilot
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind

Re: Sql database, help getting started

I keep getting errors with any of the SQL api, such as: 

 

undefined reference to `bb::data::smileyfrustrated:qlConnection::smileyfrustrated:qlConnection(QString const&, QString const&, QObject*)'

 

and 

 

undefined reference to `bb::data::AsyncDataAccess::isRunning()'

 

I am not sure what I am missing, I have included this to begin:

 

#include <bb/data/DataAccessReply>
#include <bb/data/SqlConnection>
#include <bb/data/SqlDataAccess>

using namespace bb::cascades;

 

as well as my header file, is there something else necessary? Even the sample apps for sql are not working, though I just copied their assets and source folders instead of importing them fully, could I have missed something outside of these files?

Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: Sql database, help getting started

I seriously recommend you Qt classes for Sql management.  It works. 

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
Developer
vingilot
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind

Re: Sql database, help getting started

oh I was just basing it off of the samples, if the qt is more efficient I will read further. I just appreciated having a template like in provided samples. The emoticons were based off of :smileyfrustrated: for the ::smileyfrustrated:ql, an odd accident. So I'll really read up on using the Qt classes, I assume many of the principles would be the same as I have already seen. Have you worked with the new sql management at all? Or do you just find it not as useful as Qt?

Please use plain text.
Developer
vingilot
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind

Re: Sql database, help getting started

While I will continue investigating your method, the original problem has been rectified, my .pro file was missing the correct library.

Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: Sql database, help getting started

Qt works very very very well. Don't know the "blackberry method"

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.