java¸ñʽ»¯ÈÕÆÚʱ¼äµÄº¯Êý
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyÄêMMÔÂddÈÕ HH:mm:ss");
System.out.println(sdf.format(date));
SimpleDateFormat sdf2 = new SimpleDateFormat("MM");
System.out.println(sdf2.format(date));
Calendar c = Calendar.getInstance();
System.out.println(c.get(Calendar.MONTH)+1);
Date d=new Date(2010,5,12,13,24,30);
c.setTime(d);
System.out.println(c.get(Calendar.MONTH)+1);
--------------------------------------------------------------------
test=new JdbcTest();
String sql="{call proc_select3(?)};"; //µ÷ÓÃÓï¾ä
try {
CallableStatement proc=test.getConnection().prepareCall(sql);
proc.setString(1, "ÄÐ");
//proc.execute();
ResultSet rs= proc.executeQuery();
while(rs.next())
{
System.out.print("id: "+rs.getInt("id"));
System.out.print(" userName :"+rs.getString("username"));
System.out.print(" age :"+rs.getInt("age"));
System.out.println(" sex :"+rs.getString("sex"));
Timestamp time=rs.getTimestamp("birthday");
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(">>>>>>>>>>>>>>>>>>"+sdf.format(time));
System.out.println(" birthday :"+rs.getDate("birthday"));
}
} catch (SQLException e) {
// TODO ×Ô¶¯Éú³É catch ¿é
e.printStackTrace();
}
Ïà¹ØÎĵµ£º
ÔçÉÏÆð´²ÓеãÍíÁË£¬µ½Ñ§Ð£µÃʱºò¶¼8£º50ÁË£¬Ò»½ø½ÌÊÒ¿´¼ûÕÅТÏéÀÏʦÔÚ½ÌÊÒÀï¸øͬѧÃǽâ¾öÎÊÌ⣬²»¼ûÁËÀϱϵÄÉíÓ°£¬»¹ÒÔΪ×ß´í½ÌÊÒÁËÄØ£¬°´Àí˵Õâ¸öʱºòÀϱÏÓ¦¸ÃÔçÀ´Á˲ÅÊÇ£¬Ò»ÎʲÅÖªµÀÊDZÏÀÏʦ²¡ÁË,È¥Ò½Ôº¼ì²éÈ¥ÁË£¬Ï£Íû±ÏÀÏʦÄÜÔçµãºÃÆðÀ´£¡
½ñÌìÊÇÕÅÀÏʦ¸øÎÒÃÇÉϿΣ¬ÉîÈëÆÊÎöservlet£¬ÔÚûÀ´´«ÖDz¥¿Í֮ǰ¿´¹ý²»ÉÙÒÔÇ°ÕÅÀ ......
java´úÂëÓÅ»¯±à³Ì
1.JVM ¹ÜÀíÁ½ÖÖÀàÐ͵ÄÄÚ´æ:¶ÑÄÚ´æ(heap),Õ»ÄÚ´æ(stack),¶ÑÄÚÔÚÖ÷ÒªÓÃÀ´´æ´¢³ÌÐòÔÚÔËÐÐʱ´´½¨»òʵÀý»¯µÄ¶ÔÏóÓë±äÁ¿.¶øÕ»ÄÚ´æÔòÊÇÓÃÀ´´æ´¢³ÌÐò´úÂëÖÐÉùÃ÷Ϊ¾²Ì¬(static)(»ò·Ç¾²Ì¬)µÄ·½·¨.
2.JVM ÖжÔÏóµÄÉúÃüÖÜÆÚ,´´½¨½×¶Î,Ó¦Óý׶Î,²»¿ÉÊӽ׶Î,²»¿Éµ½´ï½×¶Î,¿ÉÊÕ¼¯½×¶Î,ÖÕ½á½×
¶Î,ÊͷŽ׶Î
3.±ÜÃâÔÚÑ ......
ÏÈÌùÒ»¶Î
Java
»ù±¾½á¹¹
Java
½á¹¹°üÀ¨Ëĸö²»Í¬¶øÓÖÏà¹ØµÄ²¿·Ö£º
Java
ÓïÑÔ¡¢
class
Îļþ¸ñʽ¡¢Ó¦ÓóÌÐò½Ó
¿Ú¡¢ÐéÄâ»ú
ÆäÖУ¬ÐéÄâ»úµÄÖ÷ÒªÈÎÎñÊÇÔÚ³ÌÐòÔËÐÐÖÐÐèÒªµÄʱºòµ÷ÓÃ
class
Îļþ²¢Ö´ÐÐÆäÖеÄ×Ö½ÚÂë¡£Ò»¸ö
Java
Ó¦
ÓÃÓÐÁ½ÖÖ
class loader
£º
the system class loader
ºÍ
class loader objects
......
¶àÏ̳߳ÌÐò
¶ÔÓÚ¶àÏ̵߳ĺô¦Õâ¾Í²»¶à˵ÁË¡£µ«ÊÇ,ËüͬÑùÒ²´øÀ´ÁËijЩеÄÂé·³¡£Ö»ÒªÔÚÉè¼Æ³ÌÐòʱÌرðСÐÄÁôÒâ,¿Ë·þÕâЩÂé·³²¢²»ËãÌ«À§ÄÑ¡£
(1)ͬ²½Ïß³Ì
Ðí¶àÏß³ÌÔÚÖ´ÐÐÖбØÐ뿼ÂÇÓëÆäËûÏß³ÌÖ®¼ä¹²ÏíÊý¾Ý»òе÷Ö´ÐÐ״̬¡£Õâ¾Í ÐèҪͬ²½»úÖÆ¡£ÔÚJavaÖÐÿ¸ö¶ÔÏó¶¼ÓÐÒ»°ÑËøÓëÖ®¶ÔÓ¦¡£µ«Java²»Ìṩµ¥¶ÀµÄlockºÍunlock²Ù×÷¡£ ......
/*
Function name: myGetHttpFile2
Description: ÅÀÍøÒ³ÓÃ
Input: URL ÀýÈç:http://www.126.com
Output: ×Ö·û´®,ÍøÒ³µÄHTML
*/
public String myGetHttpFile2(String url){
String authentication=null;
ArrayList al=new ArrayList();
String PageURL = url;
......