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

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