Connection Pool with Tomcat6 and Mysql

May 21st, 2012 § Leave a Comment

Inside $tomcat_home/conf/context.xml add this inside <Context>

<Resource name=”jdbc/datasourcename” auth=”Container” type=”javax.sql.DataSource” maxActive=”100″ maxIdle=”30″ maxWait=”1000″ username=”dbuser” password=”dbpwd” driverClassName=”com.mysql.jdbc.Driver” url=”jdbc:mysql://localhost:3306/exodus”/>

Now restart tomcat

Inside you web.xml add this before </web-app>

<resource-ref>
<description>My DB Connection</description>
<res-ref-name>jdbc/datasourcename</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

Java code to connect:

Context initCtx = new InitialContext();

DataSource ds = (DataSource) initCtx.lookup(“java:comp/env/jdbc/datasourcename”);

Connection connection = ds.getConnection();

 

Windows 7 – Control Startup Programs

March 27th, 2012 § Leave a Comment

run msconfig and click on startup tab 

Installing Perl Modules – Ubuntu

March 22nd, 2012 § Leave a Comment

Execute this command on command line
sudo perl -MCPAN -e shell
It will install CPAN if not already installed. Then it will take you to CPAN prompt.

On CPAN prompt, execute this command to install perl module:
CPAN> install module name
For example:
CPAN> install Net::SMTP::TLS
CPAN is “Comprehensive Perl Archive Network” which is a repository of several useful Perl modules.

Android Jumble Challenge

March 21st, 2012 § Leave a Comment

Jumble Challenge has seen a really good start with more than 115 downloads in initial few days of launch. If you like to unjumble words this is the game for you. With 3 different levels Jumble Challenge is ideal for kids, young and experienced alike. Jumble Challenge is absolutely free.

ImageImage

Search “Jumble Challenge” on your android device or Download it here!

Where Am I?

You are currently browsing the Others (Technical) category at Varun's Blog.

Follow

Get every new post delivered to your Inbox.