- Thursday, January 13, 2011, 7:40
- Application Support, Java Core, Linux
1.Verify your current java version
#java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20071124 (Red Hat 4.1.2-42)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2.Then use alternatives command to display existing java
NOTE:alternatives command used to maintain symbolic links for determining default commands
Full story
- Monday, December 6, 2010, 18:54
- Database, Java, Java Core, SQL basics
public class stringToSqlDate {
public static void main(String args[]){
String strDate="17/12/2010";
java.util.Date dt=new java.util.Date(strDate);
java.sql.Date sqlDate=new java.sql.Date(dt.getTime());
System.out.println(sqlDate);
}
Full story
- Tuesday, July 13, 2010, 5:14
- Java, Java Core
In the above example i want to read bailey.mpg from my jar File named
Entrance_Guide.jar located in /root/NetBeansProjects/Entrance
Guide/dist/Entrance_Guide.jar.The bailey.mpg file located in FlashFiles
package. So to read that file from jar i used the below code.
Full story
- Thursday, July 8, 2010, 2:57
- Java, Java Core
Two types
1 Shallow Cloning -
If a arrayList contained object to be cloned with listObject.clone() results shallow cloning only
eg. List<String> listObj = new ArrayList<String>();
Object obj = listObj.clone();
2 Deep cloning - Achieved by writing with ObjectOutputStream ( Serialization ) and deserialize that object to be a deep cloned object.
Full story
- Friday, July 2, 2010, 17:28
- Java, Java Core
The following code is used to create a Tree dynamically. Here getTreeStructure() function returns DefaultMutableTreeNode. Here i uses a MyRenderer class which extends DefaultTreeCellRenderer. DefaultTreeCellRenderer defines the requirements for an object responsible for "rendering" (displaying) a value.
Full story
- Friday, June 25, 2010, 5:16
- Java, Java Core
For compile and running a bat file in command prompt open command prompt cd C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\fi_sh\WEB-INF\classes then
step 1: set java home as below
set JAVA_HOME="C:\Program Files\Java\jdk1.5.0"
Full story