Java³ÌÐòÁ¬½ÓDB2
1¡¢°ÑDB2°²×°Ä¿Â¼ÏµÄdb2java.zipµ¼Èëµ½ÏîÄ¿µÄÍⲿÀ࣬ÈçÎÒÊǰÑD:\Program Files\IBM\SQLLIB\javaϵÄdb2java.zipµ¼ÈëµÄ¡£
2¡¢ÔÚ³ÌÐòÖн¨Á¢Á¬½Ó£º
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();
String url="jdbc:db2:mydb"; //²»±ØÖ¸¶¨Ö÷»úÃûºÍ¶Ë¿ÚºÅ£¬Ö¸¶¨ÁË·´¶ø»á³ö´í
String user="*****";
String password="******";
conn=DriverManager.getConnection(url,user,password);
3¡¢½ÓÏÂÈ¥±ã¿ÉÒÔÖ±½Ó½øÐвéѯÁË£º
st=(Statement) conn.createStatement();
rs=st.executeQuery(query);
Ïà¹ØÎĵµ£º
ѹËõÎļþ´úÂ룺
import java.io.*;
import java.util.zip.*;//ZipOutputStreamÕâ¸öÁ÷ÔÚÕâÀï
public class ZipOutputStreamTest
{
public static void main(String[] args) throws Exception
{
File f = new File("C:\\aaa.csv");
FileInputStream fis = new FileInputStream(f);
B ......
Ò»¡¢ ¶¨Òå
·ÅÔÚÒ»¸öÀàµÄÄÚ²¿µÄÀàÎÒÃǾͽÐÄÚ²¿Àà¡£
¶þ¡¢ ×÷ÓÃ
1.ÄÚ²¿Àà¿ÉÒԺܺõÄʵÏÖÒþ²Ø
Ò»°ãµÄ·ÇÄÚ²¿À࣬ÊDz»ÔÊÐíÓÐ private ÓëprotectedȨÏ޵쬵«ÄÚ²¿Àà¿ÉÒÔ
2£®ÄÚ²¿ÀàÓµÓÐÍâΧÀàµÄËùÓÐÔªËØµÄ·ÃÎÊȨÏÞ
3.¿ÉÊÇʵÏÖ¶àÖØ¼Ì³Ð
4.¿ÉÒÔ±ÜÃâÐ޸ĽӿڶøÊµÏÖͬһ¸öÀàÖÐÁ½ÖÖͬÃû·½·¨µÄµ÷Óá£
Èý¡¢ ......
import java.io.File;
public class FileTest{
public static void main(String[] args){
scan("c:/file/ss");
}
public static void scan(String path){
if(path ==null)
return ;
File file = new File(path); //É ......
Java ClassLoader (1) – What is a ClassLoader?
Java ClassLoader (2) – Write your own ClassLoader
Java ClassLoader (3) – Namespaces
Java ClassLoader (4) – Loading a custom ClassLoader on JVM start ......
JSP¾Å´óÄÚÖöÔÏó£º
1.ÓëServletÓйصÄÒþº¬µÄ¶ÔÏó
(1)page page¶ÔÏó¶ÔÓ¦JavaÖеĹؼü×Öthis,Ëü´ú±íµ±Ç°JSPÒ³Ãæ
(2)config Config¶ÔÏóʹÓÃWebÈÝÆ ......