From: <svn...@os...> - 2009-08-27 01:03:44
|
Author: jive Date: 2009-08-26 21:03:28 -0400 (Wed, 26 Aug 2009) New Revision: 33807 Modified: tags/2.6-M2/modules/unsupported/jdbc-ng/jdbc-mysql/src/main/java/org/geotools/data/mysql/MySQLDataStoreFactory.java Log: patch up mysql port Modified: tags/2.6-M2/modules/unsupported/jdbc-ng/jdbc-mysql/src/main/java/org/geotools/data/mysql/MySQLDataStoreFactory.java =================================================================== --- tags/2.6-M2/modules/unsupported/jdbc-ng/jdbc-mysql/src/main/java/org/geotools/data/mysql/MySQLDataStoreFactory.java 2009-08-26 17:03:16 UTC (rev 33806) +++ tags/2.6-M2/modules/unsupported/jdbc-ng/jdbc-mysql/src/main/java/org/geotools/data/mysql/MySQLDataStoreFactory.java 2009-08-27 01:03:28 UTC (rev 33807) @@ -21,6 +21,7 @@ import java.util.Map; import org.geotools.data.DataStore; +import org.geotools.data.DataAccessFactory.Param; import org.geotools.jdbc.JDBCDataStore; import org.geotools.jdbc.JDBCDataStoreFactory; import org.geotools.jdbc.SQLDialect; @@ -33,6 +34,11 @@ * */ public class MySQLDataStoreFactory extends JDBCDataStoreFactory { + /** parameter for database type */ + public static final Param DBTYPE = new Param("dbtype", String.class, "Type", true,"mysql"); + /** Default port number for MYSQL */ + public static final Param PORT = new Param("port", Integer.class, "Port", true, 3306); + protected SQLDialect createSQLDialect(JDBCDataStore dataStore) { return new MySQLDialectPrepared(dataStore); } @@ -46,7 +52,7 @@ } protected String getDatabaseID() { - return "mysql"; + return (String) DBTYPE.sample; } public String getDescription() { @@ -57,4 +63,13 @@ protected String getValidationQuery() { return "select version()"; } + + @Override + protected void setupParameters(Map parameters) { + super.setupParameters(parameters); + parameters.put(DBTYPE.key, DBTYPE); + parameters.put(PORT.key, PORT); + + parameters.remove(SCHEMA.key); + } } |