我在我的數據庫中有yyyy-mm-dd hh:mm:ss格式的Date_time字段。我在我的數據庫中存儲了8天的數據。現在我需要每15分鐘的數據。它的解決方案是什麼?請幫我...如何以15分鐘的時間間隔從系統時間的數據庫獲取數據?
我有YYYY-MM-DD HH DATE_TIME領域:在我的數據庫ss格式:毫米。我在我的數據庫中存儲了8天的數據。現在我需要每15分鐘的數據。它的解決方案是什麼?請幫我...
my code is:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.sql.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Fetching data from the database</title>
</head>
<body>
<table border="2">
<tr>
<th>Inv_id</th>
<th>Inv_phase1_V</th>
<th>Inv_phase1_A</th>
<th>Inv_phase1_kW</th>
</tr>
<%
try
{
Class.forName("com.mysql.jdbc.Driver");
String url="jdbc:mysql://localhost:3306/solar";
String username="root";
String password="root";
Connection conn=DriverManager.getConnection(url,username,password);
String query="select Inv_id,Inv_phase1_V,Inv_phase1_A,Inv_phase1_kW from inverter_detail";
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery(query);
while(rs.next())
{
String Inverter_id = rs.getString("Inv_id");
Double voltage = rs.getDouble("Inv_phase1_V");
Double ampere = rs.getDouble("Inv_phase1_A");
Double kiloWatt = rs.getDouble("Inv_phase1_kW");
%>
<tr>
<td class="cotainer"><%=Inverter_id%></td>
<td><%=voltage%></td>
<td><%=ampere%></td>
<td><%=kiloWatt%></td>
</tr>
<%
}
%>
<%
rs.close();
stmt.close();
conn.close();
}
catch(Exception e)
{
e.printStackTrace();
}
%>
</table>
</body>
</html>
現在我想要每隔15分鐘的時間間隔這個值。我能做什麼???我沒有更多關於JavaScript的jQuery的想法。
請出示你迄今爲止做了什麼 - 在代碼中。 – 2014-11-23 11:55:20
你到目前爲止嘗試過什麼?請閱讀[我如何問一個好問題?](http://stackoverflow.com/help/how-to-ask)。 – DavidPostill 2014-11-23 11:55:31
請發佈一些您現有的代碼。一個類似的問題在這裏回答http://stackoverflow.com/questions/5052543/how-to-fire-ajax-request-periodically – Aditya 2014-11-23 11:57:04