• Advertisement
Sign in to follow this  

Database tutorial?

This topic is 2249 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I really have had no experience what so ever with databases, neither setting them up or using them. I was wondering if someone could point me into the right direction for a tutorial that would allow me to create a database and then access it and query it from C++.

There seems to be quite the array of C++ sql libraries.

Am I right in thinking that I could just use the current machine as the database server?

Share this post


Link to post
Share on other sites
Advertisement

I really have had no experience what so ever with databases, neither setting them up or using them. I was wondering if someone could point me into the right direction for a tutorial that would allow me to create a database and then access it and query it from C++.

There seems to be quite the array of C++ sql libraries.

Am I right in thinking that I could just use the current machine as the database server?

I'm not sure about C++, but I used C# .NET and it was simple enough - even without any specific tutorial's. What programming environment are you using?


Share this post


Link to post
Share on other sites
You should to know what DBMS you want to use.

For me, SQlite works just fine, cause it has a simple API and is very lightweight.

Just take a look at http://www.sqlite.org/quickstart.html
There is also a C style example.

Using your current machine as "database server" for SQlite (it's just a file) is the easiest thing you can do, everything else will require extra setup.

Share this post


Link to post
Share on other sites
Im using Microsoft SQL Server R2 Express atm with Sqlapi so I can access the data from C++. Any ideas what API you're supposed to use with Microsoft SQL server? I know theres many third party ones, but what is the Microsoft one?

Share this post


Link to post
Share on other sites

You should to know what DBMS you want to use.

For me, SQlite works just fine, cause it has a simple API and is very lightweight.

Just take a look at http://www.sqlite.org/quickstart.html
There is also a C style example.

Using your current machine as "database server" for SQlite (it's just a file) is the easiest thing you can do, everything else will require extra setup.


Go download the "Microsoft ODBC 3.0 Software Development Kit and Programmer's Reference" that will give you what you need.

Now how complicated is this database? There is a lot more that does into making a good database then people think.

theTroll

Share this post


Link to post
Share on other sites
SOCI is easy enough and actively maintained:
http://soci.sourceforge.net/
http://soci.sourceforge.net/doc/

DbiXX is an alternative:
http://art-blog.no-ip.info/wikipp/en/page/ref_dbixx

Share this post


Link to post
Share on other sites

I really have had no experience what so ever with databases, neither setting them up or using them. I was wondering if someone could point me into the right direction for a tutorial that would allow me to create a database and then access it and query it from C++.

There seems to be quite the array of C++ sql libraries.

Am I right in thinking that I could just use the current machine as the database server?


If you're completely new to databases, I recommend this: http://sql.learncodethehardway.org/book/ It looks like the book isn't quite complete, but it should at least serve as a good intro. Personally, I've found Zed Shaw's books to be very practical and helpful.

This doesn't cover using a DB in C++, but you need to learn how to use them first.

In what capacity are you going to be using a database? Does the database need to serve multiple client machines, or this is simply going to be used on the local machine as storage for your game? If the latter, go with SQLite.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement