Java³£ÓôúÂë
/**
* @author he
*
*
* °ÑDateת»»³ÉString£¬ÒÔyyyy-MM-dd HH:mm:ssµÄÐÎʽÏÔʾ
*/
public static String DateToString(Date tempDate) {
String date_str = "";
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // ¹æ¶¨ÈÕÆÚ¸ñʽ
try {
date_str = formatter.format(tempDate);
} catch (Exception ex) {
date_str = "";
}
return date_str;
}
/**
* @authorhe
*
*
* °ÑStringת»»³ÉDate£¬ÐÎʽΪyyyy-MM-dd HH:mm:ss
*/
public static Date StringToDate(String dateStr) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // ¹æ¶¨ÈÕÆÚ¸ñʽ
long long_temp = 0;
Date tempDate;
try {
long_temp = formatter.parse(dateStr).getTime();// ÏÈת»»³ÉlongÐÍ
tempDate = new Date(long_temp); // ÔÚת»»³ÉDateÐÍ
} catch (Exception ex) {
tempDate = null;
}
return tempDate;
}
Ïà¹ØÎĵµ£º
1.StudentList.java:
/**
*
* @author lucifer
*/
package JavaSerializable;
import java.util.*;
import java.io.*;
public class StudentList implements Serializable{
Vector list = new Vector(6);
public StudentList(){} ......
»ñÈ¡classÀà·½·¨£º
1£¬getClass 2£¬Class.forName() 3,ÓÃ.class
public Field[] getDeclaredFields()
·µ»ØµÄÊÇij¸öÀàÀïµÄËùÓÐÀàÐ͵ıäÁ¿£¬²»°üÀ¨¼Ì³Ð¸¸ÀàµÄ
public Field[] getDeclaredFields(String name)
·µ»ØÌض¨Ãû×Ö
public Field[] getFields()
·µ»ØµÄÊÇij¸öÀàÀïµÄËùÓÐpublicÀàÐ͵ıäÁ¿£¬°üÀ¨¼Ì³Ð¸¸Àൠ......
來Ô´£ºhttp://www.blogjava.net/oxidy/articles/213105.html
1.°üÃüÃû:È«²¿×ÖĸСд:cn.package.bean
2.ÀàÃüÃû:µ¥´ÊµÄÊ××Öĸ´óд:SimpleBean
3.ÊôÐÔÃû³Æ:µÚÒ»¸öµ¥´ÊµÄÊ××ÖĸСд,Ö®ºóÿ¸öµ¥´ÊµÄÊ××Öĸ´óдstudentName
4.·½·¨ÃüÃû:ÓëÊôÐÔÃüÃûÏàͬ:public
void sayHello()
5.³£Á¿ÃüÃû:È«²¿µ¥´Ê´óд:final S ......
Ìõ¼þ£ºÒѰ²×°J2SEºÍJ2EE¡£
Microsoft SQL Server 2000 Driver for JDBCÊÇ΢Èí¹«Ë¾Ãâ·ÑÌṩÃâ·ÑÏÂÔØµÄÒ»¸öÈí¼þ£¬Çë·ÃÎÊ£º http://www.microsoft.com/sql/default.asp£¬ÏÂÔØºóÎļþÃûΪ£ºsetup.exe£¬°²×°ºó£¬Ä¬ÈÏ·¾¶ÊÇ£º%Program Files%\Microsoft SQL Server 2000 Driver for JDBC£¬¸ÃĿ¼ÏÂLIBĿ¼ÀïÓÐ3¸öjarÎļþ¡£ ......