org.deegree_impl.io
Class OracleSpatialAccess

java.lang.Object
  extended byorg.deegree_impl.io.DBAccess
      extended byorg.deegree_impl.io.OracleSpatialAccess

public class OracleSpatialAccess
extends DBAccess

This class extends the DBAccess class to read fields from a oracle spatial table. this may or may not include geometries. if the reques result contains one or more geometries they can be accessed as table column(s) or as OGC WKBs. ------------------------------------------------------------------------

Version:
5.05.2003
Author:
Andreas Poth, Luigi Marinucci

Field Summary
private  java.lang.String sdoVersion
           
private  int[] struct
           
 
Fields inherited from class org.deegree_impl.io.DBAccess
con
 
Constructor Summary
OracleSpatialAccess(java.sql.Connection con, boolean autoCommit, java.lang.String sdoVersion)
          constructor
OracleSpatialAccess(java.sql.Connection con, java.lang.String sdoVersion)
          constructor
OracleSpatialAccess(java.lang.String driver, java.lang.String logon, java.util.Properties properties, boolean autoCommit, java.lang.String sdoVersion)
           
OracleSpatialAccess(java.lang.String driver, java.lang.String logon, java.util.Properties properties, java.lang.String sdoVersion)
           
OracleSpatialAccess(java.lang.String driver, java.lang.String logon, java.lang.String user, java.lang.String password, boolean autoCommit, java.lang.String sdoVersion)
           
OracleSpatialAccess(java.lang.String driver, java.lang.String logon, java.lang.String user, java.lang.String password, java.lang.String sdoVersion)
           
 
Method Summary
 java.lang.Object performQuery(java.lang.String query, int startFeature, int maxFeatures)
          perfomrs a general query against a database.
 byte[][][] performWKBQuery(java.lang.String query)
          Performs a query against a oracle spatial database.
 byte[][][] performWKBQuery(java.lang.String query, int startFeature, int maxFeatures)
          Performs a query against a oracle spatial database.
private  java.sql.PreparedStatement reformatStatement(java.lang.String query)
          reformates the select statement to an prepared statement. this method will be called if the select statement contains a geometry operator
 
Methods inherited from class org.deegree_impl.io.DBAccess
commit, escape, executeStatement, getColumnTypes, getColumnTypesAsInt, getConnection, getDataBaseVendor, kill, mapTypes, performInsert, performInsert, performQuery, performTableQuery, performTableQuery, performUpdate, rollback, setAutoCommit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sdoVersion

private java.lang.String sdoVersion

struct

private int[] struct
Constructor Detail

OracleSpatialAccess

public OracleSpatialAccess(java.sql.Connection con,
                           java.lang.String sdoVersion)
constructor

Parameters:
con - connection to a oracle database with spatial extension.
sdoVersion - version of the spatial extension

OracleSpatialAccess

public OracleSpatialAccess(java.sql.Connection con,
                           boolean autoCommit,
                           java.lang.String sdoVersion)
                    throws java.sql.SQLException
constructor

Parameters:
con - connection to a oracle database with spatial extension.

OracleSpatialAccess

public OracleSpatialAccess(java.lang.String driver,
                           java.lang.String logon,
                           java.lang.String user,
                           java.lang.String password,
                           java.lang.String sdoVersion)
                    throws java.sql.SQLException,
                           java.lang.Exception
Parameters:
driver - name of the jdbc driver
logon - address of the database (and additional parameters)
user -
password -
sdoVersion - version of the spatial data objects (depends on the used spatial driver/lib)
Throws:
java.sql.SQLException
java.lang.Exception

OracleSpatialAccess

public OracleSpatialAccess(java.lang.String driver,
                           java.lang.String logon,
                           java.util.Properties properties,
                           java.lang.String sdoVersion)
                    throws java.sql.SQLException,
                           java.lang.Exception
Parameters:
driver - name of the jdbc driver
logon - address of the database (and additional parameters)
properties - additional properties
sdoVersion -
Throws:
java.sql.SQLException
java.lang.Exception

OracleSpatialAccess

public OracleSpatialAccess(java.lang.String driver,
                           java.lang.String logon,
                           java.lang.String user,
                           java.lang.String password,
                           boolean autoCommit,
                           java.lang.String sdoVersion)
                    throws java.sql.SQLException,
                           java.lang.Exception
Parameters:
driver - name of the jdbc driver
logon - address of the database (and additional parameters)
user -
password -
autoCommit -
sdoVersion - version of the spatial data objects (depends on the used spatial driver/lib)
Throws:
java.sql.SQLException
java.lang.Exception

OracleSpatialAccess

public OracleSpatialAccess(java.lang.String driver,
                           java.lang.String logon,
                           java.util.Properties properties,
                           boolean autoCommit,
                           java.lang.String sdoVersion)
                    throws java.sql.SQLException,
                           java.lang.Exception
Parameters:
driver - name of the jdbc driver
logon - address of the database (and additional parameters)
properties -
autoCommit -
sdoVersion - version of the spatial data objects (depends on the used spatial driver/lib)
Throws:
java.sql.SQLException
java.lang.Exception
Method Detail

performQuery

public java.lang.Object performQuery(java.lang.String query,
                                     int startFeature,
                                     int maxFeatures)
                              throws java.sql.SQLException,
                                     java.lang.Exception
perfomrs a general query against a database. The calling class (method) has to know the type of the returned object to cast it to a more specialized class.

Overrides:
performQuery in class DBAccess
Parameters:
query - the query parameter contains the query to perform.
maxFeatures - the maximum amount of features that should be returned by the request. if maxFeatures is <= 0 all features will be returned.
startFeature - index of the feature the query starts
Returns:
result of the query. if the query failed null will be returned.
Throws:
java.sql.SQLException - will be thrown if the submitted query can't be parsed to a valid sql-statement.
java.lang.Exception

reformatStatement

private java.sql.PreparedStatement reformatStatement(java.lang.String query)
                                              throws java.sql.SQLException
reformates the select statement to an prepared statement. this method will be called if the select statement contains a geometry operator

Throws:
java.sql.SQLException

performWKBQuery

public byte[][][] performWKBQuery(java.lang.String query)
                           throws java.lang.Exception
Performs a query against a oracle spatial database. If the type of the query result isn't aren't wkb a Exception will be thrown.

Parameters:
query - the query parameter contains the query to perform.
Returns:
the wkb's corresponding to the submitted query. If no wkb matches the query null will be returned.
Throws:
java.sql.SQLException - will be thrown if the result aren't a wkb's
java.lang.Exception

performWKBQuery

public byte[][][] performWKBQuery(java.lang.String query,
                                  int startFeature,
                                  int maxFeatures)
                           throws java.lang.Exception
Performs a query against a oracle spatial database. If the type of the query result isn't aren't wkb a JOSException will be thrown.

Parameters:
query - the query parameter contains the query to perform.
maxFeatures - the maximum amount of features that should be returned by the request. if maxFeatures is <= 0 all features will be returned.
Returns:
the wkb's corresponding to the submitted query. If no wkb matches the query null will be returned.
Throws:
java.lang.Exception - will be thrown if the result aren't a wkb's