LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-02-2010, 01:32 AM   #1
gregarion
Member
 
Registered: Jan 2010
Posts: 69

Rep: Reputation: 15
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
 
Old 02-02-2010, 04:05 AM   #2
carbonfiber
Member
 
Registered: Sep 2009
Location: Sparta
Posts: 237

Rep: Reputation: 46
What do you mean by "link the database to your project"? Did you read the sqlite documentation?
 
Old 02-02-2010, 04:09 AM   #3
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
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

Last edited by Alien_Hominid; 02-02-2010 at 04:13 AM.
 
Old 02-02-2010, 04:23 AM   #4
gregarion
Member
 
Registered: Jan 2010
Posts: 69

Original Poster
Rep: Reputation: 15
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?
 
Old 02-02-2010, 04:24 AM   #5
gregarion
Member
 
Registered: Jan 2010
Posts: 69

Original Poster
Rep: Reputation: 15
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?
 
Old 02-02-2010, 09:59 AM   #6
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Did you install sqlite developer files at the first place?

#include <sqlite3.h>
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DBI Connect Failed:Access denied for user ''@'localhost' to database <database> error kaplan71 Linux - Software 3 06-05-2009 12:39 PM
(my)sql: drop database doesn't remove database kpachopoulos Programming 3 09-19-2007 01:32 PM
Database Programming (database to database transaction) johncsl82 Programming 7 02-02-2007 08:20 AM
LXer: A database solution is more than database software LXer Syndicated Linux News 0 09-25-2006 08:54 AM
Problem in using both load time linking and runtime linking durgaprasad_j Linux - General 0 08-01-2006 03:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration