Speed up OpenOffice startup

Posted January 26th, 2010 in tech by Michael

OpenOffice is a really neat office suite which works perfectly fine on the Mac. Unfortunately the startup times are… “not the best”, but here is a little trick of how to improve startup of OpenOffice on Windows, Mac and Linux:

  • Open up the Preferences (Command + ,)
  • Navigate to OpenOffice.org > Java
  • Uncheck the “Use a Java runtime environment”

This will considerably improve the startup time of OpenOffice, while disable i.e. Java based macros. In the very unlikely event that you need them just check the box again…. but until then – enjoy!

iBatis and DB2 INSERT statements

Posted December 1st, 2009 in development by Michael

iBatis for Java is a good way of abstracting away the SQL statements from the business logic; it relies on XML files which contain all SQL statements and it is pretty simple to access a database. Because accessing DB2 from Java is pretty new for me I had some troubles finding a sample to setup a “insert” statement which returns the last inserted ID.
With PHP I’d use my_insert_id(), but how does it work with Java and DB2? Unfortunately all samples I could find where either based on Oracle or on the Microsoft SQL Server…. no luck.

So here is the XML required for an INSERT statement with iBatis on DB2:

<insert id=”insertTABLE” parameterclass=”TABLE”>
INSERT INTO TABLE
(…)
VALUES
(#…#)
<selectkey resultclass=”int” keyproperty=”id”>
SELECT IDENTITY_VAL_LOCAL() as ID FROM SYSIBM.SYSDUMMY1
</selectkey>
</insert>

After that the insert statement can be used like follows:

TABLE_BEAN table_bean = new table_bean();
table_bean.setXXX(…);
mySqlMapClient.insert(“insertTABLE”, table_bean);
// now table_bean.getId() returns the correct id

From now on iBatis works like a charm and the object value is automatically updated… nice!

“Could not find symbol” made me crazy today

Posted December 2nd, 2008 in development by Michael

My EAR package worked fine, until tonight during the deployment to another server infrastructure. How hard can a simple EAR update be? “Could not find symbol” somewhere next to a simple line initializing log4j. It complained about missing the Logger class.
A check in the EAR file revealed that the required jar files are all there. Still this error. But why?

Finally I figured out that the manifest file included all of the required libraries in the classpath but missed the “.” to include the current directory as well, after adding it everything worked out:

Class-Path: log4j.jar lib.jar .

Took some time to perform a simple upgrade of an existing EAR file… because of such a simple error – so ensure your MANIFEST.MF file contains the dot!