Assigning a Connection to CoordRefManager
Applications must assign an open database connection to the CoordRef- Manager object. This enables the CoordRefManager object to query the spatial_references table and cache its contents locally. If you forget to do this, a SpatialException with the message Invalid argument: CoordRef=null is usually thrown whenever you try to instantiate a geometry object.
To assign an open database connection to a CoordRefManager object
java.sql.Connection conn;
// Open the connection...
...
// Assign the connection to a CoordRefManager object
CoordRefManager crm = CoordRefManager.getInstance();
crm.setConnection(conn);