Posted on January 31st, 2009 by admin
I graduated from University College Cork, Ireland with Msc degree in 2006. Since then, I have never touched my thesis again. It is useless to only keep it in my hard drivers. I would like to take it out and hope it can help some one who may need. The thesis is put on the [...]
No Comments »
Filed under: Java
Posted on January 1st, 2009 by admin
If you like to program in Java language, it is good to know there are a number of ways to get all keys/values out of a Hashtable. Hashtable ht = new Hashtable(); ht.put(“one”,new Integer(1)); ht.put(“two”,new Integer(2)); Enumeration en = ht.elements(); while(en.hasMoreElements()){ System.out.println((Integer)en.nextElement()); } or Hashtable ht = new Hashtable(); ht.put(“one”,new Integer(1)); ht.put(“two”,new Integer(2)); Iterator it=hr.keySet().Iterator(); [...]
No Comments »
Filed under: Java
Posted on August 8th, 2006 by HuHe
When I transfer a variable of action class to jsp, I find some thing interesting: If the variable is an Array, then in jsp, I need to write both first two line(1 and 2): 1: <logic:iterate id=”dish” name=”dishes” type=”myPack.Dish”> 2: <logic:present name=”dish”> 3: <bean:write name=”dish” property=”dishName”> 4: </bean:write> 5: </logic:present> 6: </logic:iterate> then no problem. [...]
No Comments »
Filed under: Java
Posted on July 3rd, 2006 by HuHe
When you want to associate a database table with Hibernate, you must remember to add resource mapping, something like:< resource=”myPack/Category.hbm.xml”>, into the hibernate.cfg.xml file. Otherwise, the data from this table can’t be found.
No Comments »
Filed under: Java
Posted on June 6th, 2006 by HuHe
if in the xx.hbm.xml file, you made a mistake,like: you write a wrong property name which doesn’t exist in the mapping class. say: “username” is a property in the class “User.class”,but you write it as “usename”. Then the problem happens, “Servlet action is not available” will display on your page.
No Comments »
Filed under: Java
Posted on May 27th, 2006 by HuHe
Hibernate has version 2 and version 3. There are some differences between them, so We must pay attention to these differencs when we are programming.
No Comments »
Filed under: Java
Posted on April 25th, 2006 by HuHe
When I run the example provided by the Hibernate 3.1.3 package, “ant eg”, I got the error: “ClassNotFoundException: org.hibernate.hql.ast.HqlToken.The solutions have two which I tried and succeeded.1: place the antlr-2.7.6rc1.jar into the jdk.xxx/jre/lib/ext directory of jdk package.2: set the “hibernate.query.factory_class” to “org.hibernate.hql.classic.ClassicQueryTranslatorFactory” in the “hibernate.properties” file.3: Or add the following sentence into the hibernate.cfg.xml file: [...]
2 Comments »
Filed under: Java
Posted on April 24th, 2006 by HuHe
To run Hibernate example successfully, We must place log4jXXX.jar into the “jre/ext” directory of JDK (like: JDK1.5.0_06). for example, we can run the example provided by Hibernate package: “ant eg”.otherwise, it will have an error: java.lang.ExceptionInInitializerError at……….Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor …..
No Comments »
Filed under: Java
Posted on July 12th, 2005 by HuHe
When use the method of Applet: getImage(), add the applet to a frame, and show a instance of the frame, if run it as application, it will show errors. We can use Toolkit.getImage() to replace Applet.getImage(). Also, the method of applet: getCodeBase() only can be used in applet(because getCodebase() is the URL of the applet [...]
No Comments »
Filed under: Java
Posted on July 11th, 2005 by HuHe
I have succeeded in on PDA using URL(java.net.*) to get the picture from httpserver today. I try to find some api can make IBM J9 work with MySql. It seems there is not API for J9 to support the JDBC. I check the liberary of J9, found no java.sql.* inside. Somebody say I can use [...]
No Comments »
Filed under: Java