在java中打开excel? 我想可以吧,用jdbc-odbc bridge 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://jakarta.apache.org/poi/hssf/index.html使用他们的开发包,很easy的可以读写excel http://www.andykhan.com/jexcelapi/index.html 贴个例子,我已经试过了,还行,要用odbc的import java.sql.*;public class TestServer { static { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch (Exception e) { System.err.println(e); } } public static void main(String args[]) { Connection conn=null; Statement stmt=null; String sql=""; try { conn=DriverManager.getConnection("jdbc:odbc:excelTest","",""); stmt=conn.createStatement(); sql="INSERT INTO [Sheet1$] (FIELD_NAME1 FIELD_NAME2 FIELD_NAME3) VALUES (100,'String Value',200)"; stmt.executeUpdate(sql); } catch (Exception e){ System.err.println(e); } finally { try{ stmt.close(); conn.close(); stmt=null; conn=null; } catch(Exception e){} } } 求mac算法 有人用NIO写过服务器么? 设置 TextComponent 的文本插入符的位置。 SH的问题,大家来帮忙看看 JTree 多重事件 问题 一道面试题,请大家看看以下四组类的问题或改善建议 在jbuilder环境下运行一切正常,在字符截面下就出现这种情况,为何 请问下,有没有关于编写游戏特效的书籍或者教程? 如何使位于firewall or proxy的机子通过Internet接收到另一机子用JMStudio发送的语音数据? 出租房屋程序 如何在 Java 中 调用 C/C++ 函数 请问如何在applet中调用服务器上的c程序,救急!!!
{
static
{
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch (Exception e) {
System.err.println(e);
}
} public static void main(String args[]) {
Connection conn=null;
Statement stmt=null;
String sql="";
try {
conn=DriverManager.getConnection("jdbc:odbc:excelTest","","");
stmt=conn.createStatement();
sql="INSERT INTO [Sheet1$] (FIELD_NAME1 FIELD_NAME2 FIELD_NAME3) VALUES (100,'String Value',200)";
stmt.executeUpdate(sql); }
catch (Exception e){
System.err.println(e);
}
finally {
try{
stmt.close();
conn.close();
stmt=null;
conn=null;
}
catch(Exception e){}
}
}