Tuesday, October 28, 2008

How to Handle Apostophes in DB2

Let us say if we have a table named EMPLOYEE having 2 coloumns EMPLY_ID, EMPLY__NM . if we want to update the name of EMPLLOYEE (ID:142082) from Satish to S'atish then we can use the below query.
UPDATE EMPLOYEE SET EMPLY_NM = 's''atish' where EMPLY_ID =142082.
Just use the double quotes instead of single quote to avoid SQL error 'Unbalanced Apsotrphes'
The MF database will recognize the double quote as 'Apostophe'.


Where it will be useful:
when you are passing a input parametre value having apostophe to stored procedure or COBOL program,to update it into database.

Friday, October 24, 2008

Performance increase by Configuring Windows -MyComputer

Start > Right Click on MyCOmputer and select properties.
Click on "Advanced" tab.
See the "performance" section? Click "Settings" > Disable all or some of the follwoing:
Fade or slide menus into view.
Fade or slide ToolTips into view.
Fade out menu items after clicking.
Show shadows under menus.
Slide open combo boxes.
Slide taskbar buttons.
Use a background image for each folder type.
Use common tasks in folders.

Tuesday, October 21, 2008

Environment Variables in Java

Some Environment Variables to be set while using Java Applications:


JAVA_HOME Should point to the folder above bin (eg.. C:\java )
If using ANT
ANT_HOME C:\java\apache-ant-1.7.0
If using Tomcat
CATALINA_HOME c:\tomcat6.0\tomcat
If using JIKES
JIKES_HOME c:\java\jikes-1.22

Sunday, October 19, 2008

Java on Ubuntu

Ubuntu has GCJ installed by default. A different version of Java can be installed using the Synaptic Package Manager. Sun's Java 1.5 and 1.6 are available through the package manager.

The problem is, even after installing Sun's Java, GCJ is the default.
The default version of java can be changed using the update-java-alternatives command.
update-java-alternatives -l will give the list of all installed java packages.

example output:
java-1.5.0-sun 53 /usr/lib/jvm/java-1.5.0-sun
java-gcj 1042 /usr/lib/jvm/java-gcj

update-java-alternatives -s java-1.5.0-sun will set Sun's java as the default.
For some applications like Ant, Tomcat to run, you nee to set the JAVA_HOME environment variable like below
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun

The above export can be put in /etc/bash.bashrc (for all users) or /home//.bashrc (for a particular user) so that JAVA_HOME is available on logon.

Friday, October 17, 2008

To remove shortcut icon arrows.

If you want to remove shortcut icon arrows. Then go to the Registry and do the follwoing activity.

Go to {HKEY_CLASSES_ROOT\LNKFILE], and delete IsShortcut.
Go to [HKEY_CLASSES_ROOT\PIFFILE], and delete IsShortcut.

Wednesday, October 15, 2008

Keys for formatting data

CTRL+SHIFT+^ - Apply the Exponential number format with two decimal places CTRL+SHIFT+# - Apply the Date format with the day, month, and year

CTRL+SHIFT+@ - Apply the Time format with the hour and minute, and indicate A.M. or P.M.

CTRL+SHIFT+! - Apply the Number format with two decimal places, thousands separator, and minus sign (–) for negative values

CTRL+SHIFT+& - Apply the outline border
ALT+' (apostrophe) - Display the Style dialog box

CTRL+1 - Display the Format Cells dialog box

CTRL+SHIFT+~ - Apply the General number format

CTRL+SHIFT+$ - Apply the Currency format with two decimal places (negative numbers appear in parentheses)

CTRL+SHIFT+% - Apply the Percentage format with no decimal places

Friday, October 10, 2008

Memory Allocation of JVM

While googling i found the below information which i want to share it here.

The follwoing code is to print Total,Free and Max memory allocated to JVM. it differs depends on the Java Environment.
Please have a look -


public class Memory {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("The Memory Allocation to JVM ");
long totalMemory = ((Runtime.getRuntime().totalMemory()/1024)/1024);
long freeMemory = ((Runtime.getRuntime().freeMemory()/1024)/1024);
long maxMemory = ((Runtime.getRuntime().maxMemory()/1024)/1024);
System.out.println("Total Memory::"+totalMemory+"MB");
System.out.println("Free Memory::"+freeMemory+"MB");
System.out.println("Max Memory::"+maxMemory+"MB");
}
}

Friday, October 03, 2008

DJ Java Decompiler

DJ Java Decompiler is Windows 95/98/Me/NT/2000/XP decompiler and disassembler for Java that reconstructs the original source code from the compiled binary CLASS files (for example Java applets). DJ Java Decompiler is able to decompile complex Java applets and binaries, producing accurate source code.
DJ Java Decompiler is a stand-alone Windows application; it doesn't require having Java installed! DJ Java Decompiler is not just Java decompiler and disassembler but it is also a fully featured Java editor using the graphic user interface with syntax-coloring. Using DJ Java Decompiler is easy. Select Open and load your desired class file, or just double-click the CLASS file you want to decompile. DJ Java Decompiler supports drag-and-drop functions for OLE. You will see the source code instantly! In Windows Explorer Right mouse-button pop-up menu available too.
You can decompile or disassembler a CLASS files on your computer hard disk or on a network drive that you have a connection to (you must have a full access rights or just change the default output directory for .jad files). You don't need to have the Java Virtual Machine or any other Java SDK installed. But this latest release is able to compile, run, create JAR archives and run applets outside of the context of a Web browser when JDK is installed. With DJ Java Decompiler you can decompile more than one java class file at one time.
Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory