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

Javaµ÷ÓÃSybase´æ´¢¹ý³Ì

ÕªÖÁSybase¹ÙÍø:
The caller( ) method calls the stored procedure inoutproc:
create proc inoutproc @id int, @newname varchar(50), @newhome Address,
@oldname varchar(50) output, @oldhome Address output as

select @oldname = name, @oldhome = home from xmp where id=@id
update xmp set name=@newname, home = @newhome where id=@id
This procedure has three input parameters (@id, @newname, and @newhome) and two output parameters (@oldname and @oldhome). caller( ) sets the name and home columns of the row of table xmp with the ID value of @id to the values @newname and @newhome, and returns the former values of those columns in the output parameters @oldname and @oldhome.
The inoutproc procedure illustrates how to supply input and output parameters in a JDBC call.
caller( ) executes the following call statement, which prepares the call statement:
CallableStatement cs = con.prepareCall("{call inoutproc (?, ?, ?, ?, ?)}");
All of the parameters of the call are specified as parameter markers (?).
caller( ) supplies values for the input parameters using JDBC setInt( ), setString( ), and setObject( ) methods that were used in the doSQL( ), updatAction( ), and selecter( ) methods:
cs.setInt(1, id);
cs.setString(2, newName);
cs.setObject(3, newHome);
These set methods are not suitable for the output parameters. Before executing the call statement, caller( ) specifies the datatypes expected of the output parameters using the JDBC registerOutParameter( ) method:
cs.registerOutParameter(4, java.sql.Types.VARCHAR);
cs.registerOutParameter(5, java.sql.Types.JAVA_OBJECT);
caller( ) then executes the call statement and obtains the output values using the same getString( ) and getObject( ) methods that the selecter( ) method used:
int res = cs.executeUpdate();
String oldName = cs.getString(4);
Address oldHome = (Address)cs.getObject(5);
ÉèÖÃÊä³öΪjava.sql.Types.JAVA_OBJECTÀàÐͺ󣬿ÉÒÔǿת³ÉÈ


Ïà¹ØÎĵµ£º

Java±ÊÊԱؿ¼Ì⣨¶þ£©µ½µ×´´½¨Á˼¸¸öString¶ÔÏó

ÎÒÃÇÊ×ÏÈÀ´¿´Ò»¶Î´úÂ룺
Java´úÂë £º
String str=new String("abc");
½ô½Ó×ÅÕâ¶Î´úÂëÖ®ºóµÄÍùÍùÊÇÕâ¸öÎÊÌ⣬ÄǾÍÊÇÕâÐдúÂ뾿¾¹´´½¨Á˼¸¸öString¶ÔÏóÄØ£¿Ïà
ÐÅ´ó¼Ò¶ÔÕâµÀÌâ²¢²»Ä°Éú£¬´ð°¸Ò²ÊÇÖÚËùÖÜÖªµÄ£¬2¸ö¡£½ÓÏÂÀ´ÎÒÃǾʹÓÕâµÀÌâÕ¹¿ª£¬Ò»Æð
»Ø¹ËÒ»ÏÂÓë´´½¨String¶ÔÏóÏà¹ØµÄһЩJAVA֪ʶ¡£
ÎÒÃÇ¿ÉÒÔ°ÑÉÏÃæÕâÐдúÂë· ......

ÀûÓÃJavaʵÏÖѹËõÓë½âѹËõ£¨zip¡¢gzip£©Ö§³ÖÖÐÎÄ·¾¶

¹Ø¼ü×Ö: zip gzip
zip°çÑÝ׏鵵ºÍѹËõÁ½¸ö½ÇÉ«£»gzip²¢²»½«Îļþ¹éµµ£¬½öÖ»ÊǶԵ¥¸öÎļþ½øÐÐѹËõ£¬ËùÒÔ£¬ÔÚUNIXƽ̨ÉÏ£¬ÃüÁîtarͨ³£ÓÃÀ´´´½¨Ò»¸öµµ°¸Îļþ£¬È»ºóÃüÁîgzipÀ´½«µµ°¸ÎļþѹËõ¡£
Java
I/OÀà¿â»¹ÊÕ¼ÁËһЩÄܶÁдѹËõ¸ñʽÁ÷µÄÀà¡£ÒªÏëÌṩѹËõ¹¦ÄÜ£¬Ö»Òª°ÑËüÃÇ°üÔÚÒÑÓеÄI/OÀàµÄÍâÃæ¾ÍÐÐÁË¡£ÕâЩÀ಻ÊÇReader ......

JavaÖи÷ÀàCache»úÖÆʵÏÖ½â¾ö·½°¸

ÔÚJavaÖУ¬²»Í¬µÄÀ඼ÓÐ×Ô¼ºµ¥¶ÀµÄCache»úÖÆ£¬ÊµÏֵķ½·¨Ò²¿ÉÄÜÓÐËù²»Í¬£¬ÎÄÕÂÁоÙÁËJavaÖг£¼ûµÄ¸÷ÀàCache»úÖƵÄʵÏÖ·½·¨£¬Í¬Ê±½øÐÐÁË×ۺϵıȽϡ£
OSCache
OSCacheÊǸöÒ»¸ö¹ã·º²ÉÓõĸßÐÔÄܵÄJava EE»º´æ¿ò¼Ü£¬OSCacheÄÜÓÃÓÚÈκÎJavaÓ¦ÓóÌÐòµÄÆÕͨµÄ»º´æ½â¾ö·½°¸¡£
OSCacheÓÐÒÔÏÂÌص㣺»º´æÈκζÔÏó£¬Äã¿ÉÒÔ²»ÊÜÏÞÖƵ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ