Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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Öм¯ºÏÈÝÆ÷ÀàListºÍSetµÄÓ÷¨

ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1  List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......

Java+FlexÕûºÏÓ¦Óüòµ¥Ê¾Àý (mx:RemoteObject)

1.java
Java´úÂë
package com;    
  
public class LoginDemo {    
        
    public String validate(String username,String password){    
   &nb ......

TomcatÖÐJAVA¶¨Ê±Æ÷ʵÏÖ


Ô­ÎÄÁ´½Ó£ºhttp://badwing.javaeye.com/blog/674263
ÎÄÕ·ÖÀà:Java±à³Ì
ºÃ¶àÅóÓÑÓùýWindowsµÄÈÎÎñ¼Æ»®£¬Ò²Óв»ÉÙ³ÌÐòÃÔ×Ô¼ºÔøÐ´¹ýʱÖÓ±¨¾¯¡¢ÏµÍ³×Ô¶¯¹Ø»úµÈȤζ³ÌÐò£¬¿ÉÈ´ºÜÉÙÓÐÅóÓÑÔÚWeb¹¤³ÌÖÐʵÏÖ¹ýÀàËÆ¹¦ÄÜ¡£ 
µ±Web¹¤³ÌÆô¶¯Ê±£¬¶¨Ê±Æ÷ÄÜ×Ô¶¯¿ªÊ¼¼ÆÊ±£¬ÔÚÕû¸öWeb¹¤³ÌµÄÉúÃüÆÚÀ¶¨Ê±Æ÷ÄÜÔÚÿÍíÉîÒ¹´¥·¢Ò»´ÎÈ ......

javaÒì³£»úÖÆ¼òÒª·ÖÎö

×òÌì¿´µ½Ò»¸öÌâÄ¿£ºjavaÒì³£»úÖÆºÍÀ¬»ø´¦Àí»úÖÆ£¬·¢ÏÖÆ½Ê±ÓõÄʱºòҲû̫עÒ⣬ÄùýÀ´¾ÍÓá£Ñ§Ï°Õâ¶«Î÷¾ÍµÃ²»¶Ï×ܽᡢ»ýÀÛ£¬²»È»Ê±¼ä³¤»¹Ë­»¹¼ÇµÃËü³¤É¶Ñù¡£
javaÒì³£»ù±¾¸ÅÄî¾Í²»ÓÃ˵ÁË£¬
javaÒì³£Ö÷Òª·ÖΪÈýÀࣺ
  1£©±àÒëʱÒì³£java.lang.Exception
   2)ÔËÐÐʱÒì³£ java.lang.RuntimeException
&nb ......

java compare ½Ó¿Ú

1.±È½Ïºó£¬·µ»Ø0,1,-1 µÄ½á¹û£¬¿ÉÒÔÓÃ
   return (thisVal<anotherVal ? -1 : (thisVal==anotherVal ? 0 : 1));
ЧÂʸü¸ß
ÒÔÏÂת×Ô http://bluelzx.javaeye.com/blog/200987
1.
Á½ÖֱȽϽӿڷÖÎö
ÔÚ

¼¯ºÏ¿ò¼Ü

ÖÐÓÐÁ½ÖֱȽϽӿڣº
Comparable
½Ó¿ÚºÍ
Comparator
½Ó¿Ú¡£
Compara ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ