dz̸Java´æ´¢¹ý³Ìµ÷ÓÃ(ת)
ÕâÀïΪ´ó¼Ò̸̸Java´æ´¢¹ý³Ìµ÷Óã¬ÎÒÃÇ¿ÉÒÔÀûÓÃJava´æ´¢¹ý³Ì¼ò»¯Êý¾Ý¿â²Ù×÷, ÀûÓÃJava´æ´¢¹ý³Ì¹µÍ¨SQL¡¢XML¡¢Java¡¢J2EEºÍWeb·þÎñ¡£
´´½¨ÐèÒªµÄ²âÊÔ±í:create table Test(tid varchar2(10),tname varchar2(10));
µÚÒ»ÖÖÇé¿ö£ºÎÞ·µ»ØÖµ.
create or replace procedure test_a(param1 in varchar2,param2 in varchar2)as begin insert into test values(param1,param2); end;
Javaµ÷ÓôúÂë:
package com.test; import java.sql.*; import java.io.*; import java.sql.*; public class TestProcA { public Test ProcA(){ } public static void main(String[]args) { ResultSet rs=null; Connection conn=null; CallableStatement proc=null; try{ Class.forName("oracle.jdbc.driver.OracleDriver"); conn=DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:test","test","test"); proc=conn.prepareCall("{calltest_a(?,?)}"); proc.setString(1,"1001"); proc.setString(2,"TestA"); proc.execute(); }catch(Exception e){ e.printStackTrace(); }finally{ try{ if(null!=rs){ rs.close(); if(null!=proc){ proc.close(); } if(null!=conn){ conn.close(); } } }catch(Exception ex){ } } } }
µÚ¶þÖÖÇé¿ö£ºÓзµ»ØÖµµÄ´æ´¢¹ý³Ì(·µ»ØÖµ·ÇÁбí).
´æ´¢¹ý³ÌΪ:
create or replace procedure test_b(param1 in varchar2,param2 out varchar2) as begin select tname into param2 from test where tid=param1; end;
Javaµ÷ÓôúÂ룺
package com.test; import java.sql.*; import java.io.*; import java.sql.*; public class TestProcB { public TestProcB(){ } public static void main(String[]args) { Connection conn=null; CallableStatement proc=null; try{ Class.forName("oracle.jdbc.driver.OracleDriver"); conn=DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:test","test","test"); proc=conn.
Ïà¹ØÎĵµ£º
µ½ÕâÀïÎÒÃÇ×öÒ»¸öÍêÕûµÄÀý×ÓÀ´ËµÃ÷Ï̲߳úÉúµÄ·½Ê½²»Í¬¶øÉú³ÉµÄÏ̵߳ÄÇø±ð£º
package debug;
import java.io.*;
import java.lang.Thread;
class MyThread extends Thread{
public int x = 0;
public void run(){
System.out.println(++x);
}
}
class R implements Runnable{
private int x = ......
JAVAÅÅÐò»ã×Ü ÊÕ²Ø
package com.softeem.jbs.lesson4;
import java.util.Random;
/**
* ÅÅÐò²âÊÔÀà
*
* ÅÅÐòËã·¨µÄ·ÖÀàÈçÏ£º
* 1.²åÈëÅÅÐò£¨Ö±½Ó²åÈëÅÅÐò¡¢ÕÛ°ë²åÈëÅÅÐò¡¢Ï£¶ûÅÅÐò£©£»
* 2.½»»»ÅÅÐò£¨Ã°ÅÝÅÝÅÅÐò¡¢¿ìËÙÅÅÐò£©£»
* 3.Ñ¡ÔñÅÅÐò£¨Ö±½ÓÑ¡ÔñÅÅÐò¡¢¶ÑÅÅÐò£ ......
String str = "[010101]+[010102]";
String ss = "
System.out.println(ss); // \[010101]
[ ÊÇÌØÊâ×Ö·û£¬
ÐèÒªÓ÷´Ð±¸Ü \[ ¶ÔÆä½øÐÐתÒå
\\[010101]";
String ssss = "
\\ ......
ǰЩÌì±àС³ÌÐò£¬Ð´ÆäÖÐÓÐÒ»¸ö×Ô¼ºÊµÏÖµÄstackµÄpopÈçÏ£º
public class Stack<T>{
private ArrayList<T> list;
public Stack(){
list = new ArrayList<T>();
}
......
1, ±£Ö¤Ḭ̈߳²È«µÄÈýÖÖ·½·¨:
a, ²»Òª¿çÏ̷߳ÃÎʹ²Ïí±äÁ¿
b, ʹ¹²Ïí±äÁ¿ÊÇfinalÀàÐ͵Ä
c, ½«¹²Ïí±äÁ¿µÄ²Ù×÷¼ÓÉÏͬ²½
2, Ò»¿ªÊ¼¾Í½«ÀàÉè¼Æ³ÉḬ̈߳²È«µÄ, ±ÈÔÚºóÆÚÖØÐÂÐÞ¸´Ëü,¸üÈÝÒ×.
3, ±àд¶àÏ̳߳ÌÐò, Ê×Ïȱ£Ö¤ËüÊÇÕýÈ·µÄ, Æä´ÎÔÙ¿¼ÂÇÐÔÄÜ.
4, ÎÞ×´Ì ......