Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

´«ÖDz¥¿Íjavaѧϰ 3g¿ª·¢Android2

½ñÌìÊÇѧϰAndroid¿ª·¢µÄµÚ¶þÌ죺
      
½ñÌìÖ÷ҪѧϰÁËÎļþµÄ¶ÁÈ¡¡¢ÒÔ¼°¶ÔxmlÎļþµÄ½âÎö£º
ʹÓÃÎļþ½øÐÐÊý¾Ý´æ´¢£º
ActivityÌṩÁËopenFileOutput()·½·¨¿ÉÒÔÓÃÓÚ°ÑÊý¾ÝÊä³öµ½ÎļþÖУ¬¾ßÌåµÄʵÏÖ¹ý³ÌÓëÔÚJ2SE»·¾³Öб£´æÊý¾Ýµ½ÎļþÖÐÊÇÒ»ÑùµÄ¡£
public class FileActivity extends Acti ......

JavaÖÐÈçºÎÅжÏÒ»¸ö×Ö·û´®µÄ¸ñʽ

/**
* 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£©


ʹÓÃJava²Ù×÷Îı¾ÎļþµÄ·½·¨Ïê½â
ÕªÒª: ×î³õjavaÊDz»Ö§³Ö¶ÔÎı¾ÎļþµÄ´¦ÀíµÄ£¬ÎªÁËÃÖ²¹Õâ¸öȱº¶¶øÒýÈëÁËReaderºÍWriterÁ½¸öÀ࣬ÕâÁ½¸öÀ඼ÊdzéÏóÀ࣬WriterÖÐ write(char[] ch,int off,int
length)£¬flush()ºÍclose()·½·¨Îª³éÏó·½·¨£¬ReaderÖÐread(char[] ch,int off,int length)ºÍclose()·½·¨ÊdzéÏó·½·¨¡£×ÓÀàÓ¦¸Ã·Ö± ......

javaµ÷ÓÃcmdÃüÁî && µ÷ÓÃjar°üÄÚµÄpropertiesÎļþ

1.javaµ÷ÓÃcmdÃüÁ
Runtime.getRuntime().exec("taskkill /f /im firefox.exe");
2.ʹÓÃÁËloadProp()·½·¨µ÷ÓÃjar°üÄÚµÄpropertiesÎļþ
ʹÓÃjava³ÌÐò¼à¿ØgeneFTP·þÎñÆ÷(ʹÓÃwindows¼Æ»®ÈÎÎñÖ´ÐÐjar°ü)£¬´úÂëÈçÏÂ:(¹¤³ÌĿ¼½á¹¹¼û¸½¼þ)
Task.java:
package com.monitor;
import java.io.BufferedReader;
import java ......

java¶ÁÈ¡htmlÎļþ²¢³éÈ¡a hrefÏà¹ØÁ¬½ÓºÍÁ´½Ó±êÌâ

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)
    {
        //¶¨ÒåÒ»¸öÎÄÕÂÁÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ