Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaµ÷Óô洢¹ý³ÌµÄÀý×Ó

package protest;
import java.sql.*;
/**
 create proc proc_select
             @lname varchar(20),
             @address varchar(20) output
as
        select   @address=address from userinfo where loginname=@lname
GO
 */
public class ProExecute {
    public ProExecute() {
    }
    public static void main(String args[]) {
       try{
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");//¼ÓÔØÇý¶¯
        Connection con = DriverManager.getConnection("Jdbc:Odbc:test", "sa", "sa"); //»ñµÃÁ¬½Ó
        String call = "{call proc_select(?,?)}"; //µ÷ÓÃÓï¾ä
        CallableStatement proc = con.prepareCall(call); //µ÷Óô洢¹ý³Ì
        proc.setString(1, "zhangdan"); //¸øÊäÈë²ÎÊý´«Öµ
        proc.registerOutParameter(2,Types.VARCHAR); //ÉùÃ÷Êä³ö²ÎÊýÊÇʲôÀàÐ͵Ä,¶¨ÒåÓÃÓÚ±êʶһ°ã SQL ÀàÐÍ£¨³ÆΪ JDBC ÀàÐÍ£©µÄ³£Á¿µÄÀà
        proc.execute(); //Ö´ÐÐ
        String address = proc.getString(2); //»ñµÃÊä³ö²ÎÊý
        System.out.println(address);
       } catch(Exception e){
            e.printStackTrace();
        }
    }
}


Ïà¹ØÎĵµ£º

Java NIO APIÏê½â

 
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......

java×Ü½á µÚ¾ÅÕÂ

µÚ¾ÅÕÂ
»ùÓÚÎı¾µÄjavaÓ¦ÓóÌÐò
inputsreamreader is=new inputstreamreader(system.in)
bufferedreader br=new bufferedreader(is)
s=br.readline();
while(!s.euqal("")){}
FLIE f=new file()
filereader ÒÔ×Ö·ûΪµ¥Î»
bufferedreaderÀàµÄreadline
ÒÔÐÐΪµ¥Î»¶ÁÈëÒ»ÐÐ×Ö·û
filewriterÒÔ×Ö·ûΪµ¥Î»ÏòÎļþд³öÊý¾ ......

JavaÓëXMLÁªºÏ±à³ÌÖ®SAXƪ


SAX¸ÅÄî

SAXÊÇSimple API for XML
µÄËõд£¬Ëü²¢²»ÊÇÓÉW3C¹Ù·½ËùÌá³öµÄ±ê×¼£¬¿ÉÒÔ˵ÊÇ“Ãñ¼ä”µÄÊÂʵ±ê×¼¡£Êµ¼ÊÉÏ£¬ËüÊÇÒ»ÖÖÉçÇøÐÔÖʵÄÌÖÂÛ²úÎï¡£ËäÈ»Èç´Ë£¬ÔÚXMLÖжÔSAXµÄÓ¦ÓÃË¿ºÁ²»±ÈDOMÉÙ£¬¼¸ºõËùÓеÄXML½âÎöÆ÷¶¼»áÖ§³ÖËü¡£

Óë
DOM±È½Ï¶øÑÔ£¬SAXÊÇÒ»ÖÖÇáÁ¿Ð͵ķ½·¨¡£ÎÒÃÇÖªµÀ£¬ÔÚ´¦ÀíDOMµÄʱºò£¬Î ......

JAVA xml LSParserFilterµÄÓ¦ÓÃ

LSParserFilter---ÔØÈëÓë±£´æ
Ó¦ÓÃorg.w3c.dom ʵÏÖXMLµÄÔØÈëÓë±£´æʵÀý
/**
* ʵÏÖDOM3µÄLS(Load & Save)¹¦ÄÜ
*
* @author S.Well
* @see org.w3c.dom.DOMErrorHandler
* @see org.w3c.dom.ls.LSParserFilter
*/
public class XML_LS implements DOMErrorHandler, LSParserFilter {
private static ......

javaÃæÊÔ

Ò»¡¢ÃæÏò¶ÔÏóµÄÌØÕ÷ÓÐÄÄЩ·½Ãæ
    1.³éÏó£º
    ³éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
    2 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ