I'm using GeoTools 2.3.0 and MySQLDataStore in gt2-mysql-2.3.0.jar.
I've developed a common code in my program to use various geotools
datastores (such oracle, postgres, arcsde, ecc...) that uses this
code:
parameters.put("dbtype", dbtype);
parameters.put("host", host);
parameters.put("port", new Integer(port)); // Port is a string
from a textfield
parameters.put("database", database);
parameters.put("user", user);
parameters.put("passwd", password);
This code works for all datastore except for mysql, that needs:
parameters.put("port", port); // Passed as string, not as int
i.e: code needs that port param is passed as string and not as integer.
The "problem" is in MySqlDataStoreFactory.canProcess method, that
defines port Param as
static final Param PORT = new Param("port", String.class,
"mysql connection port", true, "3306");
i.e: PostGisDataStoreFactory defines port Param as:
public static final Param PORT = new Param("port", Integer.class,
"postgis connection port (default is 5432)", true, new Integer(5432));
I think that is important to maintain a single behaviour for all datastores.
P.S: if this bug has been have submitted... sorry :)
--
Diego Guidi
My personal blog: http://lacorrente.blogspot.com
My professional blog: http://blogs.ugidotnet.org/GisSharpBlog
My NetTopologySuite: http://code.google.com/p/nettopologysuite
"Programming today is a race between the programmers and software
engineers to create better and more idiot-proof programs, and the
universe, creating bigger and better idiots. So far, the universe is
winning". - Rich Cook
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel