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

javaµ÷Óô洢¹ý³Ì

 
A:²»´øÊä³ö²ÎÊýµÄ
  ---------------²»´øÊä³ö²ÎÊýµÄ----------------------------------
create procedure getsum
@n int =0<--´Ë´¦Îª²ÎÊý-->
as
declare @sum int<--¶¨Òå±äÁ¿-->
declare @i int
set @sum=0
set @i=0
while @i<=@n begin
set @sum=@sum+@i
set @i=@i+1
end
print 'the sum is '+ltrim(rtrim(str(@sum)))
--------------ÔÚSQLÖÐÖ´ÐÐ:--------------------
exec getsum 100
------------ÔÚJAVAÖе÷ÓÃ:---------------------
JAVA¿ÉÒÔµ÷Óà µ«ÊÇÔÚJAVA³ÌÐòÈ´²»ÄÜÈ¥ÏÔʾ¸Ã´æ´¢¹ý³ÌµÄ½á¹û ÒòΪÉÏÃæµÄ´æ´¢
¹ý³ÌµÄ²ÎÊýÀàÐÍint ´«µÝ·½Ê½ÊÇin(°´Öµ)·½Ê½
import java.sql.*;
public class ProcedureTest
{
public static void main(String args[]) throws Exception
{
//¼ÓÔØÇý¶¯
DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
//»ñµÃÁ¬½Ó
Connection conn=DriverManager.getConnection("jdbc:odbc:mydata","sa","");
    //´´½¨´æ´¢¹ý³ÌµÄ¶ÔÏó
    CallableStatement c=conn.divpareCall("{call getsum(?)}");
   
    //¸ø´æ´¢¹ý³ÌµÄ²ÎÊýÉèÖÃÖµ
    c.setInt(1,100); //½«µÚÒ»¸ö²ÎÊýµÄÖµÉèÖóÉ100
   
    //Ö´Ðд洢¹ý³Ì
    c.execute();
    conn.close();
}
}
 
B:´øÊä³ö²ÎÊýµÄ
  1:·µ»Øint
    -------------------------´øÊä³ö²ÎÊýµÄ----------------
alter procedure getsum
@n int =0,
@result int output
as
declare @sum int
declare @i int
set @sum=0
set @i=0
while @i<=@n begin
set @sum=@sum+@i
set @i=@i+1
end
set @result=@sum
  -------------------ÔÚ²éѯ·ÖÎöÆ÷ÖÐÖ´ÐÐ------------
declare @myResult int
exec getsum 100,@myResult output
print @myResult
  ------------ÔÚJAVAÖе÷ÓÃ---------------------
import java.sql.*;
public class ProcedureTest
{
public static void main(String args[]) throws Exception
{
//¼ÓÔØÇý¶¯
DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
//»ñµÃÁ¬½Ó
Connection conn=DriverManager.getConnection("jdbc:odbc:mydata","sa","");
&nbs


Ïà¹ØÎĵµ£º

JavaµÄÊ®´óʼþ


1990£­1994£ºJavaÔµÆð
Larry Wall˵£¬ÓÅÐã³ÌÐòÔ±Ó¦ÓеÄÈý¸öÌصã:ÀÁ¶è¡¢¼±ÔêºÍ°ÁÂý¡£Java¾ÍÊǵ®ÉúÔÚһȺÀÁ¶è¡¢¼±Ôê¶ø°ÁÂýµÄ³ÌÐòÌì²ÅÖ®ÖС£
1990Äê12Ô£¬SunµÄ¹¤³ÌʦPatrick Naughton±»µ±Ê±Ôã¸âµÄSun C++¹¤¾ßÕÛÄ¥µÄ¿ì·èÁË¡£Ëû´óÉù±§Ô¹£¬²¢ÍþвҪÀ뿪SunתͶµ±Ê±ÔÚSteve JobsÁ쵼֮ϵÄNeXT¹«Ë¾¡£Áìµ¼²ãΪÁËÁôסËû£¬¸øËû ......

JAVA´úÂëС¼¼ÇÉ£¬ÊµÊ±¸üУ¬¸üе½20100107

    ÔÚCSDNÖп´µ½Á˸öÓйØjava¼¼ÇɵÄÌû×Ó£¬¾õµÃ·Ç³£ÓÐÓ㬿ÉÒÔ±ÜÃ⿪·¢¹ý³ÌÖвúÉúµÄһЩµÍ¼¶µÄ´íÎó£¬Ìû×Ó±¾ÉíÒѾ­½øÐÐÁË×ܽᣬÎÒÌô³öÁËÆäÖÐһЩ¸öÈ˾õµÃƽʱ¿ª·¢¹ý³ÌÖÐÓÐÓõIJ¿·Ö£¬ÔÙ¼ÓÉÏ×Ô¼ºÔÚ¹¤×÷ÖÐѧµ½µÄ¼¼ÇÉ£¬ÕûÀíÔÚ±¾ÎÄÖУ¬²¢Ëæ×Åʱ¼äʵʱ¸üÐÂ
1¡¢Ð´ºÃ×¢ÊÍ¡£ÊäÈë²ÎÊý¡¢Êä³öÀàÐÍ¡¢·½·¨¹¦ÄÜ£¬°ÑÕâÈýµãÃè ......

JXL(Java Excel API)

ʹÓÃWindows²Ù×÷ϵͳµÄÅóÓѶÔExcel£¨µç×Ó±í¸ñ£©Ò»¶¨²»»áÄ°Éú£¬µ«ÊÇҪʹÓÃJavaÓïÑÔÀ´²Ù×ÝExcelÎļþ²¢²»ÊÇÒ»¼þÈÝÒ×µÄÊ¡£ÔÚWebÓ¦ÓÃÈÕÒæÊ¢ÐеĽñÌ죬ͨ¹ýWebÀ´²Ù×÷ExcelÎļþµÄÐèÇóÔ½À´Ô½Ç¿ÁÒ£¬Ä¿Ç°½ÏΪÁ÷ÐеIJÙ×÷ÊÇÔÚJSP»òServlet Öд´½¨Ò»¸öCSV £¨comma separated values£©Îļþ£¬²¢½«Õâ¸öÎļþÒÔMIME£¬text/csvÀàÐÍ·µ»Ø¸øä¯ÀÀÆ ......

¸ø³õѧÕßÎÄÕ£¬³õѧÕßѧϰJavaӦעÒâʲô£¿

Java×ÜÓÐËüµÄǧ°ãºÃ´¦Ê¹ÄãÑ¡ÔñËü£¬µ«ÕâЩËæ±ã·­·­Êé»òÔÚÍøÉϹäһȦ¾ÍÄÜÕÒµ½´ð°¸¡£ÔÚ±¾ÎÄÖУ¬±ÊÕß°Ñ×Ô¼ºÑ§Ï°JavaµÄһЩÇÐÉíÌå»áºÍ¹ý³Ìд³öÀ´£¬¹©³õѧÕß×ö¸ö²Î¿¼¡£
http://school.itzcn.com/special-spid-50.html
¡¡¡¡ÎÒÔÚѧϰJavaµÄ¹ý³ÌÖÐÖ÷ҪΧÈÆÒÔϼ¸¸ö·½ÃæÀ´Ñ§Ï°£º
¡¡¡¡1.ʱ¿ÌÌáÐÑ×Ô¼ºJavaÊÇÒ»ÖÖOOPÓïÑÔ¹¤¾ß£¬¶ø²»½ö½ ......

ǿתJAVAÊý×é

ǿתһ¸öÊý×éÀàÐÍ ±ØÐëҪѭ»·±éÀú
±ÈÈç
 B[] b;
 //A¼Ì³ÐB;
A[] a= (A[])b;
ÕâÑùתÊDz»Äܳɹ¦µÄ
ÕâÊÇΪʲô£¿ÈçºÎ½â¾ö£¿
Ò²¾ÍÊÇ˵
for( int i=0;  i<b.length;  i++ )
{
    a[i]=(A)b[i];
}
ÕâÑùת£¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ