java jdbc Á¬½ÓOracle9i
×Ô¼ºÔÚ×öÕâ¸ö³ÌÐòµÄʱºò¿´¹ýºÜ¶àµÄ×ÊÁÏ£¬ÉÏÍøÒ²²éÁ˲»ÉÙµÄ×ÊÁÏ£¬¿ÉÊǶà°ë˵µÄÊdzöÉñÈ뻯£¬ÔÆÀïÎíÀï...²»¹â¿´Á˲»Ã÷°×£¬¶øÇÒÊÇÓÐÃ÷°×Ò»µãµÄÈË£¬¿´ÁËÒ²±äµÄÓÐЩģºýÁË¡£
ÕâÀïÎÒÑÚÊÎÒ»Ì×ÍêÕûµÄjava jdbc Á¬½ÓOracle9iµÄ·¶Àý¡£
package com.lxh.dbcon;//´ò°ü
import java.sql.*;//µ¼Èësql°ü
public class DbCon {//¶¨ÒåÁ¬½ÓÀà
private final String DRIVER="oracle.jdbc.driver.OracleDriver";//OracleµÄÇý¶¯
private final String URL="jdbc:oracle:thin:@localhost:1521:Oracle9i";//Oracle9iΪOracleµÄÖ÷»ú´®Ãû£¨Ò²¾ÍÊÇOracleµÄSID£©ÔÚ×°OracleµÄʱºòÌîдµÄSID
private final String DBUSER="scott";//ÕâÀï¾ÍÒÔscott/tigerΪÓû§µÇ¼
private final String DBPASSWORD="tiger";
private Connection con=null;//Ô¤Ïȶ¨ÒåÒ»¸öÁ¬½Ó½Ó¿Ú
public DbCon() {//ÔÚ¹¹Ôì·½·¨ÖмÓÔØÊý¾Ý¿âÇý¶¯
try{
Class.forName(DRIVER).newInstance();
}catch(Exception e){
e.printStackTrace();
}
}
public Connection getConnection(){ //Á¬½ÓÊý¾Ý¿âµÄ·½·¨
try{
con=DriverManager.getConnection(URL,DBUSER,DBPASSWORD);
}catch(Exception ew){
ew.printStackTrace();
}
return con;
}
}
ÕâÊÇÒ»¸öÍêÕûµÄÁ¬½ÓÀ࣬²âÊÔÒѾͨ¹ý¡£
Ïà¹ØÎĵµ£º
ÉùÃ÷£º
ÒÔϵÄÀý×Ó²»Ò»¶¨ÕýÈ·£¬Ö»ÊÇΪÁËÑÝʾ´ó¸ÅµÄÁ÷³Ì¡£
Ò»£ºÎÞ·µ»ØÖµµÄ´æ´¢¹ý³Ì
´æ´¢¹ý³ÌΪ£º
CREATE OR REPLACE PROCEDURE TESTA(PARA1 IN VARCHAR2,PARA2 IN VARCHAR2) AS
BEGIN
INSERT INTO HYQ.B_ID (I_ID,I_NAME) VALUES (PARA1, PARA2);
END TESTA;
È»ºóÄØ£¬ÔÚjavaÀïµ÷ÓÃʱ¾ÍÓÃÏÂÃæµÄ´ ......
1.[http://www.javaalmanac.com] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥´¦.
2.[http://www.onjava.com] – O’ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ.
3.[http://java.sun.com] – ¹Ù·½µÄJava¿ª·¢ÕßÍøÕ¾ – ÿÖܶ¼ÓÐÐÂÎÄÕ·¢±í.
4.[http ......
package fileIo;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
public&nb ......
ClassLoaderÒ»¸ö¾³£³öÏÖÓÖÈúܶàÈËÍû¶øÈ´²½µÄ´Ê£¬±¾ÎĽ«ÊÔͼÒÔ×îdzÏÔÒ׶®µÄ·½Ê½À´½²½â ClassLoader£¬Ï£ÍûÄܶԲ»Á˽â¸Ã»úÖƵÄÅóÓÑÆðµ½Ò»µãµã×÷Óá£
ÒªÉîÈëÁ˽âClassLoader£¬Ê×ÏȾÍÒªÖªµÀClassLoaderÊÇÓÃÀ´¸ÉʲôµÄ£¬¹ËÃû˼Ò壬Ëü¾ÍÊÇÓÃÀ´¼ÓÔØClassÎļþµ½JVM£¬ÒÔ¹©³ÌÐòʹÓõġ£ÎÒÃÇÖªµÀ£¬java³ÌÐò¿ÉÒÔ¶¯Ì¬¼ÓÔØÀඨÒ壬¶øÕâ ......
File f=new File("DerectoryName");
String []results=f.list();
import java.io.*;
¡¡¡¡public class listFile
¡¡¡¡{ &nb ......