这是我的代码,用于获取图形信息数据表。我无法找到这个问题的原因。
google.setOnLoadCallback(drawVisualization);
function drawVisualization() {
var sqlQuery = "sql?tq=select ProjectName, ExecutionDate, PassedWeekly, FailedWeekly &sqlQueryID=test_runs_week";
var weeklyRunsQuery = new google.visualization.Query(sqlQuery);
weeklyRunsQuery.send(handleWeeklyRunsResponse);
}
function handleWeeklyRunsResponse(queryWeeklyRunsResponse) {
var responseDataTable = queryWeeklyRunsResponse.getDataTable();
if (queryWeeklyRunsResponse.isError()) {
alert(queryWeeklyRunsResponse.getDetailedMessage());
}
if (responseDataTable == null) {
alert("Response is null");
return;
}
if (responseDataTable.getNumberOfRows() < 0) {
alert("Response has 0 rows");
}
}
这是WEBINF \ web.xml文件
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<description>
</description>
<servlet>
<servlet-name>SqlDataSourceServlet</servlet-name>
<description>SqlDataSourceServlet</description>
<servlet-class>com.external.datasources.SqlDataSourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SqlDataSourceServlet</servlet-name>
<url-pattern>/htm/sql</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>default.htm</welcome-file>
<welcome-file>depreport.htm</welcome-file>
</welcome-file-list>
</web-app>