JAVA´æ´¢¹ý³ÌºÍµ÷ÓÃ
´úÂëÄÚÈÝ
create or replace procedure batchUpdateCustomer(p_age in number) as
begin
update CUSTOMERS set AGE=AGE+1 where AGE>p_age;
end;
ÒÔÉÏ´æ´¢¹ý³ÌÓÐÒ»¸ö²ÎÊýp_age£¬´ú±í¿Í»§µÄÄêÁ䣬ӦÓóÌÐò¿É°´ÕÕÒÔÏ·½Ê½µ÷Óô洢¹ý³Ì£º
´úÂëÄÚÈÝ
tx = session.beginTransaction();
Connection con=session.connection();
String procedure = "{call batchUpdateCustomer(?) }";
CallableStatement cstmt = con.prepareCall(procedure);
cstmt.setInt(1,0); //°ÑÄêÁä²ÎÊýÉèΪ0
cstmt.executeUpdate();
tx.commit();
create or replace produre batchUpdateStudent(a in number) as
begin
update STUDENT set AGE=AGE+1 where AGE>a;
end;
µ÷ÓôúÂëÈçÏ£º
Transaction tx=session.beginSession();
Connection conn=session.connection();
String pd=”...{call batchUpdateStudent(?)}”;
CallableStatement cstmt=conn.PrepareCall(pd);
cstmt.setInt(1,20); //°ÑÄêÁäÕâ¸ö²ÎÊýÉèΪ20
tx.commit()£»
Ïà¹ØÎĵµ£º
ÒÔÇ°ÔÚ¼ÒÌýÕÅТÏéÀÏʦµÄÊÓƵʱ,ÂÅ´ÎÌýµ½ÕÅÀÏʦ½²µ½ÕÆÎÕJAVA»ù´¡¶ÔÓÚÎÒÃÇÒªÀ´´«ÖDzμӾÍÒµÅàѵҪѧϰµÄпγ̵ÄÖØÒª.ÏÖÔÚ¿´À´,ÕâЩ»°ÕæµÄÒ»µã¶¼²»Îª¹ý!ÓÐЩͬѧ»òÐíûÓÐÉî¿ÌÈÏʶÕÅÀÏʦ˵µÄÕâ·¬»°,×Ô¼ºÆ½Ê±¶¯ÊÖÓÖÌ«ÉÙ.¾ÍÄÃÏÖÔÚѧµÄ¾ÍÒµÅàѵ°àµÄ¿Î³ÌÀ´Ëµ,JAVA¿ª·¢ÓõŤ¾ßÏñMYECLIPSEµÈ,ÆäʹÓÃÕæµÄÊÇÈÃÈ˸е½¾ªÏ²,ÒÔÇ°ÕÅÀÏʦÔÚ ......
//ÇóÁ½ÊýµÄ×î´ó¹«Ô¼ÊýºÍ×îС¹«±¶Êý
import java.util.*;
public class Dais02
{
public static void main(String args[])
{
int m,n;
Scanner s = new Scanner(System.in);
System.out.println("ÇëÊäÈëÄãÏëÒªÊÇÊý×Ö");
m = s.nextInt();
n ......
WindowsÏÂJAVA»·¾³±äÁ¿µÄÉèÖÃÏé½â
WindowsÏÂJAVAÓõ½µÄ»·¾³±äÁ¿Ö÷ÒªÓÐ3¸ö£¬JAVA_HOME¡¢CLASSPATH¡¢PATH¡£ÏÂÃæÖð¸ö·ÖÎö¡£
JAVA_HOME Ö¸ÏòµÄÊÇJDKµÄ°²×°Â·¾¶£¬Èçx:\JDK_1.4.2£¬ÔÚÕâ·¾¶ÏÂÄãÓ¦¸ÃÄܹ»ÕÒµ½bin¡¢libµÈĿ¼¡£ÖµµÃÒ»ÌáµÄÊÇ£¬JDK µÄ°²×°Â·¾¶¿ÉÒÔÑ¡ÔñÈÎÒâ´ÅÅÌĿ¼£¬²»¹ý½¨ÒéÄã·ÅµÄĿ¼²ã ......
String ¶ÔÏóÊDz»¿É¸Ä±äµÄ¡£Ã¿´ÎʹÓà System.String ÀàÖеķ½·¨Ö®Ò»Ê±£¬¶¼ÒªÔÚÄÚ´æÖд´½¨Ò»¸öеÄ×Ö·û´®¶ÔÏó£¬Õâ¾ÍÐèҪΪ¸ÃжÔÏó·ÖÅäеĿռ䡣ÔÚÐèÒª¶Ô×Ö·û´®Ö´ÐÐÖظ´Ð޸ĵÄÇé¿öÏ£¬Óë´´½¨Ð嵀 String ¶ÔÏóÏà¹ØµÄϵͳ¿ªÏú¿ÉÄÜ»á·Ç³£°º¹ó¡£Èç¹ûÒªÐÞ¸Ä×Ö·û´®¶ø²»´´½¨ÐµĶÔÏó£¬Ôò¿ÉÒÔʹÓà System.Text.StringBuilder Àà¡£ÀýÈ ......
1 ÒýÑÔ
JavaµÄÒ»¸öÖØÒªÓŵã¾ÍÊÇͨ¹ýÀ¬»øÊÕ¼¯Æ÷GC £¨Garbage Collection£©×Ô¶¯¹ÜÀíÄÚ´æµÄ»ØÊÕ£¬³ÌÐòÔ±²»ÐèҪͨ¹ýµ÷Óú¯ÊýÀ´ÊÍ·ÅÄÚ´æ¡£Òò´Ë£¬ºÜ¶à³ÌÐòÔ±ÈÏΪJava ²»´æÔÚÄÚ´æй©ÎÊÌ⣬»òÕßÈÏΪ¼´Ê¹ÓÐÄÚ´æй©Ҳ²»ÊdzÌÐòµÄÔðÈΣ¬¶øÊÇGC »òJVMµÄÎÊÌâ¡£Æäʵ£¬ÕâÖÖÏë·¨ÊDz»ÕýÈ·µÄ£¬ÒòΪJava Ò²´æÔÚÄÚ´æ ......