哭爹喊娘找为大虾来帮忙,行行好吧~~~
怎么才能对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
------解决方案--------------------
JExcel很爽,开源的
[解决办法]
建议,讨论一下 poi ,jxl 哪个更方便,效率更高
[解决办法]
楼上上的jdbc也可以,不是有ODBC-JDBC桥吗?