Add support for importing tables from LibreOffice Base to Kexi

I am working under KDE community and my GSoC project is Add support for importing tables from LibreOffice Base to Kexi. My mentor for this project is Kexi maintainer and developer Jaroslaw Staniek. Here is the brief overview about this project and my current status in this project.

Project description

Kexi is an open source visual database creator. In kexi we can create database applications and perform queries. It also provides functionality to import database from other database sources. Currently kexi needs to add support to import database tables from odb files generated by LibreOffice Base. It is very important to have this functionality for kexi as more and more open source users are shifting to kexi. So, my task is to enable database migration from LibreOffice Base to Kexi.

Project details

My agenda is to implement classes which will enable database migration from .odb format to kexi. The main thing to note here is .odb format stores data in HSQLDB database format. There is not any functionality available to read hsqldb files from cpp code of Kexi and then migrate to kexi database. So, I have to use JDBC driver provided by HSQLDB project, that can be used in Java code.After that I am using Java Native Interface (JNI) to get database data and structure in cpp code.  I have implemented a java class which will read the data from the .odb format and have to call my java methods from my C++ program using JNI. The java program consists of database connection method to connect to HSQLDB. A little idea about how I connect to  HSQLDB:

public void connectDatabase()
{
Connection con;
con = DriverManager.getConnection( “jdbc:hsqldb:file:”+ path to directory+file name,”SA”,  “” );
}

I call this driver connection method from my C++ code. For example,

bool odbMigrate::drv_connect()
{
JNIEnv *env;
jclass clss = env->FindClass(<class_name>);
jmethodID method = env->GetMethodID(clss, “<init>”, “()V”);
jobject object = env->NewObject(clss, method);
method = env->GetMethodID(clsH, “connectDatabase”, “()V”);
env->CallVoidMethod(object,method,NULL);
}

However,  we have to set lots of things to implement JNI. But this was a little overview about how we can make an object and call the method of Java class from cpp code.

This task is little bit complex as we have to set environment variables, link libraries to compile Java as well as C++ files. I have compiled my code independently and it is running successfully. So, right now I am working on settings these things in cmake files to compile with the whole kexi project.

I have added .desktop file, through which migration driver will loop up all the drivers and gives options of the import table types. It is successfully giving .odb option in the drop down menu.

odb

Diving into FOSS

Hello, I am Harshita Mistry and blogging for the very first time in my life. Well, I am not a professional  blogger so I will keep this article informal :)

A little about me

I am a first year Computer Systems Technology student from Sheridan College, Toronto .  Being a computer student it is necessary to have very good understanding of codes  which I think I posses.  I really love to read blog posts and get inspired about programming and stuff.  At first when I was new to programming I was horrified by it because I didn’t know the fundamentals of it , at some point of time I even thought that I am doing wrong with my life by taking computer stream as my career. But later my friend made me realise that how good programmer I can be. As per his suggestions and guidance I tinkered over my coding fundamentals and  gave a fresh start to my programming knowledge from the base. Then later on I started taking an interest in programming and now it’s like fun to me.

 

KDE Community

Before sometime I got in touch with KDE community and was overwhelmed by it. Then I became a member of this community and started exploring about open source environment. The most fascinating thing about KDE community members is how committed they are to open source technology. Through IRC I would be able to contact with genius coders all over the globe. It’s been quite a time that I am using open source software. It is very much important to aware people about open source. We can have access to all robust and efficient soft wares for free. After being a part of KDE it interested me to use open source systems and I am really enjoying this.

 

Google Summer of Code

After being part of KDE I got regular mails from this community about events, seminars etc.  Then I got informed about GSoC from KDE that registrations for this program has been started. At first I wasn’t sure that whether or not I should apply but under guidance of some really awesome people I started working on my proposal.  I started reading over some proposals in which I had to pick one. Then I decided to work on Add support for importing tables from LibreOffice Base to Kexi. This project interested me and then I connected with my mentor Jaroslaw Staniek, who guided me about this project and gave regular responses to my queries. He has been giving staunch support to me from the very first day when I decided to work for Kexi. I am experiencing great things in GSoC like project management, code testing , bug solving , github and counting. In my project I have to work in Qt in which I have never worked before. However, now I have started understanding Qt and  and many things related to this project like JNI. Moreover I am fining my communication skills as well, by sending and receiving regular emails from calligra develpment community. Everybody are very much helpful and I can discuss my queries, bugs and many other things related to the project. On the top of all these project management is a very crucial to work on any project which is the huge perk that I get from GSoC. All of these things are going to be very much helpful for my future career. I am going to share my further experiences and progress  about my GSoC project  on my upcoming blogs.  Cheers ! :)