java ¶ÁÈ¡excel Îļþ
2010-03-18
package javaEcsl;
import java.io.*;
import java.util.*;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
/** */
/**
* <p>
* Title:
* </p>
* <div>Description: ExcelÊý¾Ýµ¼Èëµ½oracleÊý¾Ý¿âÀà. </div>
* <p>
* Copyright: Copyright (c) 2004
* </p>
* <p>
* Company: Ò×ͨ¼¼ÊõÓÐÏÞ¹«Ë¾
* </p>
*
* @author Allen
* @version 1.0
*/
public class ExcelImportOracle {
/** */
/**
* ÓÃÓÚ·µ»ØÈýάÊý×éµÄArrayList.
*/
private static ArrayList subdata = new ArrayList();
/** */
/**
* ExcelÖеıíÃû.
*/
private static String tablename;
/** */
/**
* ÎļþµÄ·¾¶
*/
private static String filePath;
/** */
/**
* ¸Ã·½·¨ÎªÍê³É¶ÁÈ¡ExcelÖеÄÊý¾Ý²¢½«Êý¾Ý²åÈëµ½¶ÔÓ¦µÄÊý¾Ý¿â±íÖеIJÙ×÷(ÔÚµ÷ÓÃÇ°ÐèÒªÏȵ÷Óà setFilePath(String)Õâ¸ö·½·¨.).
*
* @author Administrator
* @param data:¶ÁÈ¡ExcelÖеÄÊý¾ÝµÄÊý×é.
* @dedivcated:½«¶ÁÈ¡ExcelÖеÄÊý¾Ý²åÈëµ½¶ÔÓ¦µÄÊý¾Ý¿â±íÖÐ. *
*/
public static void ExcelDataImportOracle(String filePath) throws Exception {
try {
ArrayList al = readExcel(filePath);
InsertData(al);
} catch (Exception e) {
e.printStackTrace();
}
}
/** */
/**
* ¶ÁÈ¡ExcelÖеÄÊý¾Ý.½«ÕâЩÊý¾Ý·ÅÈëµ½Ò»¸öÈýάÊý×éÖÐ.
*
* @author Administrator
* @param filePath
* Îļþ·¾¶.
* @dedivcated:¶ÁÈ¡ExcelÖеÄÊý¾Ý½«Ëü·ÅÈëµ½ArrayListÊý×éÖÐ(´ËΪÈýάÊý×é).
*/
public static ArrayList readExcel(String filePath) {
try {
subdata.clear();// ½«¾²Ì¬ArrayListÊý×éÇå¿Õ.(Èç¹û²»Çå¿ÕÔÊý¾Ý»á²»¶ÏÀÛ¼Ó)
InputStream is = new FileInputStream(filePath);
Workbook rwb = Workbook.getWorkbook(is);
// Sheet st = rwb.getSheet(0);//ÕâÀïÓÐÁ½ÖÖ·½·¨»ñÈ¡sheet±í,1ΪÃû×Ö£¬¶øΪϱ꣬´Ó0¿ªÊ¼
// Sheet st = rwb.getSheet("Book1");// ExcelÖеÚÒ»Ò³µÄÒ³Ãû³Æ.
Sheet st[] = rwb.getSheets();// µÃµ½ËùÓÐExcelÖÐÒ³µÄÁбí.
for (int a = 0; a < st.length; a++) {
ArrayList alList = new ArrayList();
ArrayList tablenames = new
Ïà¹ØÎĵµ£º
/**
* check if the odivalue has a legal version format[0.0.0.0]
* @param odivalue:The odivalue extracted from SOAP
* @return :a boolean value,true or false
*/
public static boolean isCorrectVersion(String odivalue) {
// TODO Auto-generated method stub
Pattern pattern = Patter ......
Ê×ÏȾͱêÌâ˵Ã÷Ò»µã£¬javaʹÓÃorg.apache.commons.net.ftp.ftpclient°üÀ´²Ù×÷FTPÊǺÜˬµÎ£¬µ«¶ÔÔ¶³ÌÎļþ²Ù×÷£¬ºÃÏñûÓÐʵÏÖ
¸´ÖÆÎļþµÄ·½·¨¡£ÎÒÓõÄÊÇÎļþÒƶ¯(move)£¬°ÑÎļþ´ÓÒ»¸öÎļþ¼ÐÒƶ¯µ½ÁíÍâÒ»¸öÎļþ¼Ð¡£
±³¾°£º
ÔÚactionÖвÙ×÷Ô¶³ÌFTP£¬ÊµÏÖÎļþÒƶ¯¡£³ÌÐòÔËÐÐÔÚ±¾»ú£¬FTPÊÇÒ»¸öLinux· ......
import java.net.url;
import java.sql.*;
public class javaoracle {
public javaoracle() {
}
public static void main(string[] args){
try
{
try{
class.forname("oracle.jdbc.driver.oracledriver");
}
catch(java.lang.classnotfoundexception e)
{
system.err.print(e.getmessage());
} ......
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.*;
import java.io.*;
import java.nio.CharBuffer;
public class RegTest
{
public static void main(String[] args)
{
//¶¨ÒåÒ»¸öÎÄÕÂÁÐ ......
java Map ±éÀúËÙ¶È×îÓŽâ
µÚÒ»ÖÖ:
Map map = new HashMap();
Iterator iter = map.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
Object key = entry.getKey();
Object val = entry.getValue();
}
ЧÂʸß,ÒÔºóÒ»¶¨ÒªÊ¹ÓôËÖÖ·½Ê½£¡
µÚ¶þÖÖ:
Map map = ......