i have a database like this
Code: Select all
| TABLE | CREATE TABLE |
+----------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| ftptable | CREATE TABLE `ftptable` (
`date` date DEFAULT NULL,
`heure` time DEFAULT NULL,
`ftp` float DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
Code: Select all
public TimeSeries dessiner(String Hour,String debit, String table,String where)
{
connexionBD cone = new connexionBD();
ResultSet rs = cone.execute("select "+Hour+","+debit+" from "+table+" "+where+"");
final TimeSeries series = new TimeSeries("", Minute.class);
try {
while(rs.next()){
java.sql.Timestamp v1;
v1 = rs.getTimestamp(""+Hour+"");
double v2=rs.getFloat(""+debit+"");
series.addOrUpdate( new Minute(v1), v2);
}
rs.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return series;
}
Code: Select all
select date,debit from ftptable group bye date;
but when i want to draw the variation in month or year i took this problem
Code: Select all
java.lang.IllegalArgumentException: Null 'time' argument.
at org.jfree.data.time.Minute.<init>(Minute.java:164)
at org.jfree.data.time.Minute.<init>(Minute.java:137)
at metier.connexionBD.dessiner(connexionBD.java:51)
Code: Select all
ava.lang.IllegalArgumentException: The 'year' argument must be in range 1900 to 9999.
org.jfree.date.SpreadsheetDate.<init>(SpreadsheetDate.java:114)
org.jfree.date.SerialDate.createInstance(SerialDate.java:795)
org.jfree.data.time.Day.<init>(Day.java:193)
Code: Select all
select month(date),debit from ftptable group by month(date);