com.hardcode.gdbms.engine.data.db
Class JDBCSupport

java.lang.Object
  extended by com.hardcode.gdbms.engine.data.db.JDBCSupport
All Implemented Interfaces:
ReadAccess

public class JDBCSupport
extends java.lang.Object
implements ReadAccess

DBDrivers helper class


Nested Class Summary
static class JDBCSupport.Spatial2AlphaMetadata
           
 
Field Summary
static java.lang.String BIGINT
           
static java.lang.String BINARY
           
static java.lang.String BIT
           
static java.lang.String BOOLEAN
           
static java.lang.String CHAR
           
static java.lang.String DATE
           
static java.lang.String DECIMAL
           
static java.lang.String DOUBLE
           
static java.lang.String FLOAT
           
static java.lang.String INTEGER
           
static java.lang.String LENGTH
           
static java.lang.String LONGVARBINARY
           
static java.lang.String LONGVARCHAR
           
static java.lang.String NUMERIC
           
static java.lang.String PRECISION
           
static java.lang.String REAL
           
static java.lang.String SCALE
           
static java.lang.String SMALLINT
           
static java.lang.String TIME
           
static java.lang.String TIMESTAMP
           
static java.lang.String TINYINT
           
static java.lang.String VARBINARY
           
static java.lang.String VARCHAR
           
 
Method Summary
static java.lang.String checkStandard(Field f, Value value)
           
 void close()
          Closes the internal data source
static void createSource(java.sql.Connection c, java.lang.String tableName, DriverMetadata driverMetadata)
           
static void execute(java.sql.Connection con, java.lang.String sql)
          Executes a query with the 'con' connection
static java.lang.String[] getAvailableTypes(java.sql.Connection connection)
           
static java.lang.String[] getDefaultSQLParameters(java.lang.String driverType)
           
static java.lang.String[] getDefaultSQLTypes()
           
 DefaultDriverMetadata getDriverMetadata(java.sql.Connection c, java.lang.String tableName)
           
 int getFieldCount()
           
 java.lang.String getFieldName(int fieldId)
           
 int getFieldType(int i)
           
 Value getFieldValue(long rowIndex, int fieldId)
          Obtiene el valor que se encuentra en la fila y columna indicada
static java.lang.String[] getParameters(java.sql.Connection connection, java.lang.String driverType)
           
 java.sql.ResultSet getResultSet()
           
 long getRowCount()
          Obtiene el número de registros del DataSource
 DefaultSpatialDriverMetadata getSpatialDriverMetadata(java.sql.Connection con, java.lang.String tableName, java.lang.String geomFieldName, int geometryType)
           
static int getType(java.lang.String driverType)
           
static java.lang.String getTypeInAddColumnStatement(java.lang.String driverType, java.util.HashMap<java.lang.String,java.lang.String> params)
           
 boolean isReadOnly(int fieldId)
           
static boolean isValidParameter(java.lang.String driverType, java.lang.String paramName, java.lang.String paramValue)
           
static JDBCSupport newJDBCSupport(java.sql.Connection con, java.lang.String tableName, java.lang.String orderFieldName)
          Creates a new JDBCSuuport object with the data retrieved from the connection with the given sql
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHAR

public static final java.lang.String CHAR
See Also:
Constant Field Values

VARCHAR

public static final java.lang.String VARCHAR
See Also:
Constant Field Values

LONGVARCHAR

public static final java.lang.String LONGVARCHAR
See Also:
Constant Field Values

BIGINT

public static final java.lang.String BIGINT
See Also:
Constant Field Values

BOOLEAN

public static final java.lang.String BOOLEAN
See Also:
Constant Field Values

DATE

public static final java.lang.String DATE
See Also:
Constant Field Values

DECIMAL

public static final java.lang.String DECIMAL
See Also:
Constant Field Values

NUMERIC

public static final java.lang.String NUMERIC
See Also:
Constant Field Values

FLOAT

public static final java.lang.String FLOAT
See Also:
Constant Field Values

DOUBLE

public static final java.lang.String DOUBLE
See Also:
Constant Field Values

INTEGER

public static final java.lang.String INTEGER
See Also:
Constant Field Values

REAL

public static final java.lang.String REAL
See Also:
Constant Field Values

SMALLINT

public static final java.lang.String SMALLINT
See Also:
Constant Field Values

TINYINT

public static final java.lang.String TINYINT
See Also:
Constant Field Values

BINARY

public static final java.lang.String BINARY
See Also:
Constant Field Values

VARBINARY

public static final java.lang.String VARBINARY
See Also:
Constant Field Values

LONGVARBINARY

public static final java.lang.String LONGVARBINARY
See Also:
Constant Field Values

TIMESTAMP

public static final java.lang.String TIMESTAMP
See Also:
Constant Field Values

TIME

public static final java.lang.String TIME
See Also:
Constant Field Values

BIT

public static final java.lang.String BIT
See Also:
Constant Field Values

PRECISION

public static final java.lang.String PRECISION
See Also:
Constant Field Values

LENGTH

public static final java.lang.String LENGTH
See Also:
Constant Field Values

SCALE

public static final java.lang.String SCALE
See Also:
Constant Field Values
Method Detail

getFieldValue

public Value getFieldValue(long rowIndex,
                           int fieldId)
                    throws DriverException
Description copied from interface: ReadAccess
Obtiene el valor que se encuentra en la fila y columna indicada

Specified by:
getFieldValue in interface ReadAccess
Parameters:
rowIndex - fila
fieldId - columna
Returns:
subclase de Value con el valor del origen de datos. Never null (use ValueFactory.createNullValue() instead)
Throws:
DriverException - Si se produce un error accediendo al DataSource
See Also:
ReadAccess.getFieldValue(long, int)

getFieldCount

public int getFieldCount()
                  throws DriverException
Throws:
DriverException
See Also:
com.hardcode.gdbms.engine.data.driver.ReadAccess#getFieldCount()

getFieldName

public java.lang.String getFieldName(int fieldId)
                              throws DriverException
Throws:
DriverException
See Also:
com.hardcode.gdbms.engine.data.driver.ReadAccess#getFieldName(int)

getRowCount

public long getRowCount()
                 throws DriverException
Description copied from interface: ReadAccess
Obtiene el número de registros del DataSource

Specified by:
getRowCount in interface ReadAccess
Returns:
Throws:
DriverException - Si se produce algún error accediendo al DataSource
See Also:
ReadAccess.getRowCount()

getFieldType

public int getFieldType(int i)
                 throws DriverException
Throws:
DriverException
See Also:
com.hardcode.gdbms.engine.data.driver.ReadAccess#getFieldType(int)

close

public void close()
           throws java.sql.SQLException
Closes the internal data source

Throws:
java.sql.SQLException - if the operation fails

newJDBCSupport

public static JDBCSupport newJDBCSupport(java.sql.Connection con,
                                         java.lang.String tableName,
                                         java.lang.String orderFieldName)
                                  throws java.sql.SQLException
Creates a new JDBCSuuport object with the data retrieved from the connection with the given sql

Parameters:
con - Connection to the database
sql - SQL defining the data to use
Returns:
JDBCSupport
Throws:
java.sql.SQLException - If the data cannot be retrieved

execute

public static void execute(java.sql.Connection con,
                           java.lang.String sql)
                    throws java.sql.SQLException
Executes a query with the 'con' connection

Parameters:
con - connection
sql - instruction to execute
Throws:
java.sql.SQLException - if execution fails

getResultSet

public java.sql.ResultSet getResultSet()
Returns:

getSpatialDriverMetadata

public DefaultSpatialDriverMetadata getSpatialDriverMetadata(java.sql.Connection con,
                                                             java.lang.String tableName,
                                                             java.lang.String geomFieldName,
                                                             int geometryType)
                                                      throws DriverException
Throws:
DriverException

getDriverMetadata

public DefaultDriverMetadata getDriverMetadata(java.sql.Connection c,
                                               java.lang.String tableName)
                                        throws DriverException
Throws:
DriverException

getType

public static int getType(java.lang.String driverType)

getAvailableTypes

public static java.lang.String[] getAvailableTypes(java.sql.Connection connection)
                                            throws java.sql.SQLException
Throws:
java.sql.SQLException

getDefaultSQLTypes

public static java.lang.String[] getDefaultSQLTypes()

getDefaultSQLParameters

public static java.lang.String[] getDefaultSQLParameters(java.lang.String driverType)

getParameters

public static java.lang.String[] getParameters(java.sql.Connection connection,
                                               java.lang.String driverType)
                                        throws java.sql.SQLException
Throws:
java.sql.SQLException

checkStandard

public static java.lang.String checkStandard(Field f,
                                             Value value)

getTypeInAddColumnStatement

public static java.lang.String getTypeInAddColumnStatement(java.lang.String driverType,
                                                           java.util.HashMap<java.lang.String,java.lang.String> params)

createSource

public static void createSource(java.sql.Connection c,
                                java.lang.String tableName,
                                DriverMetadata driverMetadata)
                         throws DriverException
Throws:
DriverException

isReadOnly

public boolean isReadOnly(int fieldId)
                   throws DriverException
Throws:
DriverException

isValidParameter

public static boolean isValidParameter(java.lang.String driverType,
                                       java.lang.String paramName,
                                       java.lang.String paramValue)


Copyright © 2005-2006 . All Rights Reserved.