Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deegree-sqldialect-postgis: Fix version detection #196

Merged
merged 1 commit into from
Dec 3, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
package org.deegree.sqldialect.postgis;

import static org.deegree.commons.utils.JDBCUtils.close;
import static org.deegree.commons.utils.JDBCUtils.determinePostGISVersion;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

import org.deegree.commons.utils.JDBCUtils;
import org.deegree.db.dialect.SqlDialectProvider;
import org.deegree.sqldialect.SQLDialect;
import org.deegree.workspace.ResourceInitException;
Expand All @@ -61,7 +61,7 @@ public class PostGISDialectProvider implements SqlDialectProvider {
private static Logger LOG = LoggerFactory.getLogger( PostGISDialectProvider.class );

@Override
public boolean supportsConnection( Connection connection ) {
public boolean supportsConnection( final Connection connection ) {
String url = null;
try {
url = connection.getMetaData().getURL();
Expand All @@ -74,18 +74,17 @@ public boolean supportsConnection( Connection connection ) {
}

@Override
public SQLDialect createDialect( Connection connection ) {
Connection conn = null;
public SQLDialect createDialect( final Connection conn ) {
Statement stmt = null;
ResultSet rs = null;
String version = null;
try {
version = JDBCUtils.determinePostGISVersion( conn, LOG );
version = determinePostGISVersion( conn, LOG );
} catch ( Exception e ) {
LOG.trace( e.getMessage(), e );
throw new ResourceInitException( e.getMessage(), e );
} finally {
close( rs, stmt, conn, LOG );
close( rs, stmt, null, LOG );
}
return new PostGISDialect( version );
}
Expand Down