Hi,
I've started using the SQLServer plugin in geoserver over a database that is
organised with schemas. Geoserver correctly identifies the tables in the named
schema, however when you attempt to publish a table it fails to parse. Looking
in the logs I was able to identify that the SQLServerDialect isn't pre-pending
the schema name in some of the queries. The following diff resolves the problem.
Kind regards,
--
Mike Fowler
Senior Software Engineer, Dotted Eyes ltd.
Index:
trunk/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerDialect.java
===================================================================
---
trunk/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerDialect.java
(revision 36182)
+++
trunk/modules/plugin/jdbc/jdbc-sqlserver/src/main/java/org/geotools/data/sqlserver/SQLServerDialect.java
(working copy)
@@ -153,6 +153,8 @@
sql.append( ".STSrid");
sql.append( " FROM ");
+ encodeSchemaName(schemaName, sql );
+ sql.append( ".");
encodeTableName(tableName, sql );
sql.append( " WHERE ");
@@ -278,9 +280,9 @@
throws SQLException {
StringBuffer sql = new StringBuffer("SELECT");
- sql.append( " IDENT_CURRENT('").append( tableName ).append("')");
+ sql.append( " IDENT_CURRENT('").append(schemaName).append(".").append(
tableName ).append("')");
sql.append( " + ");
- sql.append( " IDENT_INCR('").append( tableName ).append("')");
+ sql.append( " IDENT_INCR('").append(schemaName).append(".").append(
tableName ).append("')");
dataStore.getLogger().fine( sql.toString() );
Dotted Eyes
Hanbury Court, Harris Business Park,
Stoke Prior, Bromsgrove, B60 4JJ, UK
Join us at our events: www.dottedeyes.com/events/index.php
Sign up for support from £99 p.a.: www.dottedeyes.com/support
Ready-to-use digital maps & data: www.dottedeyes.com/data
For a sales enquiry email: sa...@dottedeyes.com
For a software code/licence enquiry email: co...@dottedeyescom
For technical support login to: http://dottedeyes.helpserve.com
Dotted Eyes Ltd is registered in England and Wales, reg no 4471760.
This email may contain confidential information, not to be disclosed.
Contents are personal and not necessarily the views of Dotted Eyes.
Emails and attachments may be monitored without notice in advance.
Email has been scanned for viruses and spam by Altman Technologies
Simplify. Automate. Integrate
------------------------------------------------------------------------------
Automate Storage Tiering Simply
Optimize IT performance and efficiency through flexible, powerful,
automated storage tiering capabilities. View this brief to learn how
you can reduce costs and improve performance.
http://p.sf.net/sfu/dell-sfdev2dev
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel