Showing posts with label solution. Show all posts
Showing posts with label solution. Show all posts

Tuesday, December 9, 2008

How to run a stand alone HSQLDB database as a service

HSQLDB database is an open source database fully written in Java. It's light weight and supports wide range of SQL standard. As I already mentioned it's fully written in Java and it can run standalone or within your Java application.

So you can embed it in your own application as a library. All you need is to include hsqldb.jar (593KB) file in your libs folder.

Also it's a great database to use while working on your project. You can add it as a target in your Ant build or in Maven.

Anyway, it's a great tool to have in your "Web Developers Toolkit". Back to the point. I needed it to run continuously in the background since my IDE reads data from it to make my life easier. So this is what you need to run in your console to run HSQLDB in the background:

java -classpath /path/to/hsqldb.jar org.hsqldb.Server

To stop the service press CTRL+C.

Friday, December 5, 2008

How to insert colorized code to any blog including Blogger, code to html converter

I recently started blogging about my experience with bloated, messy and mainly standards based programming language - Java. So I needed a way to paste my Java, XML and other programming language codes in more readable and colored way. So after a little research I found an online HTML generator. You can paste your code and it will generate colored version of your code in HTML. Than you can switch to HTML version in your editor paste the code and wua la:

package messy.java;
public class SomeClass {
private static final Integer myVar;
static {
try {
// Some comment
myVar = new Integer();
} catch (Throwable ex) {
System.err.println("Error:" + ex);
throw new ExceptionInInitializerError(ex);
}
}
}

If you are using Windows Live Writer to post your entries, than you are lucky, there is a plugin for you and for those who does not there is a stand alone version as well.

Happy blogging :)

Thursday, December 4, 2008

Access to restricted URI denied" code: "1012

I was working on the interface for our catalogue/directory structure. We use great JavaScript library jQuery and I came up to this problem:

Access to restricted URI denied" code: "1012
xhr.open(type, s.url, s.async);

(This error is produced in Firebug, plug-in for Firefox.)

The error occurs when it tries to do an AJAX request call to local resource. So to solve this problem you need to deploy your files to your web server or run one locally.