Writing Features to MySQL.

Kit Strong
  • Kit Strong
    Kit Strong

    I have ESRI shape files that I am trying to store into MySQL.  I can easily read the shapefiles to get the FeatureSource.  I then use the FeatureSource call .getFeatures().reader to get an instance of FeatureReader.

    However, when I try to add the features to the MySQLDataStore it always throws an exception when trying to write the Point for the 'the_geom' field. 
    Here is the error I am getting:
    Aug 3, 2005 4:31:08 PM org.geotools.data.jdbc.JDBCTextFeatureWriter doInsert
    SEVERE: SQL Exception writing geometry column
    com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for column 'RecordLast' at row 1
        at com.mysql.jdbc.SQLError.convertShowWarningsToSQLWarnings(SQLError.java:709)

    Has anyone had a similar error and successfully resolved it?