I'm in the process of creating a small web site. Mainly for my own amusement.
I'm developing in Java, using JSP's and Servlets. The theme of the web site will be Java Technologies in general, with a focus on web development using Java.
As a back-end database I will be using HSQLDB. It's a small database writting 100% in Java.
I will now describe how I got HSQLDB working.
I'll asume that you have knowledge of Java and SQL, and a Java Development Kit and a servlet container installed. I'm currently using Sun's JDK 1.4.2 and Apache Jakarta Tomcat 5.0.28. Furthermore I'm using Gentoo Linux, so if you're using Windows a few changes are required (I'll try to note them, as I go along).
Start by downloading the latest realease, from SourceForge. The file to look for is called hsqldb_1_7_3_1.zip (posibly with a higher version number).
Unzip the archive. I have all my java related files below one common directory, /usr/java/ (c:\Java\ on Windows).
You now have a directory called hsqldb containing all files related to the database. I like to rename this directory to include the version number, e.g. hsqldb-1.7.3.1.
You should add hsqldb-1.7.3.1/lib/hsqldb.jar to you class path. Also you should copy it to your $CATALINA_HOME/common/lib and restart tomcat. You are now ready to compile/run Java-programs using hsqldb.
Run the manager: hsqldb-1.7.3.1/demo/runManager.sh (on Windows use runManager.bat). Enter the following:
Now create a table and put some data into it (click Execute-button after copying the following to the text field):
The first four lines are standard SQL. The final line is HSQLDB specific.
You can test that it worked, by executing this:
Exit the manager.
You now have four files in /path/to/your/app called demobase.log, demobase.properties and demobase.script (and if you didn't exit the manager, you'll also have a demobase.lck file). These three files describe your database, and can be copied to say a tomcat server.
This is the end of this part. The next part will show you how to write Java programs and servlets using the database.
I'm developing in Java, using JSP's and Servlets. The theme of the web site will be Java Technologies in general, with a focus on web development using Java.
As a back-end database I will be using HSQLDB. It's a small database writting 100% in Java.
I will now describe how I got HSQLDB working.
I'll asume that you have knowledge of Java and SQL, and a Java Development Kit and a servlet container installed. I'm currently using Sun's JDK 1.4.2 and Apache Jakarta Tomcat 5.0.28. Furthermore I'm using Gentoo Linux, so if you're using Windows a few changes are required (I'll try to note them, as I go along).
Start by downloading the latest realease, from SourceForge. The file to look for is called hsqldb_1_7_3_1.zip (posibly with a higher version number).
Unzip the archive. I have all my java related files below one common directory, /usr/java/ (c:\Java\ on Windows).
You now have a directory called hsqldb containing all files related to the database. I like to rename this directory to include the version number, e.g. hsqldb-1.7.3.1.
You should add hsqldb-1.7.3.1/lib/hsqldb.jar to you class path. Also you should copy it to your $CATALINA_HOME/common/lib and restart tomcat. You are now ready to compile/run Java-programs using hsqldb.
Run the manager: hsqldb-1.7.3.1/demo/runManager.sh (on Windows use runManager.bat). Enter the following:
Type: HSQL Database Engine Standalone
Driver: org.hsqldb.jdbcDriver
URL: jdbc:hsqldb:file:/path/to/your/app/demobase
Now create a table and put some data into it (click Execute-button after copying the following to the text field):
CREATE TABLE Bookmarks (title VARCHAR(50), url VARCHAR(255));
INSERT INTO Bookmarks (title, url) VALUES ('Java Technology', 'http://java.sun.com/');
INSERT INTO Bookmarks (title, url) VALUES ('HSQLDB 100% Java Database', 'http://hsqldb.sourceforge.net/');
INSERT INTO Bookmarks (title, url) VALUES ('Apache Jakarta Tomcat', 'http://jakarta.apache.org/tomcat/' );
CHECKPOINT
The first four lines are standard SQL. The final line is HSQLDB specific.
You can test that it worked, by executing this:
SELECT * FROM Bookmarks ORDER BY title;Exit the manager.
You now have four files in /path/to/your/app called demobase.log, demobase.properties and demobase.script (and if you didn't exit the manager, you'll also have a demobase.lck file). These three files describe your database, and can be copied to say a tomcat server.
This is the end of this part. The next part will show you how to write Java programs and servlets using the database.
- Current Mood:geeky

Comments
You are absolutely right!
Do you know where can I find a demo for how to load a text table using hsqldb?
Thanks.
is extremely useful and essential for me!With the best regards!
Frank
Very happy Mood = now mood :D
Признавсйтесьпроказники и валадельыц сайта slu.livejournal.com ))))
ЧТО вы будете делать этим летом?!
Good site ! ;)
it works.
a good simple, working example is worth some books.
thanks
I m using hsqldb 1.8.0.7 version. This version works fine bt sometimes i encounter the problem.
The problem is i have some data in the log file and whenever i m trying to start the server the data is not getting transfered in the script file as well as it is getting deleted from the log file.
Can anyone guide me for the solution of the above problem.
I m using hsqldb 1.8.0.7 version. This version works fine bt sometimes i encounter the problem.
The problem is i have some data in the log file and whenever i m trying to start the server the data is not getting transfered in the script file as well as it is getting deleted from the log file.
Can anyone guide me for the solution of the above problem.
I'm so need this magic program! It's can break captchas automatically! Activate accounts via email automatically too! Absolutely great software! Help me!
And did you hear news - price for XRumer 5.0 Palladium will grow up to $540 after 15 may 2009... And XRumer 2.9 and 3.0 - too old versions, it's cant break modern catpchas and cant break modern anti-bot protections. But XRumer 5.0 Palladium CAN!!!!
So help me for download this great program for free! Thanks!