Mittwoch, 27. August 2014

Once I needed to implement a small script that should read rows from a database and create a CSV file based on a particular filtering. I knew much about command line VB and Java scripting but a main requirement was to have a simple GUI which for entering the filter criteria. After a while I ’ve found a tutorial about HTML Applications and immediately...

Freitag, 15. August 2014

JBoss 7 Client context

/** * Creates a context for connecting to remote ejbs * * @url url as string ip:port */ private static InitialContext createInitialContext(String url, boolean sslEnabled) throws NamingException { String urlParts[] = url.split(":"); Properties clientProperties = new Properties(); clientProperties.put("remote.connections", "default"); clientProperties.put("remote.connection.default.host",...

Generic toString() for Entities in JAVA

@Override public String toString() { Class clazz = getClass(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(getClass().getSimpleName()); stringBuilder.append("@" + Integer.toHexString(System.identityHashCode(this))); stringBuilder.append("["); List<field> printableFields = new ArrayList<field>(); while (clazz != null) { ...