怎样在java程序中查询数据库中时间字段中一个时间到另个时间(两个时间不确定) 5
2个回答
展开全部
{pStat= conn.prepareStatement("select Difficulty from test where type="+a[i]);
这句不对,这个只能查到一个。如下:
String example = "select Difficulty from test where type =" + a[0];
for (int i = 1; i < 50;i++) {
example = example + " or type =" +a[i];
}
PreparedStatement pStat = conn.prepareStatement(example);
rs = pStat.executeQuery();
for(int i = 0; i < 50;i++) {
Difficulty[i] = rs.getFloat(i);
}
这句不对,这个只能查到一个。如下:
String example = "select Difficulty from test where type =" + a[0];
for (int i = 1; i < 50;i++) {
example = example + " or type =" +a[i];
}
PreparedStatement pStat = conn.prepareStatement(example);
rs = pStat.executeQuery();
for(int i = 0; i < 50;i++) {
Difficulty[i] = rs.getFloat(i);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询