Create a Sparksee database

Now that we have the set up complete and we have started coding, let's create our first database. In this chapter we are going to create a simple database containing information about certain movies, their actors and directors.

The first thing you should do is to create a SparkseeConfig object to establish the Sparksee main settings. That object will be created using the global SparkseeProperties settings (initially loaded from a sparksee.cfg file). You do not have to change any setting directly here, but its creation is a must before creating the Sparksee object.

If you have a commercial license and you have not yet used it in the configuration file, you may set the license in the SparkseeConfig using the setLicense method.

The newly created SparkseeConfig object will be used to create a Sparksee object. Once you have created this object, you can create your databases.

A new database needs a file path (HelloSparksee.gdb) and we can give it a name (HelloSparksee). This database file is where all the persistent information will be stored.

[Java]
SparkseeConfig cfg = new SparkseeConfig();
// The setLicense method is only performed if you have a license key and 
// have not activated yet it using the configuration file (sparksee.cfg)
cfg.setLicense("Your license key");
Sparksee sparksee = new Sparksee(cfg);
Database db = sparksee.create("HelloSparksee.gdb", "HelloSparksee");
[C#]
SparkseeConfig cfg = new SparkseeConfig();
// The setLicense method is only performed if you have a license key and 
// have not activated yet it using the configuration file (sparksee.cfg)
cfg.SetLicense("Your license key"); 
Sparksee sparksee = new Sparksee(cfg);
Database db = sparksee.Create("HelloSparksee.gdb", "HelloSparksee");
[C++]
SparkseeConfig cfg;
// The setLicense method is only performed if you have a license key and 
// have not activated yet it using the configuration file (sparksee.cfg)
cfg.SetLicense("Your license key"); 
Sparksee *sparksee = new Sparksee(cfg);
Database *db = sparksee->Create(L"HelloSparksee.gdb", L"HelloSparksee");
[Python]
cfg.SparkseeConfig()
# The setLicense method is only performed if you have a license key and 
# have not activated yet it using the configuration file (sparksee.cfg)
cfg.set_license("Your license key"); 
sparks = sparksee.Sparksee(cfg)
db = sparks.create("Hellosparksee.gdb", "HelloSparksee")
Back to Index