Showing posts from May, 2010

hashmap constructors

Hash Map Constructors
HashMap ()
Constructs empty HashMap with a default initial capacity 11 and load factor 0.75.
HashMap (int initialCapacity)
Constructs empty HashMap with the specified initial capacity and default load factor 0.75.
HashMap (int initialCapacity, float loadFactor)
Constructs empty HashMap with the specified initial capacity and the specified load factor.
HashMap (Map t)
Constructs a new HashMap with the mappings same as the passed Map.

mysql query to delete all the records of a month,

delete from mytable where MONTH (scheduleDate)=5;

/*to Select*/
select * from mytable where MONTH (scheduleDate)=5;

update set recordtype="saved" where MONTH (scheduleDate)=5;

Change the Storage Engine in mysql

Query to get total number of records
Select count (*) from mytable;

Query to change the storage engine
ALTER TABLE mytable ENGINE = innodb

WinSCP--Run sql file on linux

Move the file ---"myscript.sql"--to /var/lib/mysql/ using winscpopen putty connection to the linux servertype #mysql -----in the command prompt mysql>source /var/lib/mysql/myscript.sql

Installing tomcat6.X and Java1.6X on Linux using Winscp

Installing Java 1.6x and Tomcat 6.x on Linux--Using Winscp
Installing java:
Download jdk version--1.6x for linux from Sun websiteDownload the non-rpm version.Use winscp and connect to the server.go to usr dirright click and create a new directory--java give all the read/write permission to the directorymove the download jdk from your local system to the java directoryopen putty connection to the server#cd usrexecute the command using putty:./jre-1.bin
/* optional

# mkdir -p /usr/local/java

# cd /usr/local/java

# mv /path/to/jdk-1_6_0_20-linux-x64.bin .

# chmod u+x jdk-1_6_0_20-linux-x64.bin

# ./jdk-1_6_0_20-linux-x64.bin


set JAVA_HOME and PATHset JAVA_HOME to the dir of javaPATH to bin dir of JAVA_HOME
Use--Putty to execute the below
# export JAVA_HOME=/usr/java/jdk1.6.0_10# export PATH=$JAVA_HOME/bin:$PATH
Check if we have installed it
# which java
# java -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java H…