Ò»¸öºÃÓõÄÈÕÆÚʱ¼äÀà(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 ÖÐÉú³ÉÊý×ÖÖ¤ÊéÒ²ºÜ¼òµ¥µÄ¡£
1¡¢´´½¨Ö¤Êé
Java ÖÐµÄ keytool.exe £¨Î»ÓÚ JDKBin Ŀ¼Ï£©¿ÉÒÔÓÃÀ´´´½¨Êý×ÖÖ¤Ê飬ËùÓеÄÊý×ÖÖ¤ÊéÊÇÒÔÒ»ÌõÒ»Ìõ(²ÉÓñðÃûÇø±ð)µÄÐÎʽ´æÈëÖ¤Êé¿âµÄÖУ¬Ö¤Êé¿âÖеÄÒ»ÌõÖ¤Êé°üº¬¸ÃÌõÖ¤ÊéµÄ˽Կ£¬¹«Ô¿ºÍ¶ÔÓ¦µÄÊý×ÖÖ¤ÊéµÄÐÅÏ¢¡£Ö¤Êé¿âÖеÄÒ»ÌõÖ¤Êé¿ÉÒÔµ¼³öÊý×ÖÖ¤ÊéÎļþ£¬Êý×ÖÖ¤ÊéÎļþÖ»°üÀ¨ ......
ÈýÖÜÇ°£¬¾ÍÓëͬѧԼ¶¨ºÃÁË£¬»¨ÈýÖÜʱ¼äд¸öÌ°³ÔÉߣ¬¾ÍÓÃ×Ô¼ºÏÖÔÚËùѧµÄJava£¬ÎÒÏë¿ÉÒÔ°¡¡£Ñ§Ð£Àï½Ì²»³öʲô¶«Î÷£¬ÄǾÍ×Ô¼º¸ã°É£¡ÓÚÊÇÎÒÃÇÐÅÊĵ©µ©¿ªÊ¼Á˼¸Ìì¡£²»ÁÏÎåÒ»Ò»À´£¬°ÑËùÓеĶ¼ÀÏÂÁË¡£×îºóÒ»ÖÜÁË£¬Ã»°ì·¨£¬Í¨Ïü°É£¡ÓÚÊÇÁ¬Ðø¼¸Ìì¿à¸É£¬ÖÕÓÚд³öÀ´ÁË.ËäÈ»Óеã´Ö²Ú£¬ÒòΪѧУ»¹Ã»¿ªÊ¼½ÌGUIº ......
´«ÖDz¥¿ÍJAVAÅàѵOAÏîÄ¿2010-5-12
½ñÌì»»Á˸öнÌÊÒ£¬ÖÕÓÚ½áÊøÁËÃÆÈȵĿÕÆøÁË¡£ÒÔÇ°½ÌÊÒ¿Õµ÷´ó´óµÄÓÐÎÊÌ⣬ÏÖÔÚºÃÁË£¬¿ÉÒÔÒ»Ïí¿Õµ÷µÄÁ¹Ë¬£¬Ö»²»ÊÇΨһÃÀÖв»×ãµÄÊÇ£¬¾ÓÈ»ÓõIJ»ÊǸñÁ¦¿Õµ÷¡£ÔÚ¸ñÁ¦¿Õµ÷´ôÁËËÄÄ꣬ËäÈ»ÔÚÄǶùûÓз¢»Ó³öÎÒ¸üºÃµÄˮƽ£¬µ«ÊÇÈ˱Ͼ¹ÊÇÓиÐÇéµÄ£¬ÎÒÒ²ºÜ°®ÄǸö¸ñÁ¦£¬´ó¹«Ë¾£¬´óÆøÆÇ£¬ÌرðÊÇ£¬ÎÒà ......
1¡¢Oracle8/8i/9iÊý¾Ý¿â£¨thinģʽ£©
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl"; //orclΪÊý¾Ý¿âµÄSID
String user="test";
String password="test";
Connection conn= DriverManager.getConnection(url,user,password);
2¡¢DB ......
×Ö·û´®
1¡¢»ñÈ¡×Ö·û´®µÄ³¤¶È
length()
2 ¡¢ÅжÏ×Ö·û´®µÄǰ׺»òºó׺ÓëÒÑÖª×Ö·û´®ÊÇ·ñÏàͬ
ǰ׺ startsWith(String s)
ºó׺ endsWith(String s)
3¡¢±È½ÏÁ½¸ö×Ö·û´®
equals(String s)
4¡¢°Ñ×Ö·û´®×ª»¯ÎªÏàÓ¦µÄÊýÖµ
intÐÍ Integer.parseInt(×Ö·û´®)
......