GeoTools : How to run the Spearfish example with MySQL

The spearfish example has been ported to MySQL from the code available for PostGIS.
It is done as un attached file to this page.
best regards

Attachments:

spearfish_data_mysql.zip (application/x-zip-compressed)

Comments:

I only got it running with these two modifications:

1.
params.put( "port", "3306"); -> params.put( "port", new Integer(3306));

2.
params.put( "dbtype", "mysql"); -> params.put( "dbtype", "postgis");

These two are due to bugs in MySQLDataStoreFactory.canProcess(Map params). I guess it was already late when it got ported from the postgis template (wink)

Stefan,
Stuttgart/Germany

Posted by at Dec 18, 2004 09:32

Really,i also met these two bugs.

Posted by luxxing2000 at Mar 29, 2005 02:20

Use mysql-connector-java-3.1.14-bin.jar, JDBC connector.  Since geotools2.0rc1 is distributing mysql-connector-java-3.0.9.jar which does not work with latest versions of mysql say 5.1.  (With 3.0.9 Otherwise we will end up with ArrayOutofBounds 40 exception)...

Premnath,KN

Bangalore/India

Posted by premnath.kn@nsn.com at May 31, 2007 10:22