}
SQLDialect dialect = getDataStore().getSQLDialect();
if ( dialect instanceof PreparedStatementSQLDialect ) {
PreparedStatement ps = selectSQLPS(querySchema, preQuery, cx);
reader = new JDBCFeatureReader( ps, cx, this, fullSchema, query.getHints() );
} else {
//build up a statement for the content
String sql = selectSQL(querySchema, preQuery, null);
getDataStore().getLogger().fine(sql);
reader = new JDBCFeatureReader( sql, cx, this, fullSchema, query.getHints() );
}
} catch (Exception e) {
// close the connection
getDataStore().closeSafe(cx);
// safely rethrow