LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Database Linking (https://www.linuxquestions.org/questions/programming-9/database-linking-786359/)

gregarion 02-02-2010 01:32 AM

Database Linking
 
Hey guys, I am currently working on a project using c++ in netbeans. All along i been using a text file as my database but now i would like to try using a database.

One problem i am having is i do not get how i can connect my database to my project. i read up on sqlite and if im right, i am able to create a database using it, but how do i link it to my project?

Another questions is, am i able to write my statements in netbeans once the database has been linked? the reason is because i need it to store certain information which the user will input into?

Hope for some help in this area

carbonfiber 02-02-2010 04:05 AM

What do you mean by "link the database to your project"? Did you read the sqlite documentation?

Alien_Hominid 02-02-2010 04:09 AM

When compiling you need to compile both your project cpp files and sqlite3.c if you're linking statically.
Basically, you need to use these:
Code:

sqlite3_open
sqlite3_prepare_v2
sqlite3_step
sqlite3_finalize
sqlite3_close


gregarion 02-02-2010 04:23 AM

SOrry, what i meant is. i installed sqlite3 in linux already. the issue is , #include<sqlite3> cannot be found. how do i go about adding it to the library?

gregarion 02-02-2010 04:24 AM

okay, but how bout about the library? i installed sqlite3 into linux. but netbeans cant seem to find the library #include<sqlite3>. how do i add this into the database?

Alien_Hominid 02-02-2010 09:59 AM

Did you install sqlite developer files at the first place?

#include <sqlite3.h>


All times are GMT -5. The time now is 12:47 AM.