| | |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.geotools.data.DataStore; |
| | | import org.geotools.data.mysql.MySQLDataStore; |
| | | import org.geotools.data.mysql.MySQLDataStoreFactory; |
| | | import org.geotools.feature.SchemaException; |
| | | import org.geotools.jdbc.JDBCDataStore; |
| | | import org.opengis.feature.IllegalAttributeException; |
| | | import org.quartz.JobDataMap; |
| | | import org.quartz.JobDetail; |
| | |
| | | protected String _myUseWKB; |
| | | |
| | | protected Map<String, String> myProperties; |
| | | protected MySQLDataStore targetDataStore; |
| | | protected JDBCDataStore targetDataStore; |
| | | |
| | | public Log getLogger() { |
| | | return logger; |
| | |
| | | } |
| | | */ |
| | | |
| | | if (!myProperties.containsKey("max connections" /*MySQLDataStoreFactory.MAXCONN.key */)) { |
| | | myProperties.put("max connections", "2"); |
| | | if (!myProperties.containsKey(MySQLDataStoreFactory.MAXCONN.key)) { |
| | | myProperties.put(MySQLDataStoreFactory.MAXCONN.key, "2"); |
| | | } |
| | | |
| | | if (!myProperties.containsKey("min connections" /* MySQLDataStoreFactory.MINCONN.key */)) { |
| | | myProperties.put("min connections", "1"); |
| | | if (!myProperties.containsKey(MySQLDataStoreFactory.MINCONN.key)) { |
| | | myProperties.put(MySQLDataStoreFactory.MINCONN.key, "1"); |
| | | } |
| | | |
| | | /* |
| | | if (!myProperties.containsKey(MySQLDataStoreFactory.WKBENABLED.key)) { |
| | | myProperties.put(MySQLDataStoreFactory.WKBENABLED.key, "true"); |
| | | } |
| | | */ |
| | | |
| | | if (!dataStoreFactory.canProcess(myProperties)) { |
| | | getLogger().warn("cannot process properties-"); |
| | | throw new JobExecutionException("cannot process properties-"); |
| | | } |
| | | try { |
| | | targetDataStore = (MySQLDataStore) dataStoreFactory.createDataStore(myProperties); |
| | | targetDataStore = dataStoreFactory.createDataStore(myProperties); |
| | | } catch (IOException e) { |
| | | getLogger().warn(e.getMessage(), e); |
| | | throw new JobExecutionException(e.getMessage(), e); |