Thi is the code:
public class Connection {
        
        JMapFrame f;
        public Connection(JMapFrame frame) throws IOException
        {
                try {
                        f=frame;
                        @SuppressWarnings("rawtypes")
                        Map<String, Comparable> params = new 
HashMap<String,
Comparable>();

                        params.put("dbtype", "mysql");
                        params.put("host", "localhost");
                        params.put("port", new Integer(3306));
                        params.put("database", "Fabbricati");
                        params.put("user", "****");
                        params.put("passwd", "****");
                        
                        StyleBuilder sb = new StyleBuilder();
                        
                        LineSymbolizer lsStream = 
sb.createLineSymbolizer(Color.black , 1);
                        Style streamsStyle = sb.createStyle(lsStream);

                        MySQLDataStoreFactory mySQLFactory = new 
MySQLDataStoreFactory();
                        DataStore mySQLDatastore = (DataStore)
mySQLFactory.createDataStore(params);
                        
                        FeatureSource<?, ?> featureSource  =
mySQLDatastore.getFeatureSource("prova");

                        CachingFeatureSource cache = null;
                        cache = new CachingFeatureSource(featureSource);

                        MapContext map = new DefaultMapContext();
                        map.addLayer(cache, streamsStyle);
                        f.getMapPane();
                        f.setMapContext(map);

                } catch (IOException ex2) {
                        ex2.printStackTrace();
                }
        }
}

the program works well. But when I run it i have these erros:


29-giu-2011 12.34.24 org.geotools.jdbc.JDBCFeatureSource buildFeatureType
AVVERTENZA: Error occured determing srid for prova.ogc_geom
com.mysql.jdbc.exceptions.jdbc4.MySQLDataException: '4.294967295E9' in
column '1' is outside valid range for the datatype INTEGER.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
        at com.mysql.jdbc.Util.getInstance(Util.java:381)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1000)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
        at
com.mysql.jdbc.ResultSetImpl.throwRangeException(ResultSetImpl.java:7800)
        at 
com.mysql.jdbc.ResultSetImpl.parseIntAsDouble(ResultSetImpl.java:7055)
        at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2608)
        at
org.apache.commons.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:225)
        at
org.apache.commons.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:225)
        at
org.geotools.data.mysql.MySQLDialect.getGeometrySRID(MySQLDialect.java:200)
        at
org.geotools.data.mysql.MySQLDialectBasic.getGeometrySRID(MySQLDialectBasic.java:74)
        at
org.geotools.jdbc.JDBCFeatureSource.buildFeatureType(JDBCFeatureSource.java:291)
        at
org.geotools.jdbc.JDBCDataStore.createFeatureSource(JDBCDataStore.java:767)
        at
org.geotools.data.store.ContentDataStore.getFeatureSource(ContentDataStore.java:384)
        at
org.geotools.data.store.ContentDataStore.getFeatureSource(ContentDataStore.java:349)
        at
org.geotools.data.store.ContentDataStore.getFeatureSource(ContentDataStore.java:102)
        at Connection.<init>(Connection.java:44)
        at Map$3.action(Map.java:45)
        at 
org.geotools.swing.action.SafeAction.actionPerformed(SafeAction.java:47)
        at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at 
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
        at 
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
        at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
        at java.awt.Component.processMouseEvent(Component.java:6288)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
        at java.awt.Component.processEvent(Component.java:6053)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4651)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4481)
        at 
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4481)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:602)
        at java.awt.EventQueue$1.run(EventQueue.java:600)
        at java.security.AccessController.doPrivileged(Native Method)
        at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
        at java.awt.EventQueue$2.run(EventQueue.java:616)
        at java.awt.EventQueue$2.run(EventQueue.java:614)
        at java.security.AccessController.doPrivileged(Native Method)
        at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
        at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


I don't know how to fix them. Can someone help me??

--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Errors-when-loading-a-map-from-a-mysql-table-tp6528401p6528401.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to