db4o Developer Community

db4o open source object database, native to Java and .NET
Welcome to db4o Developer Community Sign in | Join
in Search
More Search Options

Getting Started

Last post 09-08-2008, 03:43 PM by merrows. 5 replies.
Sort Posts: Previous Next
  •  08-26-2008, 06:27 PM 50775

    Getting Started

    I just downloaded the msi and zip versions for .NET 2. I expected a way to open up an interface similar to MS ACCESS or Enterprise Manager (from Microsoft) but I cannot find anything. I want to store C# objects (eg Uri) into a database, and a c# forum suggested db4o.

    Once installed, should I get a Program entry from START in Windows for db4o which opens up the actual interface? For me that entry is just the tutorial. I am using db4o 7.2.

    I can see after some more reading how the db4o database could be built into a C# Project, but before I would need to create the database. Is that done by self writing some C# classes or is there an application interface from db4o for that?

  •  08-26-2008, 08:17 PM 50777 in reply to 50775

    Re: Getting Started

    Hi!

    And welcome to db4o. First off you should realize db4o is not (yet!) a DBMS so do not expect much management interfaces built in the core. You can download Object Manager from the download page which is quite close to what you are looking for.

    The important think to realize is that db4o offers you a break from having to build a database, create table schema's, build indexes etc. For simple or test projects you can build your application without the need to think about the database layer. The tutorial is a great way to see how this is done. In essence you can follow these steps:

    1. Create your business objects classes
    2. Instantiate your business objects
    3. Open a database using Db4oFactory.OpenFile method.
    4. Persist your business objects using IObjectContainer.Set method.
    5. Don't forget to call IObjectContainer.Commit()

    You now have your business objects stored in a database. Next you can

    1. Open a database using Db4oFactory.OpenFile method (use same file as in previous steps).
    2. Query and retrieve your business objects using IObjectContainer.Get or Query methods.

    Goran 

     

  •  08-27-2008, 05:50 AM 50780 in reply to 50777

    Re: Getting Started

    The community version of Object Manager can be downloaded from here:

    http://code.google.com/p/db4o-om/downloads/list

    Best.


    German Viscuso » db4objects
    W: +1 (650) 515-3615 (US)
    W: +34 (911) 284-270 (Spain)
    F: +1 (650) 240-0421 (US)
    M: +34 (605) 201-494 (Spain)
  •  09-06-2008, 12:08 PM 50937 in reply to 50777

    Re: Getting Started

    I just got a book from Amazon about db4o and I entered the first example as follows:

    ObjectContainer db = Db4o.OpenFile("customer.yap");

    db.Set (cust);

    But my .NET 2 system would not compile listing errors in the ObjectContainer class (not defined). I assume we need to import something. I assume also the customer.yap database is automatically created by the OpenFile method when the db does not exist.

    Do you have any idea what import is needed in .Net?

    The book has a lot of material (Definitive Guide to db4o), but I need to get the environment working. I did look at the tutorial but it seems to assume the ObjectContainer will work as above.

  •  09-08-2008, 12:02 AM 50958 in reply to 50937

    Re: Getting Started

    Hi.

    Have you checked this page?

    http://developer.db4o.com/Resources/view.aspx/Reference/Getting_Started

    Best!


    German Viscuso » db4objects
    W: +1 (650) 515-3615 (US)
    W: +34 (911) 284-270 (Spain)
    F: +1 (650) 240-0421 (US)
    M: +34 (605) 201-494 (Spain)
  •  09-08-2008, 03:43 PM 50978 in reply to 50958

    Re: Getting Started

    Got it working now. I am trying now to get the Obj Manger working. I am inserting the data OK but it seems hard then to find out what data has been inserted.

    I think db4o needs more screens to help look into the database outside a program. Also it cannot apparently handle an array as an object. It looks like arrays are handled as array elements and treated as objects in that sense. At least when I used Links[] in .NET it did not seem to work for db4o.

     

     

View as RSS news feed in XML