This example is plain wrong. The InputStream will cause an endless loop as it always returns a value >= 0. Working code as follows: private static InputStream _newInputStream(final ByteBuffer buf) { return new InputStream() { public synchronized int read() throws IOException { return buf.hasRemaining() ? buf.get() : -1; } public synchronized int read(byte[] bytes, […]
With the current and latest Oracle JDBC Drivers it’s possible to retrieve one automatically generated key based on a sequence or any other arbitrary value (autogenerated-keys or identity columns in other databases). Certainly it isn’t as simple as just use using Statement.html#getGeneratedKeys() as it simply returns an emtpy resultset. After browsing around, i saw that […]
Grails has a good mechanism for including JavaScript Libraries to do all that fance Ajax stuff. It all starts with: <g:javascript library="scripaculous" /><g:javascript library="scripaculous" /> Library can be one of yahoo, prototype, dojo, scriptaculous or rico. It’s a nice fact, that Grails doesn’t force you to use any special of these. I wanted to change […]
I always thought that the Java Thread API is something… strange. If you work in a frontend application, things like running long-running tasks in the back without having the GUI ugly frozen and not responding should be somewhat simpler. SwingWorker has been around for quite a time but made it just recently into the core […]
I’ve never thought that my little little post would made such an impact. While writing that post i was frustrated explaining the Spring configuration to my colleaques again, i was frustrated over the url mappings and so the post was a little harsh. I don’t think that Hibernate is inferior to Active Record, regarding Spring […]