October 12th, 2006
A quite unusual configuration but this short guidance might be useful for some persons (like me):
- Open Integrated Solution Console
- Navigate to “Resources -> JDBC -> JDBC Providers”
- Select the right scope for your application
- Click “New”
- Select “User-defined” from “Database Type” dropdown
- Insert “org.postgresql.ds.PGConnectionPoolDataSource” at “Implementation class name” field
- Provide a name and a descriotion of your choice and click “next”
- If you haven’t done so before download the JDBC Driver from http://jdbc.postgresql.org/download.html which suits your needs (should be JDBC3 driver for your DB version) and save it at some local library path (e.g. {WAS_HOME}/lib)
- Insert the path and jar file name in the next dialog, click “next” and “finish” afterwards
- Navigate to “Resources -> JDBC -> Data sources”
- Again select the right scope and click “new”
- Provide a Data source and a jndi name (e.g. jdbc/myPGdb)
- On step 2 dialog select your already created JDBC provider
- Just leave step 3 at default values and finish creation, that’s it!
Tested on Websphere Application Server 6.1
Posted in Java | No Comments »
September 29th, 2006
As I have to develop a serious application during my thesis first time ever with Rational Application Developer I was seraching for a good introduction on how to use this mighty tool. I found it, who yould have thought, in an IBM redbook. “Rational Application Developer V6 Programming Guide” is an awesome entrance into the RAD world. Abutted on the classical SUN J2EE tutorial this book describes in detail how to realise a sample banking application with RAD and Websphere Application Server. It covers the realisation of JSP and Servlet-, JSF and SDO-, even Struts based Dynamic Web Application and the integration of EJB Business logic using integrated UML- and other Data modelling tools.
A must read for any person who thinks Eclipse is too much code work 
Posted in Java | No Comments »
May 19th, 2006
After some time here’s another code example. I had to write a Java based Instant Messenger for university. The code demonstrates the usage of object serialisation mechanisms in Java and sending streams via TCP and UDP. Features included are Unicast based chatting, Multicast based Chatting and File Transfer via TCP. As it’s just a proof of concept there might be some minur issues when running it and as there was a deadline there are some “unaesthetic” code parts (don’t look at the GUI part, I had to adapt that from my professor
) but the main concepts should be pointed out quite ok. Especially the file transfer via TCP migth be interesting because most of the tutorials one can find just handle Strings or something else.
The complete eclispe project can be found here.
Posted in Java | No Comments »
April 24th, 2006
A friend of mine just gave me the link to last.fm, a quite funky site which gathers information about the music you play at home automatically and produces charts and even personal radio stations out of them. Haven’t checked out all features like group building, bloging etc. yet but looks like quite a nice project. As you can see on the right they even let you integrate your personal “recently played” list onto your homepage, so for those of you who might be interested this is what I listen to 
Posted in Personal | 1 Comment »
October 14th, 2005
The following code snippet demostrates how Java can be used to read database tables and generate a valid xml file out of it. The example uses a DB2 database but should be ported to other databases with small effort. the data is provied by the sample database provided by DB2. Used techniques are JDBC and DOM Parser.
import java.io.FileOutputStream;
import java.sql.*;
import org.apache.crimson.tree.XmlDocument;
import org.w3c.dom.*;
public class DB2Mitarbeiter {
public static void main(String[] args) {
String url = "jdbc:db2://127.0.0.1:50000/SAMPLE";
String SQLString=null;
String lastDep = null;
Element emp = null;
Node lastname, firstname = null;
XmlDocument document = new XmlDocument();
Element dep = document.createElement("department");
Node company = document.createElement("company");
ResultSet rs = null;
// Load Type4 DB Driver
try {
Class.forName("com.ibm.db2.jcc.DB2Driver");
} catch (ClassNotFoundException e) {
System.out.println("ClassNotFoundException");
e.printStackTrace();
}
System.out.println("DB Type 4 Driver loaded.");
// DB connect with url,login and pass
try {
FileOutputStream fo = new FileOutputStream("test.xml");
Connection con = DriverManager.getConnection(url,"username","password");
Statement stmt = con.createStatement();
System.out.println("DB connection established.");
SQLString = "SELECT * FROM DEPARTMENT,EMPLOYEE WHERE EMPLOYEE.WORKDEPT = DEPARTMENT.DEPTNO order by DEPARTMENT.DEPTNO";
//SQLString = "SELECT * FROM DEPARTMENT LEFT JOIN EMPLOYEE ON EMPLOYEE.WORKDEPT = DEPARTMENT.DEPTNO";
rs = stmt.executeQuery(SQLString);
while(rs.next()){
//System.out.println("rs: " + rs.getString("DEPTNO") + " - lastdep: " + lastDep);
if (lastDep == null) {
dep.setAttribute("depid",rs.getString("DEPTNO"));
lastDep = rs.getString("DEPTNO");
emp = document.createElement("employee");
emp.setAttribute("empid", rs.getString("EMPNO"));
lastname = emp.appendChild(document.createElement("lastname"));
lastname.appendChild(document.createTextNode(rs.getString("LASTNAME")));
firstname = emp.appendChild(document.createElement("firstname"));
firstname.appendChild(document.createTextNode(rs.getString("FIRSTNME")));
dep.appendChild(emp);
}
else if (lastDep.equals(rs.getString("DEPTNO"))) {
emp = document.createElement("employee");
emp.setAttribute("empid", rs.getString("EMPNO"));
lastname = emp.appendChild(document.createElement("lastname"));
lastname.appendChild(document.createTextNode(rs.getString("LASTNAME")));
firstname = emp.appendChild(document.createElement("firstname"));
firstname.appendChild(document.createTextNode(rs.getString("FIRSTNME")));
dep.appendChild(emp);
}
else {
company.appendChild(dep);
dep = document.createElement("department");
dep.setAttribute("depid",rs.getString("DEPTNO"));
emp = document.createElement("employee");
emp.setAttribute("empid", rs.getString("EMPNO"));
lastname = emp.appendChild(document.createElement("lastname"));
lastname.appendChild(document.createTextNode(rs.getString("LASTNAME")));
firstname = emp.appendChild(document.createElement("firstname"));
firstname.appendChild(document.createTextNode(rs.getString("FIRSTNME")));
dep.appendChild(emp);
}
lastDep = rs.getString("DEPTNO");
}
document.appendChild(company);
document.write(fo);
fo.close();
} catch (Exception e1) {
System.out.println("Fehler");
e1.printStackTrace();
}
}
}
Posted in Java | No Comments »
August 17th, 2005
First first ever lines of VB Script code. This script generates thumbnails out of all files in a given directory and saves them to another. Additionally it creates a resized version of the images to fit into a certain max dimension. Note: ImageMagick needs to be installed in order to run this script.
Image Magick resizing test with VBScript
Posted in VBScript | No Comments »
August 9th, 2005
Posted in Uncategorized | No Comments »
July 20th, 2005
Martijn van Welie collected some nice tipps and tricks concerning design patterns for different types of web sites from artists sites over eCommerce sites to web-based applications. In his artcles he points out the differences one needs to consider and even shows some best practices for page elements like login boxes shopping carts etc. . A very useful resource while planning a new project and a nice read in general.
Check it out at http://www.welie.com/patterns/.
Posted in Coding | No Comments »
July 10th, 2005
As I’m always forgetting this quite easy to remember switch a little mental note: --alldeps makes pear install command resolving all needed dependencies automatically… dumb me
Posted in PHP | No Comments »
July 9th, 2005
I recently booted one of my long forgotten linux machines at home and realised the Fedora Core running on it was more than outdated. As I was not willing to download the full CD set for an offline update I thought I could try to find out how to update the system via online update.
After doing some research I found out that theoretically an update is quite easy to accomplish by downloading the actual version of fedora-release and yum. So I gave it a try and tried to install those two rpms manually. First problem were the outdated GPG-Keys. Went back to the Fedora Server and downloaded all files starting with RPM-GPG-KEY. To import the keys to the system simply do a rpm --import RPM-GPG-KEY*. You’ll need those keys anyway, but I had to realise that updating from Core 1 to Core 3 doesn’t seem to work that easy. I had some trouble with unresolved dependencies (e.g. udev needs kernel 2.6) so I continued with an intermediate step, I installed Fedora Core 2 first. If the Fedora update worked fine (it did without problems for me) we can start the same procedure for FC3:
Download fedora-release-3
and yum and install them with rpm -Uvh --force fedora-release-3-8.i386.rpm yum-2.1.11-3.noarch.rpm. You have to use the --force flag as there are conflicts between fedora-release-3 and up2date which can be ignored.
Afterwards just run a yum upgrade, wait some minutes and accept to download all new packages. Due to a bug in rpm it might be that you get an error message like
Error: Requiring package gnome-vfs2-2.8.2-8.i386 not in transaction set nor in rpmdb.
In this case just install the Fedora Core 3 versions of rpm (4.3.2-21) and its dependencies (rpm-python, rpm-build, rpm-devel) and re-run yum upgrade and everything should be allright.
This method worked fine for me, hope it will aswell for you. Please report any upcoming problems here and we will see if we can find a workaround
Posted in Linux | No Comments »