org.deegree_impl.io
Class MySQLDBAccess

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

public class MySQLDBAccess
extends DBAccess

Class for accessing MySQL (spatial) database

Version:
$Revision: 1.5 $
Author:
Andreas Poth

Field Summary
private  java.util.Properties geoColumns
           
 
Fields inherited from class org.deegree_impl.io.DBAccess
con
 
Constructor Summary
MySQLDBAccess(java.sql.Connection con)
          constructor
MySQLDBAccess(java.sql.Connection con, boolean autoCommit)
          constructor
MySQLDBAccess(java.lang.String driver, java.lang.String logon, java.util.Properties properties)
           
MySQLDBAccess(java.lang.String driver, java.lang.String logon, java.util.Properties properties, boolean autoCommit)
           
MySQLDBAccess(java.lang.String driver, java.lang.String logon, java.lang.String user, java.lang.String password)
           
MySQLDBAccess(java.lang.String driver, java.lang.String logon, java.lang.String user, java.lang.String password, boolean autoCommit)
           
 
Method Summary
 void announceGeometryColumnNames(java.lang.String[] geoColumns)
          announces the names of the columns that shall be treated as geometries.
 java.lang.Object performQuery(java.lang.String query, int startFeature, int maxFeatures)
          performs a query against a postgis database. the returned object is an instance of org.deegree.model.table.Table
private  java.sql.PreparedStatement reformatStatement(java.lang.String query)
           
 
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

geoColumns

private java.util.Properties geoColumns
Constructor Detail

MySQLDBAccess

public MySQLDBAccess(java.sql.Connection con)
constructor

Parameters:
con - connection to a PostGIS database

MySQLDBAccess

public MySQLDBAccess(java.sql.Connection con,
                     boolean autoCommit)
              throws java.sql.SQLException
constructor

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

MySQLDBAccess

public MySQLDBAccess(java.lang.String driver,
                     java.lang.String logon,
                     java.lang.String user,
                     java.lang.String password)
              throws java.sql.SQLException,
                     java.lang.Exception
Parameters:
driver - name of the jdbc driver
logon - address of the database (and additional parameters)
user -
password -
Throws:
java.sql.SQLException
java.lang.Exception

MySQLDBAccess

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

MySQLDBAccess

public MySQLDBAccess(java.lang.String driver,
                     java.lang.String logon,
                     java.lang.String user,
                     java.lang.String password,
                     boolean autoCommit)
              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 -
Throws:
java.sql.SQLException
java.lang.Exception

MySQLDBAccess

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

announceGeometryColumnNames

public void announceGeometryColumnNames(java.lang.String[] geoColumns)
announces the names of the columns that shall be treated as geometries. This must be set because MySQL JDBC driver returnts VARCHAR as type for this column.

If null will be passed, 'ASTEXT(GEOM)' will be used as default

Parameters:
geoColumns - names of the geometry columns

performQuery

public java.lang.Object performQuery(java.lang.String query,
                                     int startFeature,
                                     int maxFeatures)
                              throws java.sql.SQLException,
                                     TableException,
                                     GM_Exception
performs a query against a postgis database. the returned object is an instance of org.deegree.model.table.Table

Overrides:
performQuery in class DBAccess
Parameters:
query - sql query expression
startFeature - index of the first feature (row) to return
maxFeatures - maximum number of returned features (rows)
Returns:
Throws:
java.sql.SQLException
TableException
GM_Exception

reformatStatement

private java.sql.PreparedStatement reformatStatement(java.lang.String query)
                                              throws java.sql.SQLException
Parameters:
query -
Returns:
Throws:
java.sql.SQLException