JDBC DataSource Configuration in Tomcat

Put a file named context.xml in META-INF folder which contains: <?xml version=”1.0″ encoding=”UTF-8″?> <Context><Resource name=”MySQLDS” type=”javax.sql.DataSource” driverClassName=”com.mysql.jdbc.Driver” password=”root” maxIdle=”2″ maxWait=”5000″ username=”root” url=”jdbc:mysql://localhost:3306/test” maxActive=”10″/></Context> Getting the DataSource: Context context = new InitialContext();DataSource MYSQL_DATASOURCE = (DataSource) context.lookup(“java:comp/env/MySQLDS”);

Read More

How to kill a process running on a port

Hi All,Many of the Java developers frequently facing some problems with ports.Ex: If JBoss server has started and closed accedentally without properly shutdown process , several processes will remain running on some ports which will causes Port Already binded kind of exceptions.In that kind of situations, we can forcefully kill a process running on a […]

Read More

Struts1 Vs Struts2 Vs JSF Vs SpringMVC

Hi, Recently I have done some research on J2EE Web frameworks usability and features to decide the framework to be used for one of my new projects.I consider Struts 1, Struts2, JSF and Spring MVC. After spending some hours on going through each of the frameworks features and some more hours to do a simple […]

Read More

What is Inversion Of Control (IOC)?

Inversion Of Control is a design pattern which suggests the creation of collaborating objects and injecting them should not be done by the dependent object itself. For example, Suppose WhetherController(Servlet) is depend on WhetherService which is depend WhetherDAO. WhetherController .javaclass WhetherController extends HttpServlet{ protected doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { WhetherService service = […]

Read More

Welcome note

Hi All,Welcome guys. This is a blog where in you can find tutorials on various Java and J2EE technologies and can have discussions regarding technical problems and application development related issues.

Read More