java¶ÔÊý¾Ý¿âÖÐNULLµÄ´¦Àí
javaÖÐnullµÄ¸ÅÄî:javaÖУ¬null±íʾÀà»ò±äÁ¿ÊÇ¿Õ£¬²»´ú±íÈκζÔÏó»òʵÀý£¬¿ÉÒÔ½«null¸³¸øÒýÓÃÀàÐͱäÁ¿£¬µ«²»¿ÉÒÔ½«null¸³¸ø»ù±¾ÀàÐͱäÁ¿¡£Êý¾Ý¿âÖÐNULLµÄ¸ÅÄî:Êý¾Ý¿âÖУ¬null±íʾδÌîд¡¢Î´Öª¡¢²»¿ÉÓõĸÅÄºÍjava²»Í¬µÄÊÇÊý¾Ý¿âÖпÉÒÔ½«null¸³¸øÈκÎÊý¾ÝÀàÐÍ¡£ÕâÑùÒ»À´£¬ÎÒÃÇ´ÓÊý¾Ý¿âÖжÁÈ¡×ֶεÄÖµºó£¬ÔÚjava³ÌÐòÖÐÈçºÎÅж϶ÁÈ¡µÄÖµÊÇ·ñΪnullÄØ£¿ÓÃx==null·½·¨Âð£¿ÏÔÈ»²»ÐУ¬³ý·ÇÕâ¸öXÊÇStringÀàÐ͵ġ£ResultSetÖеÄwasNull()·½·¨¿ÉÒÔ½â¾öÕâ¸öÎÊÌâ:
wasNull():±¨¸æ×îºóÒ»¸ö¶ÁÈ¡µÄÁÐÊÇ·ñ¾ßÓÐÖµ SQL NULL¡£×¢Ò⣬±ØÐëÊ×ÏȶÔÁе÷ÓÃÒ»¸ö»ñÈ¡·½·¨³¢ÊÔ¶ÁÈ¡ÆäÖµ£¬È»ºóµ÷Óà wasNull ·½·¨²é¿´¶ÁÈ¡µÄÖµÊÇ·ñΪ SQL NULL¡£
È磺String value="";
int n;
while(rs.next()){
value=rs.getString("name");
if(rs.wasNull()){
System.out.println("null");
}else{
System.out.println(value);
}
n=rs.getInt("number");
if(rs.wasNull()){
System.out.println("null");
}else{
System.out.println(n);
}
}
Ïà¹ØÎĵµ£º
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
public class DealFile {
/**
* ɾ³ýÎļþ
......
ÔÎÄ´«ËÍÃÅ£ºhttp://solodu.javaeye.com/blog/454546
JDK1.5ÖУ¬StringÀàÐÂÔöÁËÒ»¸öºÜÓÐÓõľ²Ì¬·½·¨String.format():ÏÖÓÐÒ»¸öʱ¼ä'20090903'Ҫת»¯³ÉÖ¸¶¨Ê±¼äµÄjava.util.Date¸ñʽ
private Date getStartGregorianTime(String date) {
Date d_date = DateUtil.parseDate(date);
int year = new ......
HTTP(Hyper-Text Transfer Protocol)Êǵ±Ç°ÒòÌØÍøÉÏʹÓÃ×î¶àµÄÐÒé¡£ÍøÂç·þÎñ£¬ÍøÂçÉ豸ÒÔ¼°ÍøÂç¼ÆËãµÄÔö³¤²»½öÔö¼ÓÁËÐèÒªHTTPÖ§³ÖµÄµÄÓ¦ÓóÌÐò£¬»¹À©Õ¹ÁËHTTPµÄ½ÇÉ«£¬Ê¹Æä²»½ö½öÓ¦ÓÃÓÚÓû§Çý¶¯µÄwebä¯ÀÀÆ÷¡£ java.net°üÌṩͨ¹ýHTTP·ÃÎÊ×ÊÔ´µÄ»ù±¾¹¦ÄÜ¡£HttpClientÉ跨ͨ¹ýʵÏÖÒ»¸ö¸ßЧµÄ£¬×îеģ¬¹¦ÄܷḻµÄHttp¿Í»§¶ËÀ ......
java»ù´¡¼¼Êõ֪ʶ¸´Ï°
Ò»¡¢ ¼ÆËã»ú»ù´¡ÖªÊ¶£º°üÀ¨Êý¾Ý½á¹¹ÖеĻù±¾Ëã·¨£¬¼ÆËã»úÍøÂçµÄOSI£¬TCP/IPÄ£ÐÍ¡£
¼ÆËã»úÍøÂçµÄOSI£ºOSI(Open System Interconnnection OSI)¿ª·Åʽϵͳ»¥Á¬£¬ ÊÇÓɹú¼Ê»¯±ê×¼×éÖ¯£¨ISO£©Öƶ¨µÄ±ê×¼»¯¿ª·ÅʽµÄ¼ÆËã»úÍøÂç²ã´Î½á¹¹Ä£ÐÍ ......
java exception ½â¾ö·½°¸ - ÎÒµÄÒì³£Íø|Òì³£|exception|myexception 831 - ActionMessages 832 - could not instantiate id generator 833 - javax.servlet.jsp.JspException 834 - javax.naming.NoInitialContextException 835 - net.sf.hibernate.HibernateException 836 - org.hibernate.exception.GenericJDBCExceptio ......