Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.2.M1, 2.2.M2
-
Fix Version/s: None
-
Component/s: jdbc-oracle plugin
-
Labels:None
-
Environment:jdk1.5.0_05, WinXP
Description
The method below inside OracleDataStore.java makes query like: "select wktext from cs_srs ...."
as cs_srs table is an object of MDSYS scheme, an exception occurs - "No CRS for srid ...." as you can see in the code.
/////////////////original method:
protected CoordinateReferenceSystem determineCRS(int srid ) throws IOException {
Connection conn = getConnection(Transaction.AUTO_COMMIT);;
String wkt=null;
try
catch( FactoryException parse)
{ throw (IOException) new IOException( "Unabled to parse WKTEXT into a CRS:"+wkt ).initCause( parse ); }
catch( SQLException sql )
}
I've replaced the query with "select wktext from mdsys.cs_srs ...." , recompiled the OracleDataStore.java file put it into oracle-spatial.jar and now it works fine for me.
/////////////////modified method:
protected CoordinateReferenceSystem determineCRS(int srid ) throws IOException {
Connection conn = getConnection(Transaction.AUTO_COMMIT);;
String wkt=null;
try { Statement st = conn.createStatement(); st.execute("select wktext from mdsys.cs_srs where srid = "+srid ); ///// changed line ResultSet set = st.getResultSet(); if( !set.next() ) return null; wkt = set.getString(1); return CRS.parseWKT( wkt ); }
catch( FactoryException parse){ throw (IOException) new IOException( "Unabled to parse WKTEXT into a CRS:"+wkt ).initCause( parse ); }
catch( SQLException sql ){ throw (IOException) new IOException( "No CRS for srid "+srid ).initCause( sql ); }
}
i don't exactly know if im right about it being a bug...cause in uDig project i connected to Oracle without any problems like this, may be they changed that or maybe im making a mistake.