Author: aaime
Date: 2009-11-11 12:14:04 -0500 (Wed, 11 Nov 2009)
New Revision: 34362
Modified:
branches/2.6.x/modules/plugin/jdbc/jdbc-oracle/
branches/2.6.x/modules/plugin/jdbc/jdbc-oracle/src/main/java/org/geotools/data/oracle/OracleDialect.java
Log:
GEOT-2830, Oracle dialect should look for sequences in ALL_SEQUENCES
Property changes on: branches/2.6.x/modules/plugin/jdbc/jdbc-oracle
___________________________________________________________________
Added: svn:mergeinfo
+ /trunk/modules/plugin/jdbc/jdbc-oracle:34359,34361
/trunk/modules/plugin/shapefile:34361
Modified: branches/2.6.x/modules/plugin/jdbc/jdbc-oracle/src/main/java/org/geotools/data/oracle/OracleDialect.java
===================================================================
--- branches/2.6.x/modules/plugin/jdbc/jdbc-oracle/src/main/java/org/geotools/data/oracle/OracleDialect.java 2009-11-11 17:10:04 UTC (rev 34361)
+++ branches/2.6.x/modules/plugin/jdbc/jdbc-oracle/src/main/java/org/geotools/data/oracle/OracleDialect.java 2009-11-11 17:14:04 UTC (rev 34362)
@@ -702,18 +702,32 @@
String sequenceName = (tableName + "_" + columnName + "_SEQUENCE").toUpperCase();
Statement st = cx.createStatement();
try {
+ // check the user owned sequences
ResultSet rs = st.executeQuery( "SELECT * FROM USER_SEQUENCES" +
" WHERE SEQUENCE_NAME = '" + sequenceName + "'");
try {
if ( rs.next() ) {
return sequenceName;
}
+ } finally {
+ dataStore.closeSafe( rs );
}
- finally {
+ dataStore.closeSafe( rs );
+
+ // that did not work, let's see if the sequence is available in someone else schema
+ rs = st.executeQuery( "SELECT * FROM ALL_SEQUENCES" +
+ " WHERE SEQUENCE_NAME = '" + sequenceName + "'");
+ try {
+ if ( rs.next() ) {
+ String schema = rs.getString("OWNER");
+ return schema + "." + sequenceName;
+ }
+ } finally {
dataStore.closeSafe( rs );
}
- }
- finally {
+
+
+ } finally {
dataStore.closeSafe( st );
}
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
http://p.sf.net/sfu/bobj-july_______________________________________________
GeoTools-commits mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-commits