String url="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ="+application.getRealPath("/Data/ReportDemo.mdb");
Connection conn = DriverManager.getConnection(url,"sa","");
Statement stmtNew=conn.createStatement();
16.程序计时
[java]
[java]
long time1=System.currentTimeMillis();
long time2=System.currentTimeMillis();
long interval=time2-time1;
long time1=System.currentTimeMillis();
long time2=System.currentTimeMillis();
long interval=time2-time1;
17.延时
[java]
try {
Thread.sleep(Integer.Parse(%%1));
} catch(InterruptedException e) {
e.printStackTrace();
}
try {
Thread.sleep(Integer.Parse(%%1));
} catch(InterruptedException e) {
e.printStackTrace();
}
18.连接Excel文件
[java]
//import java.sql.*;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:driver={Microsoft Excel Driver (*.xls)};DBQ=D:\\myDB.xls"; // 不设置数据源
String user="myuser";
String password="mypassword";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmtNew=conn.createStatement();
//import java.sql.*;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:driver={Microsoft Excel Driver (*.xls)};DBQ=D:\\myDB.xls"; // 不设置数据源
String user="myuser";
String password="mypassword";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmtNew=conn.createStatement();