FUD: JDBC addiction and designing software for NoSQL

I am having a background of programming Java based web systems with RDBMS. Where I write a lot of JDBC code. Updates, select statements with a lot of joins, inserts etc is a part of my daily job. Most of my time consumed on maintaining the state of database, validating from base tables and after all storing data in some tables. When I found I am consuming too much time over db programming, and JDBC code becoming a boiler plate across many modules. I included an annotation and reflection based ORM. And I feel happy with that. The object-entity mapper gives me the visualization of my storage in the form of objects. So life is currently going on living in relational DBs.

• • •

How to find mime type of a file in Java

Validating a file when it is getting uploaded in the system is some time very necessary. We can check the extension of the file, but what if user has changed the extension to crack the system. So the best way is to find the mime type. There are multiple libraries that you can use to get the mime type of a file. Java 6 IO APIs can’t do that. I used JMimeMagic for this. Following is a code snippet to get the mime type of a file.

• • •

Div based UIs. Heaven or Hell for a developer?

At my work I have a large application that has all web pages in table based layout. The use of Div is just limited to hide and show some content area on web page. Same is the case with CSS. Using them for styling fonts and some formatting for tables. Like every developer (not designer) I am very comfortable in developing UIs by using tables. But quite impressed with Div based layouts, as its a fashion thing for web pages. I see how gracefully div is helping to manage contents instead of tr and tds. Whenever I visit some site that has some good layout. I hit the view source of that page to see whether the designer/developer has used tables. And almost all of time I find myself alone loving tables. And I know the cost to manage a big web page all developed in table. What happen if some td missed. And I need to do the debugging by enabling the border of tables. Ehh.

• • •