javaÈÕÆÚ´¦Àí - Java / Java SE
µ±ÖªµÀÒ»¸öÈÕÆÚ£¬ÈçºÎ°ÑÕâ¸öÈÕÆÚËùÔÚÑ®µÄÇ°ºóÁ½¸öÈÕÆÚÈ¡³ö
±ÈÈçÊäÈë20090905£¬¾ÍÊäÈë20090901 20090910
Êä³ö20090901 20090910
È¡µÃÌìÊýºó×÷Ò»ÏÂÅжÏÔÙ°ÑÕâ¸ö·½·¨ÓÃÏÂvoid set(int field, int value)
Ó¦¸Ã¾Í¿ÉÒÔÁË¡£
·ÖÉÙÁË°É
Ñ®?
ÏȽØÈ¡³öÄêÔÂÈÕ (d="20090905")
year=Integer.valueOf(d.substring(0,4));
month=Integer.valueOf(d.substring(4,6));
day=Integer.valueOf(d.substring(6,8));
ÔÙÓÃdayÈ¥ÅжÏÔÚÄĸöÑ®ÄÚ ÓÃ×Ö·û´®µÄappend()·½·¨×·¼Ó¾Í¿ÉÒÔÁË°É ¶ÔÓÚÂ¥Ö÷ÕâÑùµÄÐèÇó
public String getTime(String s){
java.util.Date d=null;
try {
d=(java.util.Date)new SimpleDateFormat("yyyyMMdd").parse(s);
} catch (ParseException e) {
e.printStackTrace();
}
String s1=new java.sql.Date(d.getTime()-5*86400000).toString().replaceAll("-", "");//Ç°5Ìì
String s2=new java.sql.Date(d.getTime()+5*86400000).toString().replaceAll("-", "");//ºó5Ìì
System.out.println(s1+" "+s2);
return s1+" "+s2;
}
дÍê²Å·¢ÏÖ£¬Ã²ËƲ»ÊÇÂ¥Ö÷ÒªµÄ£¬²»ºÃÒâ˼¡£
ÕâÑù¾Í¿ÉÒÔÁËô¡£
public static void getTime() {
String str = "20090225";
StringBuilder sb = new StringBuilder();
Date date = null;
try {
date = dateformat.parse(str);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.p[code=Java][/c
Ïà¹ØÎÊ´ð£º
ÎҵĿª·¢µÄƽ̨ÊÇMyeclipes6.0 + tomcat5.x + mysql
ÎÒËùÓеıàÂ뷽ʽ¶¼ÊÇÓõÄUTF-8
ÎÒÖ»ÓÃÁËStrtus¿ò¼Ü
ÔÚÒ»¸öformÖÐÈçÏÂÓõÄÊÇpostµÄÌá½»·½Ê½£º
<form class="form" action=&quo ......
×Ö·ûÁ÷µÄ¶ÁºÍд×îÖÕÔڵײ㶼ÊÇͨ¹ý×Ö½ÚÁ÷À´Íê³ÉµÄÂ𣿡¡¶ÁдÎı¾Îļþ×Ö·ûÁ÷Ó¦¸Ã¾Í¿ÉÒÔÁË°É¡£¡£
¸÷λ´ó¸ç´ó½ã°ï°ïæ°¢
JavaÁ÷°üÀ¨×Ö½ÚÁ÷ºÍ×Ö·ûÁ÷£¬×Ö½ÚÁ÷ͨ¹ýIOÉ豸ÒÔ×Ö½ÚÊý¾ÝµÄ·½Ê½¶ÁÈ룬¶ø×Ö·ûÁ÷ÔòÊÇͨ¹ý×Ö½ÚÁ÷ ......
ÎÒµÄjava applet ǶÈëhtmlºóÎÞ·¨ÏÔʾ£¬¶øÓÃappletviewerÏÔʾÕý³£ÎªÊ²Ã´£¬»¹ÓоÍÊÇÓÃhtml converterת»¯ºó¿ÉÒÔÏÔʾ£¬ÎªÊ²Ã´£¿Çë´óÏÀ´Í½Ì£¡
HTML code:
<HTML>
<HEAD>
<TITLE>TEST.HTML< ......
JAVA×î¸ßЧµÄ¿ª·¢¼Ü¹¹ÊÇʲô£¿
¹úÇì·Å¼ÙÕ⼸ÌìÓÐʱ¼ä˼¿¼Ò»Ð©Æ½Ê±²»ÄÜ˼¿¼µÄÊÂÇé¡£ÆäÖÐÖ®Ò»¾ÍÊÇJAVA×î¸ßЧµÄ¿ª·¢¼Ü¹¹ÊÇʲô¡£
ÎÒÃǹ«Ë¾ÓÃappfuse¼Ü¹¹¿ª·¢£¬ÕæÂý°¡£¡ÕæµÄ£¬Ò»¸ö´óÏîÄ¿µÄ¿ª·¢°Ñʱ¼ä¶¼À˷ѵ½ÅäÖÃÉ ......
ÓÃRandomAccessFileдÈëTXTÎļþ²é¿´Ê±ÊÇÂÒÂ룬ÇëÎÊÓÐʲô·½·¨¿ÉÒÔд³É¿É¶ÁµÄÎļþ£¬²»ÊÇÓÃÆäËûµÄÎļþ²Ù×÷£¬¾ÍÊÇÖ»ÓÃRandomAccessFileµÄ·½·¨ÊÇ·ñ¿ÉÒÔʵÏÖ£¿
Java code:
import java.io.*;
public class RandomAcce ......