Revision 1759 branches/FMap_SLD/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/jdbc/mysql/MySqlGeometryIterator.java

View differences:

MySqlGeometryIterator.java
47 47
import java.sql.SQLException;
48 48

  
49 49
import com.iver.cit.gvsig.fmap.core.IGeometry;
50
import com.iver.cit.gvsig.fmap.drivers.WKBParser;
50 51
import com.iver.cit.gvsig.fmap.drivers.jdbc.GeometryIterator;
51
import com.iver.cit.gvsig.fmap.drivers.jdbc.postgis.WKTParser;
52 52
import com.vividsolutions.jts.io.ParseException;
53 53

  
54 54
/**
......
58 58
 * Window - Preferences - Java - Code Generation - Code and Comments
59 59
 */
60 60
public class MySqlGeometryIterator implements GeometryIterator {
61
    private WKTParser parser = new WKTParser();
61
    private WKBParser parser = new WKBParser();
62 62
    ResultSet rs;
63 63
    String strAux;
64 64
    IGeometry geom;
......
89 89
     */
90 90
    public IGeometry next() throws SQLException {
91 91
        rs.next();
92
        strAux = rs.getString(1);	        
93
        try {
94
            geom = parser.read(strAux);
95
        } catch (ParseException e) {
96
            // TODO Auto-generated catch block
97
            e.printStackTrace();
98
        }                
92
        byte[] data = rs.getBytes(1);	        
93
        geom = parser.parse(data);
99 94
        return geom;
100 95
    }
101 96

  

Also available in: Unified diff