Ò»¸öºÃÓõÄÈÕÆÚʱ¼äÀà(java)
import java.util.*;
import java.text.*;
/**
* a <code> DateTime </code> ¶¨ÒåÁËÈÕÆÚʱ¼äµÄһЩ±ã½ÝµÄ¸ñʽ»¯²Ù×÷
*
* @version 1.0
* @author markhuang
*/
public class DateTime {
/**
* ´æ´¢Ê±¼äºÍÈÕÆÚ£¬Ä¬Èϵ±Ç°Ê±¼äºÍÈÕÆÚ
*/
// private Calendar cale = Calendar.getInstance();
private Calendar cale = new GregorianCalendar();
/**
* ĬÈϹ¹Ô캯Êý,µÃµ½µ±Ç°Ê±¼äºÍÈÕÆÚ
*/
public DateTime() {
cale.setLenient(false);
}
/**
* ¹¹Ô캯Êý,¿ÉÉèÖúÁÃë
*
* @param millisecond
* ¹ýÈ¥µÄºÁÃëÊý
* @see #DateTime
*/
public DateTime(long millisecond) {
cale.setLenient(false);
cale.setTimeInMillis(millisecond);
}
/**
* ¹¹Ô캯Êý,¿ÉÉèÖÃÄêÔÂÈÕʱ·ÖÃë
*
* @param year
* Äê
* @param month
* ÔÂ
* @param day
* ÈÕ
* @param hour
* Сʱ
* @param minute
* ·ÖÖÓ
* @param second
* Ãë
* @see #DateTime(long)
*/
public DateTime(int year, int month, int day, int hour, int minute,
int second) {
cale.setLenient(false);
cale.set(Calendar.YEAR, year);
// ÀÏÍâµÄÔ·ÝÊÇ´Ó0µ½ 11
cale.set(Calendar.MONTH, month - 1);
cale.set(Calendar.DAY_OF_MONTH, day);
cale.set(Calendar.HOUR_OF_DAY, hour);
cale.set(Calendar.MINUTE, minute);
cale.set(Calendar.SECOND, second);
}
/**
* µÃµ½µ±Ç°Äê
*
* @return µ±Ç°Äê
*/
public int year() {
return cale.get(Calendar.YEAR);
}
/**
* µÃµ½µ±Ç°ÔÂ
*
* @return µ±Ç°ÔÂ
*/
public int month() {
// ÀÏÍâµÄÔ·ÝÊÇ´Ó0µ½ 11
return cale.get(Calendar.MONTH) + 1;
}
/**
* µÃµ½µ±Ç°ÈÕ
*
* @return µ±Ç°ÈÕ
*/
public int day() {
return cale.get(Calendar.DAY_OF_MONTH);
}
/**
* µÃµ½µ±Ç°Ð¡Ê±
*
* @return µ±Ç°Ð¡Ê±
*/
public int hour() {
return cale.get(Calendar.HOUR_OF_DAY);
}
/**
* µÃµ½µ±Ç°·ÖÖÓ
*
* @return µ±Ç°·ÖÖÓ
*/
public int minute() {
return cale.get(Calendar.MINUTE);
}
/**
Ïà¹ØÎĵµ£º
ÈýÖÜÇ°£¬¾ÍÓëͬѧԼ¶¨ºÃÁË£¬»¨ÈýÖÜʱ¼äд¸öÌ°³ÔÉߣ¬¾ÍÓÃ×Ô¼ºÏÖÔÚËùѧµÄJava£¬ÎÒÏë¿ÉÒÔ°¡¡£Ñ§Ð£Àï½Ì²»³öʲô¶«Î÷£¬ÄǾÍ×Ô¼º¸ã°É£¡ÓÚÊÇÎÒÃÇÐÅÊĵ©µ©¿ªÊ¼Á˼¸Ìì¡£²»ÁÏÎåÒ»Ò»À´£¬°ÑËùÓеĶ¼ÀÏÂÁË¡£×îºóÒ»ÖÜÁË£¬Ã»°ì·¨£¬Í¨Ïü°É£¡ÓÚÊÇÁ¬Ðø¼¸Ìì¿à¸É£¬ÖÕÓÚд³öÀ´ÁË.ËäÈ»Óеã´Ö²Ú£¬ÒòΪѧУ»¹Ã»¿ªÊ¼½ÌGUIº ......
1£®Hibernate¹¤×÷ÔÀí¼°ÎªÊ²Ã´ÒªÓã¿
ÔÀí£º
1.¶ÁÈ¡²¢½âÎöÅäÖÃÎļþ
2.¶ÁÈ¡²¢½âÎöÓ³ÉäÐÅÏ¢£¬´´½¨SessionFactory
3.´ò¿ªSesssion
4.´´½¨ÊÂÎñTransation
5.³Ö¾Ã»¯²Ù×÷
6.Ìá½»ÊÂÎñ
7.¹Ø±ÕSession
8.¹Ø±ÕSesstionFactory
ΪʲôҪÓãº
1. ¶ÔJDB ......
1.ËãÊõÔËËã·û
JavaµÄËãÊõÔËËã·û·ÖΪһԪÔËËã·ûºÍ¶þÔªÔËËã·û¡£Ò»ÔªÔËËã·ûÖ»ÓÐÒ»¸ö²Ù×÷Êý£»¶þÔªÔËËã·ûÓÐÁ½¸ö²Ù×÷Êý£¬ÔËËã·ûλÓÚÁ½¸ö²Ù×÷ÊýÖ®¼ä¡£ËãÊõÔËËã·ûµÄ²Ù×÷Êý±ØÐëÊÇÊýÖµÀàÐÍ¡£
(1)Ò»ÔªÔËËã·û£º
Ò»ÔªÔËËã·ûÓУºÕý£¨+£©¡¢¸º£¨££©¡¢¼Ó1£¨++£©ºÍ¼õ1£¨£££ ......
×Ö·û´®
1¡¢»ñÈ¡×Ö·û´®µÄ³¤¶È
length()
2 ¡¢ÅжÏ×Ö·û´®µÄǰ׺»òºó׺ÓëÒÑÖª×Ö·û´®ÊÇ·ñÏàͬ
ǰ׺ startsWith(String s)
ºó׺ endsWith(String s)
3¡¢±È½ÏÁ½¸ö×Ö·û´®
equals(String s)
4¡¢°Ñ×Ö·û´®×ª»¯ÎªÏàÓ¦µÄÊýÖµ
intÐÍ Integer.parseInt(×Ö·û´®)
......
¶àÏ̳߳ÌÐò
¶ÔÓÚ¶àÏ̵߳ĺô¦Õâ¾Í²»¶à˵ÁË¡£µ«ÊÇ,ËüͬÑùÒ²´øÀ´ÁËijЩеÄÂé·³¡£Ö»ÒªÔÚÉè¼Æ³ÌÐòʱÌرðСÐÄÁôÒâ,¿Ë·þÕâЩÂé·³²¢²»ËãÌ«À§ÄÑ¡£
(1)ͬ²½Ïß³Ì
Ðí¶àÏß³ÌÔÚÖ´ÐÐÖбØÐ뿼ÂÇÓëÆäËûÏß³ÌÖ®¼ä¹²ÏíÊý¾Ý»òе÷Ö´ÐÐ״̬¡£Õâ¾Í ÐèҪͬ²½»úÖÆ¡£ÔÚJavaÖÐÿ¸ö¶ÔÏó¶¼ÓÐÒ»°ÑËøÓëÖ®¶ÔÓ¦¡£µ«Java²»Ìṩµ¥¶ÀµÄlockºÍunlock²Ù×÷¡£ ......