Archive for the ‘Database’ Category

Installing DB2 in Linux

In Database, Fedora, Linux on August 17, 2012 at 9:18 am

here’s the lowdown on setting up a db2 database in your linux box:

1) Download db2 Express from


2) As root, extract the installer:

tar cvf db2_v101_linuxia32_expc.tar.gz

this should create a directory called “expc“.

3) do a ‘cd expc‘ and run the installer “./db2setup“. This will run the installer and ask you to create 3 different types of users, the admin, user and a fenced user.. take note of the names (you can use the defaults) and passwords.  Note that DB2 will create these users in your linux system.

4) After creating the users start the db2 server by  logging in as the db2 administrator (use the administrator username as defined in db2) or do an ‘su db2admin’ assuming db2admin is the admin user.

5) type ‘db2admin start‘.  This should start the db2 instance.

6) To add a new database, log in as the db2 user (you can also do an ‘su db2user1’, assuming db2user1 is the user username just make sure you do a ‘cd ~db2user1’ after as db2 requires the current user to be on a writeable directory).

7) Once you’ve logged on as the db2 user you can now begin creating your database. To create login to the db2 server:

db2 <enter>

this should give you the “db2 =>” prompt.

8) First create the database:

db2=> start database manager
db2=> create database test

db2 => activate database test
db2 => connect to test
db2 => create table employee ( Empno smallint, Name varchar(30),hiredate date)
db2 => select * from employee
db2 => quit

hope this helps.


HeidiSQL alternative for Linux

In Database, FlexOODB, Java, Linux, MySQL on October 30, 2011 at 8:40 am

Aside from Netbeans, an SSH client and a good text editor,  a  good database manager always comes in handy when developing apps.

I’ve been using HeidiSQL  previously to manage my MySQL databases when my laptop was on XP, in its current incarnation as a Fedora 15 development machine, I’ve been hard pressed looking for an alternative, HeidiSQL on Wine is simply unusable.   I had to content myself with MySQL’s WorkBench Tool.   WorkBench is free but I find the interface clunky.

Then I ran into DBeaver, its a Java app that has the familiar interface of HeidiSQL with the added difference that it works across platforms (of course).  Plus, unlike HeidiSQL which can only connect to MySQL (although I understand there’s work in making it work for MS SQL too),  DBeaver can also connect to other popular RDBMS:  Oracle, Cache, DB2, Firebird, Derby, H2, HSQLDB, MS SQL, Postgres, Sybase, SQLite etc.

Here’s a screenshot:

DBeaver Snapshot

DBeaver Console

Here’s a quick how to to install in your Linux box:

  1. Download DBeaver and extract in your drive (e.g. /home/<username>)
  2. Right-Click on an empty spot on your desktop and select ‘Create Launcher’
  3. Type in ‘DBeaver’ (or any name for that matter) click on ‘Browse’ and go to the /home/<username>/dbeaver directory and double click on the dbeaver file.
  4. To replace the default icon, you can click on the icon link of the create launcher window and select the file /home/<username>/dbeaver/icon.xpm. That’s it.

Thanks for a great tool DBeaver Team! =)

Oracle begins commercializing MySQL

In Database, Linux, MySQL on September 19, 2011 at 8:57 am

In early 2010,  I noted that Oracle will only guarantee support to the open source version of MySQL until the end of January 2015 (or 5 years after the end of the transaction — that being the purchase of MySQL).   A year and a half on and  it looks like its well on schedule  recently announcing that they’re now offering ‘commercial extensions‘ to the product.

The implication for this is obvious:  we’re going to see more of these feature sets and ‘improvements’ on the commercial version of MySQL as opposed to the community version as to create enough doubt for corporate users who are a class of their own and who would invariably go for a more expensive solution ‘just to make sure’.  The end result? why use open source mysql when you can buy? the purchase was, afterall,  sweet revenge, as  Oracle is able to effectively  throttle competition from left field.

Purchasing MySQL is a medium term insurance policy, one which will have a maturity date of January 28, 2015.

FlexOODB Prototyping ‘new look’

In Database, FlexOODB, Intigrix, Java on March 1, 2011 at 7:13 pm

Ok I finally found time to work on making major improvements on  FlexOODB’s Intigrix-centric  prototyping tools.  I’m satisfied with the build today as we we’re able to finally fix some nagging interface issues.

Some new notable features:

  1. All child elements are tabbed after the parent (instead of automatically appearing at the bottom of the main element’s data).
  2. All child elements have working scoped (ie within the parent) searches.
  3. Moved menu on top (its used to be on the left which turns out to be a real waste of space).
  4. Added ability to define labels in the user interface config file (ie ui.xml)  to allow better labeling for titles, column names etc.
  5. In relation to 3, added jscript controls for data field entries (e.g. user will be prompted if a required field is empty or email address has the wrong format for example — really nice script ) — this fits nicely with Intigrix’s validation engine acting as a front-end validator.
  6. Extensive use of JQuery for interface controls, UI, themes etc.
  7. Better and more intuitive controls (e.g. multiple deletes for lists, row click to view item etc).

Looking forward to building new projects with this one!

FlexOODB milestone screen snapshots

In Database, FlexOODB, Java on February 5, 2010 at 9:48 am

here’s some snapshots of the generated prototype (all generated screens use AJAX):

Image 1: splashpage

Image 2:  Listing the ‘Account’ records.

Image 3:  Viewing an ‘Account’ (includes export to XML and Printer icons)

Image 4: Child classes of ‘Account’

Image 5: Viewing ‘Account’s child elements ‘Subscriptions’

Major milestone for FlexOODB API

In Database, FlexOODB, Java on February 4, 2010 at 6:19 pm

Whew! just finished the second major milestone of  the (then proof-of-concept) FlexOODB API .

In a nutshell, the motivations  for developing FlexOODB are to a) replace “mainstream” clunky and rigid persistence API’s (no inheritence or abstraction capabilities, can’t extend it, quirky must-be-embedded configuration requirements just to cite some reasons)  b) develop a platform where ‘I-dont-have-to-manually-create-the-tables-for-my-apps!’  and c) provide Rapid Application Development (RAD) utilities for the Intigrix Platform.  My goal is to minimize (if not take out!) the tedious and time consuming user interface<->data and data relationship binding from systems development, doing so will allow developers to focus on the more esoteric requirements of the system. This also means that software is easier to manage and time-to-market is a lot faster.

I’m satisfied with this milestone version: given a Schema (ie XSD) as the system’s data definition, the API can already generate a User Interface definition file (where we can set things like should a field be editable, updateable, auto-increment etc), generate the class entities then finally create the necessary java code, html and application files for CRUD (plus XML exporting and print friendly versions of the data).  The API fully supports and generates the necessary CRUD code for multi-generational (ie parent-child-grandchild…ad infinitum) data structures, at this point though, each generation has to be of different class types — not really an issue for majority of apps.

In practical terms, using the old API, I was able to develop a working prototype (includes user management and authentication) of a personal healthcare system in a week (5 working days).  I expect to improve on this by at least 25% as pages I had to manually make before (e.g. paging of items, child templates etc) are already created by default with this milestone version.

Oracle to end MySQL in 2015?

In Database, Java, Networking on January 30, 2010 at 8:51 am

Finally, Oracle has finalized the purchase of Sun..frankly despite the assurances of Oracle, this whole thing is making me nervous about the future of these two technologies.   Ok so they’ve open sourced Java however Sun (or now Oracle) still has a say on what goes in in the final versions.. some people say that its in the interest of Oracle to continue the development of the Java programming language and its API’s because a big chunk of its middleware is written in Java… what worries me though (and believe me I’m not the worrying type)  is the licensing part and whether Oracle will continue the path of open sourcing Java?  Oracle is not exactly the poster boy of open source.

As for MySQL , according this:


while Oracle will continue to support MySQL in the foreseeable future and even agree to not release a new version of MySQL unless it also releases (in parallel I suppose) the community version.. it will only commit to do so only..

..until the fifth anniversary of the closing of the transaction“.

that closing happened on the 28th of January 2010, therefore it is reasonable to expect that after January 28 2015, Oracle can do whatever it wants with the licensing of MySQL.  My guess is, the strategy is to put some kind of doubt into the future of MySQL making people think twice when choosing between open source (MySQL is the de facto afterall) or getting a commercial alternative.  Companies do not like uncertainty, chances are CFO’s and CTO’s would find this ‘uncertainty factor’ worrying enough to instead buy a commercial DB rather than using OSS.  So nobody can really claim they’re out to kill MySQL (they promised the EU Commission afterall) but in the same breath they say we cant really say for sure what happens after 2015.

Time to explain all of these to my customers. =(