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

Where is the database?

Last post 08-30-2008, 09:36 AM by German Viscuso. 8 replies.
Sort Posts: Previous Next
  •  07-04-2008, 07:07 PM 49999

    Where is the database?

    Hi, i'm sorry, maybe this is a stupid question.. but.. where is the database? i don't understand.. is a file, is a database on a database server.. where? how i can design my tables, and where i store it data? in the documentation i see line of code like

    IObjectContainer db = Db4oFactory.OpenFile(Util.YapFileName);

    but intellisense (i use .net) of visual studio tell me on method OpenFile() "string database file name"
    ?? what ?? database file name? which database? i've not created it..
    can me explain where is the database? and what mean db40 for "database file" ?

    thanx and excuse my english ;)
  •  07-04-2008, 10:55 PM 50000 in reply to 49999

    Re: Where is the database?

    Please check this small definition of Object Database Models, the database is the file (that's the meaning of database file) you create in the open file or openserver, if not exists the first time the file will be created.
    You don't have to design tables, this is an Object Oriented Database, you will work with object.

    Take a look in the documentation, or navigate in the site, you will find documentation to clear your ideas.

    http://www.db4o.com/about/productinformation/db4o/

    http://www.service-architecture.com/object-oriented-databases/articles/odbms_faq.html

    http://en.wikipedia.org/wiki/Object_database


    salu2 desde Ecuador
    Gisbert Avellan
  •  07-05-2008, 09:39 AM 50004 in reply to 50000

    Re: Where is the database?

    ok i understand, thanx
  •  07-05-2008, 09:50 AM 50005 in reply to 50000

    Re: Where is the database?

    one moment, but what is my database file name? i can't retrieve information about.. for example i see much document that open file line "database.yap" but what is yap extension? i've tested a query with a file named "mydata.data" and it run normally.. then what a database name i should use? thanx again
  •  07-05-2008, 06:52 PM 50010 in reply to 50005

    Re: Where is the database?

    Salut,

    I had the same problem as you but iI found this : http://code.google.com/p/db4o-groovy/

    I hope that will be useful for you.


  •  07-05-2008, 07:27 PM 50011 in reply to 50010

    Re: Where is the database?

     I had to work with  the yap database file when I was working with eclipse db4o plugin.

    To learn more how to  create and use this yap file get visit to these 2 web sites:

    1-http: //www.theserverside.com/tt/articles/article.tss?l=Insidedb4o

    2- http://klevesaat.blogspot.com/2008/06/groovy-and-db4o.html

    I'm interested to any documentation you find .

                                       

     

  •  08-29-2008, 06:10 PM 50835 in reply to 49999

    Re: Where is the database?

    Your question is not stupid at all. I am trying to figure the same thing out. What am I missing. The wonderful "First Steps" help page simply shows the use of a utility class that returns a database file. Please - a little help for those of us who are trying to read the help file.
  •  08-29-2008, 07:52 PM 50837 in reply to 50835

    Re: Where is the database?

    I think the line in the first steps tutorial which is causing you confusion is below.

    ObjectContainer db=Db4o.openFile(Util.DB4OFILENAME);

    Just replace the call to Util.DB40FILENAME with an actual filename, for example Db4o.openFile("MyDatabase.yap").  Then as it says in the tutorial Db4o will look for this file in the current directory and if it does not find it, Db4o will create it.  All your objects are then stored in this file i.e. this file is your database.  Its that simple!

    Good luck and enjoy.
    Graham

  •  08-30-2008, 09:36 AM 50843 in reply to 50835

    Re: Where is the database?

    smann004:
    Your question is not stupid at all. I am trying to figure the same thing out. What am I missing. The wonderful "First Steps" help page simply shows the use of a utility class that returns a database file. Please - a little help for those of us who are trying to read the help file.

    You can use whatever filename and extension you want (it can be .yap or .data, whatever you prefer). The yap extension is just a convention. This file will be your database and contain your objects (for practical purposes, on the API side, an ObjectContainer operates on this file and will represent your database). Later you could for example use ObjectManager to open the file and see/query your objects.

    When you open the db, the file will be created if it doesn't exist or it'll be opened if it's already there.

    Best.


    German Viscuso ยป db4objects
    W: +1 (650) 515-3615
    F: +1 (650) 240-0421
    M: +1 (650) 863-5474
View as RSS news feed in XML