
Auch schön ist die umgekehrte Google-Suche mit elgooG - hier gibt es viel zu entdecken - ideal, um sich die Zeit bis zu den Stuttgarter Test-Tagen 2017 (#StTT2017) zu vertreiben.
Frohe Ostern
... link (0 Kommentare) ... comment

gdv.xport ist eine Java-Bibliothek, die den Umgang mit dem GDV-Format erleichtert. Weitere Infos zu dieser Bibliothek finden sich unter aosd.de/gdv.xport/.
... link (0 Kommentare) ... comment

Most changes of PatternTesting are under the hood: switch to Java 7, switch to Log4J-2 as logging framework and better exception handling in FileTester - if a file cannot be found, it is checked if it can be a case sensitive issue. This happens often if the build runs on a Linux server with case sensitive filenames.
A bigger change was the implementation of feature request 49. You will now be warned if you forget a commit after an database insert or update (see also blog entry from September).
Another change was the split of the ClasspathMonitor into ClasspathMonitor and ResourcepathMonitor. For more info about the ClasspathMonitor see the blog of August 2009.
... link (0 Kommentare) ... comment

“Ich kann freilich nicht sagen, ob es besser wird, wenn es anders wird, aber soviel kann ich sagen: Es muss anders werden, wenn es gut werden soll.”
(Georg Christoph Lichtenberg)
... link (0 Kommentare) ... comment
- take a connection,
- create a statement with it,
- execute the statement and
- close the connection.
Connection connection = connectionProvider.getConnection();With this connection you can call a method which uses this connection to save e.g. an address:
private static void save(Address address, Connection connection) throws SQLException { PreparedStatement stmt = connection.prepareStatement( "INSERT INTO addressbook (email, name, " + "city) VALUES (?, ?, ?)"); try { stmt.setString(1, address.getEmail()); stmt.setString(2, address.getName()); stmt.setString(3, address.getCity()); int rc = stmt.executeUpdate(); if (rc < 1) { throw new SQLWarning("cannot save " + address); } } finally { stmt.close(); } }As last point you close the connection in the calling method:
connection.close();Does it work? In most cases yes, because normally the auto-commit flag is on, if you get a connection. But what happens, if auto-commit is off?
Auto-Commit Off = Lost Data
If auto-commit for a connecion is off you must call excplicit the commit:connection.commit();If you don't do it your changes are lost (there are some exeptions from that rule - the Oracle DB does a commit before it closes the connection).
The problem with this "forgotten" commit is, that no warning or exceptions comes up and you do not notice the lost data. This makes it hard to find the error - especially if the auto-commit is off only in same special cases.
The PatternTesting Proxy-Driver
PatternTesting provides you a wrapper around the original driver which allows you to log SQL statements but which warns you also if you forgot the commit statement for a connection with auto-commit off:1 entries were updated with 'INSERT INTO addressbook (email, name, city) VALUES ('ob@aosd.de', 'Oli B.', 'nowhere')' but not committed.
This is the message you will see in this case. You only have to change the JDBC-URL and put ":proxy" after the jdbc prefix:
DriverManager.getConnection("jdbc:proxy:hsqldb:mem:testdb")This is the URL for an HSQL memory DB. For more information see the Wiki article about SQL Logging and Monitoring.
Happy Debugging...
... link (0 Kommentare) ... comment
Unsupported mysql version: 5.5. Minimal supported version is 5.6.Dummerweise ist bei Ubuntu 14.04 LTS MySQL 5.5 die Default-Einstellung. Glücklicherweise läßt sich aber mit
apt-get install mysql-server-5.6MySQL 5.6 als Default einstellen - damit gab sich SonarQube zufrieden und verweigerte nicht länger seinen Dienst.
... link (0 Kommentare) ... comment

Welcome to the world of software archaeology, also known as legacy code. The first law of software archaeology from Mitch Rosenberg (see Wikipedia) gives you good feeling about the trouble in digging in old rotten code:
Everything that is there is there for a reason, and there are 3 possible reasons:And if you would like to learn some ancient language of the beginning of the computer stone age watch this video:The corollary to this "law" is that, until you know which was the reason, you should not modify the code (or data).
- It used to need to be there but no longer does
- It never needed to be there and the person that wrote the code had no clue
- It still needs to be there and YOU have no clue
... link (0 Kommentare) ... comment
"Zu sagen, man kümmere sich nicht um Datenschutz, weil man nichts zu verbergen habe, ist genauso, wie zu sagen, man kümmere sich nicht um das Recht auf freie Meinungsäußerung, weil man nichts zu sagen hat."
... link (0 Kommentare) ... comment

... link (0 Kommentare) ... comment

Some deprecated classes and methods were removed now. And some tester were extended: the FileTester prints now the filename for files which differs (see feature request 47) and allows you to add a StringConverter as argument. This allows you e.g. to ignore white spaces or upper case letters.
The ClassTester checks now also static initializers to find dependency problems to other classes during the startup phase of a class.
... link (0 Kommentare) ... comment

“Es gibt bereits alle guten Vorsätze, wir brauchen sie nur noch anzuwenden.”
(Blaise Pascal)
... link (0 Kommentare) ... comment
Die Adventszeit ist eine Zeit, in der man Zeit hat, darüber nachzudenken, wofür es sich lohnt, sich Zeit zu nehmen.
(Gudrun Kropp)
... link (0 Kommentare) ... comment

Von Entwicklung kann derzeit eigentlich kaum noch die Rede sein - man orakelt, dass hinter den Kulissen viele aktive Entwickler abgezogen wurden und viele Bereiche in der JDK- und JEE-Entwicklung jetzt brach liegen. Die spannenden Themen wie Mobile und IoT finden zunehmend woanders statt.
Aber auch wenn es in der Java-Szene kräftig rumort und einstige Zugpferde wie James Gosling oder Erich Gamma fehlen, so ist es an den meisten Universitäten die erste Wahl für objekt-orientierte Programmiersprachen. Und dies lässt hoffen für die Zukunft, dass sich Java trotz der derzeitigen Durststrecke weiterentwickeln und weiterhin für eine offen Welt stehen wird.
... link (0 Kommentare) ... comment

Wer meint, dass Altlasten (neudeutsch: Legacy) langweilig und nur etwas für zurückgebliebenen Entwickler ist, der irrt: zum einen ist Code spätestens nach 3 Monaten bereits Legacy Code (oftmals schon früher), zum anderen kann alter Code eine jede Menge erzählen: verschiedenen Firmen-Fusionen und Umbenennungen können an der Package-Struktur abgelesen werden, die Outsourcing- oder indische Area hat tiefe Spuren im Code hinterlassen, oder man entdeckt immer wieder neue Anti-Pattern, die man vorher nicht kannte.
Die Zukunft war früher auch besser.
(Karl Valentin)
... link (0 Kommentare) ... comment