bash-2.03# java JDBCXYChartDemo
Unable to load column 0 (-1,java.lang.String)
Exception: null
In the code
String sql = "SELECT * from try4;";
In my database,
mysql> select * from try4;
+------------+------+
| mlc_date | x |
+------------+------+
| 01/31/2002 | 2 |
+------------+------+
1 row in set (0.00 sec)
What's wrong ?
JDBCXYChartDemo - does it really work with MySQL ?
Re: JDBCXYChartDemo - does it really work with MySQL ?
Hello,
I didn't find the file JDBCXYChartDemo.java, but the names indicates me it must be a demo using the JdbcXYDataset Class.
The infos in that class tells us : "[...] the sql query must return at least two columns. The first column will be
* the x-axis and remaining columns y-axis values.
* executeQuery can be called a number of times. [...]'
As it is an XY dataset, the x-axis can be a date-axis.
The error message You get means that the data type of the first column is not a date, but a String : You must not store Your date as a String in Your database but use the date/time type.
I didn't find the file JDBCXYChartDemo.java, but the names indicates me it must be a demo using the JdbcXYDataset Class.
The infos in that class tells us : "[...] the sql query must return at least two columns. The first column will be
* the x-axis and remaining columns y-axis values.
* executeQuery can be called a number of times. [...]'
As it is an XY dataset, the x-axis can be a date-axis.
The error message You get means that the data type of the first column is not a date, but a String : You must not store Your date as a String in Your database but use the date/time type.
Re: JDBCXYChartDemo - does it really work with MySQL ?
Hi Arnaud,
Thanks for posting that...your answer looks spot on to me.
Regards,
Dave Gilbert
Thanks for posting that...your answer looks spot on to me.
Regards,
Dave Gilbert