摘要:compareSQLLite 查詢的起迄差
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Date;
public class compareSQLLite {
/**
* @param args
*/
public static void main(String[] args) {
//SQLLite
Connection con = null;
try {
//calc sqlserver time
Date d1 = new Date();
System.out.println("Start time====" +(d1.getTime())/1000);
Class.forName("org.sqlite.JDBC").newInstance();
con = DriverManager.getConnection("jdbc:sqlite:D:\\DB\\sqllite\\test.db");
Statement stmt = con.createStatement();
ResultSet res = stmt.executeQuery("select * from YDD_RESOURCE_DESCRIPTION ");
stmt.close();
res.close();
Date d2 = new Date();
System.out.println("End time====" +(d2.getTime())/1000);
System.out.println("compare time 秒====" +(d2.getTime()-d1.getTime())/1000);
}
catch (Exception ex) {
ex.printStackTrace();
}
}
}