Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

×Ô¶¯Éú³ÉJavaʵÌåÀà

JDBC¶ÁÈ¡Êý¾Ý¿âÔªÊý¾Ý,Éú³ÉJAVAʵÌåÀà
package com.nffish.util;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import com.nffish.common.DBSession;
public class GenEntityTool {
    private String tablename = "petDiary";
    private String[] colnames; // ÁÐÃûÊý×é
    private String[] colTypes; // ÁÐÃûÀàÐÍÊý×é
    private int[] colSizes; // ÁÐÃû´óСÊý×é
    private boolean f_util = false; // ÊÇ·ñÐèÒªµ¼Èë°üjava.util.*
    private boolean f_sql = false; // ÊÇ·ñÐèÒªµ¼Èë°üjava.sql.*
    public GenEntityTool() {
        Connection conn = DBSession.getConnection(); // µÃµ½Êý¾Ý¿âÁ¬½Ó
        String strsql = "select * from " + tablename;
        try {
            PreparedStatement pstmt = conn.prepareStatement(strsql);
            ResultSetMetaData rsmd = pstmt.getMetaData();
            int size = rsmd.getColumnCount(); // ¹²ÓжàÉÙÁÐ
            colnames = new String[size];
            colTypes = new String[size];
            colSizes = new int[size];
            for (int i = 0; i < rsmd.getColumnCount(); i++) {
                colnames[i] = rsmd.getColumnName(i + 1);
                colTypes[i] = rsmd.getColumnTypeName(i + 1);
        &n


Ïà¹ØÎĵµ£º

¼ò µ¥ µÄ Java³Ì Ðò

http://www.sdau.edu.cn/support/html/java03.htm 
1.3 ¼ò µ¥ µÄ Java³Ì Ðò
Ï Ãæ ÎÒ ÃÇ ÏÈ ½é ÉÜ Á½ ¸ö ¼ò µ¥ µÄ Java³Ì Ðò ,²¢ ¶Ô Æä ½ø ÐÐ ·Ö Îö¡£
Àý 1.1.
public class HelloWorldApp { //an application
public static void main (String args[ ]){
System.out.println("Hello World!");
}
}
± ......

Java Type VS Hibernate Type

Java Class Attribute Type         Hibernate Type               Possible SQL Type-Vendor Specific
Integer, int, long short &n ......

JAVA¼ÓÃÜËã·¨

MD5Ëã·¨ÊÇÒ»Öַdz£ÓÅÐãµÄ¼ÓÃÜËã·¨¡£
MD5¼ÓÃÜËã·¨Ìص㣺Áé»îÐÔ¡¢²»¿É»Ö¸´ÐÔ¡£
       ½éÉÜMD5¼ÓÃÜËã·¨»ù±¾Çé¿öMD5µÄÈ«³ÆÊÇMessage-Digest Algorithm 5£¬ÔÚ90Äê´ú³õÓÉMITµÄ¼ÆËã»ú¿ÆѧʵÑéÊÒºÍRSA Data Security Inc·¢Ã÷£¬¾­MD2¡¢MD3ºÍMD4·¢Õ¹¶øÀ´¡£
Message-Digest·ºÖ¸×Ö½Ú´®(Message)µÄHas ......

Java Read()×èÈûµÄÒ»ÖÖ´¦Àí·½Ê½

java.io.InputStreamµÄread()·½·¨ÃèÊö£º
        If no byte is available because the end of the stream has been reached, the value -1 is returned.
        µ½´ïÁ÷µÄĩβÕæ»á·Å»Ø-1Âð£¿
        ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ