2013年9月27日 星期五

java-notes

Java
when : public class, it need to save as the file name as the class name.

javac -encoding UTF8 interfaceDemo.java
java 0Dfile.encoding=UTF8 interfaceDemo

/home/edward/workspace/FileIO2Demo/src java FileIO2Demo ./binary/MC01_All_20121011 test


<method notes>
1. before the method {} define variable should static  before the method define and need not in main define

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        new Main().convertByteArrayToString();
    }



problem :
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
solution :
export CLASSPATH=/usr/local/mysql-connector-java-5.1.23/mysql-connector-SPATH5.1.23-bin.jar:$CLASS

沒有留言:

張貼留言