Results 1 to 5 of 5

Thread: Creating a database

  1. #1
    Join Date
    May 2011
    Beans
    273

    Creating a database

    Hi everyone!

    Most of the programming I do is related to storing and reading information. Usually I do it in C, where I store the information in a text file, then read it. But for a bit bigger database that isn't the easiest way.

    My question is: Which languages should I use so I can handle reading and writing to some kind of a database?

    But don't get me wrong. I don't want something like SQL, I want some language like C, Python or Java that will export my data to a db and then will be able to read it.

    I already tried Common Lisp, which has a great system for handling database, but Lisp itself is what I don't like.

    I'm aware of SQL bindings for C, they are great, but I need a program that will create its own database (it can be of any kind as long as it can be read by a program in a SQL kind of way).

    To make this shorter: I'm looking for a programming language or some library that will be able to create a database, read it, and write to it, and edit its entries without too much complication.
    Your left hand is touching your face.

  2. #2
    Join Date
    Sep 2006
    Location
    BC, Canada
    Beans
    347
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Creating a database

    SQLite3 is my favourite DB library. Single file database with SQL syntax. It is not a client/server system like MySQL or PostgreSQL. It has a VERY permissive license. Short of that, BerkeleyDB maybe? It's non-relational but gets the job done if you don't need dynamic SQL queries.

  3. #3
    Join Date
    Jul 2008
    Location
    England
    Beans
    866

    Re: Creating a database

    I did a Java/Db course last year where we edited a database using Java.

    Using the Java Persistance you are able to create "entity classes" which map to rows in your database tables. You create a class which has member variables that matching attributes from your table and provide annotations for each of these variables so that Java knows how to map them.

    You are then able to use a EntityManager to add/remove rows (instances of your entity class) to your table.

    I like this since it allows you to use databases in a more object oriented way.

    Paul

    EDIT: Here is a link to an example: http://glassfish.java.net/javaee5/pe...e-example.html
    EDIT 2: I think it was Derby DB that I was using for this.
    Last edited by PaulM1985; June 20th, 2011 at 04:13 PM.

  4. #4
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Creating a database

    SQLite3 is probably your best bet. Has many language bindings including C and Python. It's fast, easy to use, commonly used by many, many current applications on Linux and Windows. It's a good choice and there are tools to create/alter the db files outside your own application too. Since it's well known it's easy to find support and example code.

  5. #5
    Join Date
    May 2011
    Beans
    273

    Re: Creating a database

    SQLite was exactly what I was looking for Thanks!!
    Your left hand is touching your face.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •