How to configure session factory to connect to a DB2 datasource with Hibernate

A really brief intro Hibernate is one of the most incredible Object Relational Mapper (ORM engine) that we have to make scalable and secure  Java Enterprise Applications. Today, I going to explain you, how to configure your session factory field by field in order to have a basic connection to a datasource (in this case…

How to allow publishing of JavaEE applications with “errors” in IBM Rational® Software Architect

The problem Sometimes, you are creating pieces of software with many tags in HTML, JavaScript or any other front-end language that IBM Rational® Software Architect doesn’t recognize, for example today I was publishing a theme for WebSphere Portal 8 and an error started to happen in the publishing operation, in a nutshell it was about my…

How to compile Java programs by using command line

So, do you need to compile your Java code using the command line? Don’t worry, just follow type command and it will be very easy! // If we are in the root of the application javac -d ./bin -classpath /Applications/eclipse/servers/apache-tomcat-7.0.50/lib/servlet-api.jar src/com/base22/servlets/*.java -d: destination directory. In our example, the packages with bytecode will be generated into…

How to print Attributes enumeration in Java (javax naming directory Attributes)

This is only a little piece of code to print all the IDs and values of a javax.naming.directory.Attributes. If you want to know more about this interface, please see official documentation (http://docs.oracle.com/javase/7/docs/api/javax/naming/directory/Attributes.html), but here, you have a little explanation about it: This interface represents a collection of attributes. In a directory, named objects can have…