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
Send email using gmail in Perl
March 22nd, 2012 § Leave a Comment
Here’s sample code to send email via gmail smtp server, which uses TLS (transport layer security):
#!/usr/bin/perl -w
use Net::SMTP::TLS;
my $mailer = new Net::SMTP::TLS(
'smtp.gmail.com',
Hello => 'smtp.gmail.com',
Port => 587,
User => 'gmail userid',
Password=> 'gmail password');
$mailer->mail('from\@domain.com');
$mailer->to('targetuser\@userdomain.com');
$mailer->data;
$mailer->datasend("Subject:Email Subject");
$mailer->datasend("From:From Name<from\@domain.com>\n");
$mailer->datasend("To:targetuser\@userdomain.com");
$mailer->datasend("This is the email body");
$mailer->dataend;
$mailer->quit;
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.
Search “Jumble Challenge” on your android device or Download it here!

