日期:2014-05-20  浏览次数:20844 次

哭爹喊娘找为大虾来帮忙,行行好吧~~~
怎么才能对Excel文件进行读写

------解决方案--------------------
真可怜,poi、jxl都可以,搜索一下相关文章一大堆。
------解决方案--------------------
下一套poi,jxl
里面的docs文件讲得很明白
------解决方案--------------------
路过
帮顶
------解决方案--------------------
POI
------解决方案--------------------
re jxl poi
------解决方案--------------------
好像有人以前也问过的~
LZ可以搜索一下以前的帖子~
------解决方案--------------------
jxl
import jxl.*;
import java.io.*;
import jxl.read.biff.*;
import jxl.write.*;

public class testJXL {
public static void main(String[] args) {
writeExcel();
}

public static void writeExcel() {

try {
WritableWorkbook writableworkbook = Workbook.createWorkbook(new
FileOutputStream( "c:/lxx.xls "));
WritableSheet sheet = writableworkbook.createSheet( "LXX is god ",
0);
Label label = new Label(0, 1, "damn company ");
sheet.addCell(label);
writableworkbook.write();
writableworkbook.close();
} catch (WriteException ex) {
} catch (IOException ex) {
}

}
------解决方案--------------------
难题....
------解决方案--------------------
import static java.lang.System.out;
import java.sql.*;
public class Ex10_3
{
public static void main (String []args)
{


Connection con;
Statement sql;
ResultSet rs;
try
{
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver ");

}
catch(ClassNotFoundException e) {}
try
{

con=DriverManager.getConnection( "jdbc:odbc:test ", "sa ", " ");
sql=con.createStatement();
rs=sql.executeQuery( "SELECT * FROM students ");


out.print( "学号 "+ "\t ");
out.print( "姓名 "+ "\t ");
out.print( "数学成绩 "+ "\t ");
out.print( "英语成绩 "+ "\t ");
out.print( "物理成绩 "+ "\t ");
out.println();
while(rs.next())
{


out.print(rs.getString(1)+ "\t ");
out.print(rs.getString(2)+ "\t ");
out.print(rs.getInt( "数学成绩 ")+ "\t\t ");
out.print(rs.getInt( "英语成绩 ")+ "\t\t ");
out.print(rs.getInt( "物理成绩 ")+ "\t\t ");
out.println();
}

con.close();
}

catch(SQLException el)
{
out.println(el);
}

}
}
------解决方案--------------------
JAVA技术群!愿意的加!36310034!!!!
JAVA技术群!愿意的加!36310034!!!!
JAVA技术群!愿意的加!36310034!!!!
JAVA技术群!愿意的加!36310034!!!!

------解决方案--------------------
poi


------解决方案--------------------