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.

• • •

Do you think to be an open source committer?

We widely use open source developer tools and libraries in our daily dev life. These open source things are driven by community. I am an open source fan. And I think I must contribute to some open source project. Umm yeah, before I become a contributor I must be an active user of that project. So that I may able to see what things that need improvements or where I can fit myself to make a contribution.

• • •

Fetch Twitter friends or followers through REST API in Java

I was playing around with fetching Twitter followers and friends with Twitter4J. But it was taking time to do that. So I code it with using REST urls given by Twitter. It fetches all your friends or followers. Depending upon your application that you want one list or you want to use paging. But I did it in one go. Performance wise, it will be trouble of fetching say 2000 followers or friends.

• • •