Rebirth of T-rex

Does dinosaur really extinct? What caused the dinosaur to vanish? Have you ever wonder whether the real 'you' is disappearing and slowly vanishing? Hope that through this blog, we will be able to maintain the real self.

Hypersonic SQL

Posted by T-rex Lim Huat Heng

While I was researching on Object Relational (O/R) Mapping using Hibernate (an open source tool that provide OR persistence and query service), I managed to come across and used Hypersonic SQL (aka HSQL database engine, also an open source product). I found that it's a really useful, lightweight database suitable for small scale application/system. Thus, I would like to share with you all over here.

You can download it via http://hsqldb.sourceforge.net. If you are going to obtain the latest stable version (1.7.3), as what I am using, it's about 2.70MB in size. Once download process is completed, you can start using it by extracting the zip file with WinZip or Windows XP built in archive extractor. Let's assume it's extracted to drive C:\ and thus we refer C:\hsqldb as HSQL_HOME.

You would have to install Java Runtime Environment (JRE) 1.4.2 in order to proceed in using HSQL. I would recommend you download Java Development Kit (JDK, aka J2SE SDK) 1.4.2 as you may use it for Java file compilation later. Select Download J2SE SDK link from http://java.sun.com/j2se/1.4.2/download.html page. Install the JDK, let's assume it's installed at C:\j2sdk1.4.2, again herewith, we refer to this folder as JAVA_HOME.

It is recommended that you add JAVA_HOME/bin into the environment variable 'PATH'. If you are using Windows XP, you can easily do this by right click on My Computer icon and select Properties from the pop-up menu, then select Advance tab and click Environment Variables button. Locate the variable 'PATH' (by left click on the entry) from the System Variables list and click Edit button.Input ';C:\j2sdk1.4.2\bin' (the semicolon is used as delimiter to seperate different values) at the end of content of Variable Value.Then apply the changes.

Once the basic setup is ready, you can start the database server by using the following statement in your command prompt.

java -cp hsqldb.jar org.hsqldb.Server

You can then use the Database Manager (a GUI tool) to manipulate the database, by using the following statement in the command prompt.

java -cp hsqldb.jar org.hsqldb.util.DatabaseManager

When the Database Manager is launched, you can click Ok button on the Connect window, using the default preset values to start playing around with the database.

If you would like to find out more, you can refer to some guide in HSQL_HOME\doc\guide folder.

Hope you enjoy trying it. Probably we can try out other open source databases such as Cloudscape, MySQL, even OneDollarDB (yes, there is such database; I was quite surprise to come across this name :)) besides the more powerful ones, eg Oracle, Sql Server and DB2.

4 comments:

Anonymous said...

wow! that's great! i can learn many stuff from ko ko dy. very happy of it! : )

T-rex Lim Huat Heng said...

Really glad that you appreciate the posting. I hope to be able to post more such introductory writing to share my knowledge.

Unknown said...

hey! i remember this! we were using Alicebot for the fyp back in mmu, and she was using this database to store its 'knowledgebase'!

meanwhile, you might wanna check out Hibernate.org ...this is what we use not for O/R mapping... its verry gooooood!

T-rex Lim Huat Heng said...

Tanim, thanks for visiting the blog. Anyway, do you mean that since FYP Hibernate already exists and were used to serve as the knowledge base? How was it being done? Is that how Alicebot is being implemented?