下面是使用的代码
config={};
var dataSource = new Database("jdbc:mysql://localhost:3306/mydb","root","root",config);
result=dataSource.query("select * from testtable");
print(result);
我收到的回复是
[{
"count":3,
"site":"Site 2",
"bank":"Bank 2",
"size":"SMALL",
"transactionDate":{
}
},
{
"count":2,
"site":"Test Site",
"bank":"Test Bank",
"size":"SMALL",
"transactionDate":{
}
},
{
"count":15,
"site":"Site 2",
"bank":"Bank 2",
"size":"",
"transactionDate":{
}
}]
注意 transactionDate 字段 [DataType timestamp]。它始终以 {} 的形式返回,但该字段包含表中每条记录的数据。transactionDate 的数据如下所示: 2014-07-03 00:00:00 2014-07-04 00:00:00 2014-07-05 00:00:00