|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.jdbc.JDBCPlatform
public class JDBCPlatform
The JDBCPlatform represents a single datasource connection. The default platform is that of MetaMatrix. Use the JDBCPlatformFactory to create a JDBCPlatform that is representive of the type of connection.
Nested Class Summary | |
---|---|
static interface |
JDBCPlatform.TableTypes
|
Field Summary | |
---|---|
protected static java.lang.String |
AND
|
protected java.util.Map |
classTypes
|
protected static java.lang.String |
COMMA
|
protected static java.lang.String |
DELETE_FROM
|
protected static java.lang.String |
DISTINCT
|
protected static java.lang.String |
EQUAL
|
protected java.util.Map |
fieldTypes
Holds a hashtable of values used to map JAVA types to database types for table creation |
protected static java.lang.String |
FROM
|
protected static java.lang.String |
GROUP_BY
|
protected static java.lang.String |
IN
|
protected static java.lang.String |
INSERT_INTO
|
protected static java.lang.String |
INTO
|
protected boolean |
isSecure
|
protected static java.lang.String |
LENGTH
|
protected java.util.Map |
maximumValues
|
protected java.util.Map |
minimumValues
|
protected static java.lang.String |
ON
|
protected static java.lang.String |
ORDER_BY
|
protected static java.lang.String |
PARAM
|
protected static java.lang.String |
PERIOD
|
protected java.util.Map |
platformOperators
Operators specific to this platform |
protected static java.lang.String |
SELECT
|
protected static java.lang.String |
SET
|
protected static java.lang.String |
SPACE
|
protected java.lang.String[] |
tableTypes
|
protected static java.lang.String |
UPDATE
|
protected boolean |
usesStreamsForBlobBinding
Indicates that streams will be used to store BLOB data. |
protected boolean |
usesStreamsForClobBinding
|
protected static java.lang.String |
VALUES
|
protected static java.lang.String |
WHERE
|
Constructor Summary | |
---|---|
protected |
JDBCPlatform()
|
Method Summary | |
---|---|
protected void |
addOperator(ExpressionOperator op)
|
protected java.util.Map |
buildClassTypes()
|
protected java.lang.String |
buildCommaSeperatedColumns(java.util.Collection columns)
Takes a columns of Columns and returns a comma seperated string |
protected java.util.Map |
buildFieldTypes()
|
protected java.util.Map |
buildPlatformOperators()
|
protected java.lang.String |
buildSetParmClause(java.lang.Object[] setColumns)
|
protected java.lang.String |
buildWhereParameterClause(Column[] whereColumns)
|
protected java.lang.String |
buildWhereUsingUiqueKeys(java.util.Collection uniqueKeys)
|
byte[] |
convertClobToByteArray(java.sql.ResultSet results,
java.lang.String columName)
|
protected byte[] |
convertToByteArray(java.sql.Blob sourceObject)
|
protected byte[] |
convertToByteArray(java.sql.Clob sourceObject)
|
byte[] |
convertToByteArray(java.lang.Object sourceObject)
|
java.lang.String |
createDeleteStatement(Table table)
Obtain the statement that may be used to delete records from a table with the specified metadata. |
java.lang.String |
createDeleteStatement(Table table,
Column[] whereColumns,
java.lang.String tablePrefix)
|
java.lang.String |
createDeleteStatement(Table table,
java.lang.String tablePrefix)
|
java.lang.String |
createInsertStatement(Table tableMetadata)
This will create an insert statement that can be used to insert rows using a PreparedStatement. |
java.lang.String |
createInsertStatement(Table tableMetadata,
java.lang.String tablePrefix)
|
java.lang.String |
createInsertStatement(Table tableMetadata,
java.lang.String[] values)
This will create an insert statement that will contain the actual values to be inserted into the table. |
java.lang.String |
createSelectStatement(Table tableMetadata)
This will create an select statement that can be used to select rows. |
java.lang.String |
createSelectStatement(Table tableMetadata,
java.lang.String tablePrefix)
|
java.lang.String |
createSelectStatement(Table tableMetadata,
java.lang.String tablePrefix,
Column[] whereColumns)
Create the select SQL string based on the table metadata. |
java.lang.String |
createTruncateStatement(java.lang.String tablename)
|
java.lang.String |
createTruncateStatement(java.lang.String tablename,
java.lang.String tablePrefix)
|
java.lang.String |
createUpdateStatement(Table tableMetadata)
Obtain the statement that can be used to update records in a table using a PreparedStatement. |
java.lang.String |
createUpdateStatement(Table tableMetadata,
java.lang.String[] values)
Obtain the statement which will contain the actual data values to update records in a table. |
java.util.Map |
getClassTypes()
|
int |
getDatabaseColumnSize(java.lang.String tableName,
java.lang.String columnName,
java.sql.Connection jdbcConnection)
|
java.util.Map |
getFieldTypes()
|
int |
getMaxFieldNameSize()
|
java.lang.Number |
getMaximumValue(java.lang.Class clazz)
Call to determine what is the maximum value allowed for the current database platform. |
java.lang.Number |
getMinimumValue(java.lang.Class clazz)
Call to determine what is the minimum value allowed for the current database platform. |
protected java.util.List |
getNonExecutableDelimiters()
These nonexecutable delimiters are words or symbols that cannot be excuted via an execute statement. |
ExpressionOperator |
getOperator(java.lang.String name)
|
java.lang.String |
getPlatformName()
|
java.util.Map |
getPlatformOperators()
Return any platform-specific operators |
java.lang.String[] |
getTableTypes()
|
boolean |
isClosed(java.sql.Connection connection)
|
boolean |
isDB2()
|
boolean |
isDefault()
|
boolean |
isDerby()
|
boolean |
isInformix()
|
boolean |
isMetaMatrix()
|
boolean |
isMSSQL()
|
boolean |
isMYSQL()
|
boolean |
isOracle()
|
boolean |
isPostgres()
|
boolean |
isSecure()
|
boolean |
isSybase()
|
java.util.Map |
maximumNumericValues()
Builds a table of maximum numeric values keyed on java class. |
java.util.Map |
minimumNumericValues()
Builds a table of minimum numeric values keyed on java class. |
java.util.List |
parseToExecutableStatements(java.io.BufferedReader reader,
java.lang.String delimiter)
|
void |
setBlob(java.sql.PreparedStatement statement,
byte[] data,
int column)
|
int |
setBlob(java.sql.ResultSet results,
byte[] data,
java.lang.String columnName)
|
void |
setClob(java.sql.PreparedStatement statement,
byte[] data,
int column)
|
void |
setClob(java.sql.ResultSet results,
byte[] data,
java.lang.String columnName)
|
void |
setClob(java.sql.ResultSet results,
java.io.InputStream is,
java.lang.String columnName)
|
void |
setConnection(java.sql.Connection conn)
|
void |
setIsSecure(boolean secure)
|
void |
setPlatformName(java.lang.String platformName)
|
boolean |
usesStreamsForBlobBinding()
|
boolean |
usesStreamsForClobBinding()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean usesStreamsForBlobBinding
protected boolean usesStreamsForClobBinding
protected boolean isSecure
protected transient java.util.Map fieldTypes
protected transient java.lang.String[] tableTypes
protected transient java.util.Map platformOperators
protected transient java.util.Map classTypes
protected transient java.util.Map minimumValues
protected transient java.util.Map maximumValues
protected static final java.lang.String SPACE
protected static final java.lang.String COMMA
protected static final java.lang.String PARAM
protected static final java.lang.String PERIOD
protected static final java.lang.String INSERT_INTO
protected static final java.lang.String DELETE_FROM
protected static final java.lang.String UPDATE
protected static final java.lang.String SELECT
protected static final java.lang.String EQUAL
protected static final java.lang.String FROM
protected static final java.lang.String WHERE
protected static final java.lang.String ORDER_BY
protected static final java.lang.String GROUP_BY
protected static final java.lang.String SET
protected static final java.lang.String ON
protected static final java.lang.String INTO
protected static final java.lang.String IN
protected static final java.lang.String DISTINCT
protected static final java.lang.String VALUES
protected static final java.lang.String AND
protected static final java.lang.String LENGTH
Constructor Detail |
---|
protected JDBCPlatform()
Method Detail |
---|
public void setConnection(java.sql.Connection conn) throws MetaMatrixException
MetaMatrixException
public boolean isClosed(java.sql.Connection connection)
public void setIsSecure(boolean secure)
public void setPlatformName(java.lang.String platformName)
public java.lang.String getPlatformName()
public boolean isOracle()
public boolean isDefault()
public boolean isMetaMatrix()
public boolean isDB2()
public boolean isSybase()
public boolean isMSSQL()
public boolean isMYSQL()
public boolean isInformix()
public boolean isDerby()
public boolean isPostgres()
public boolean isSecure()
public boolean usesStreamsForBlobBinding()
public boolean usesStreamsForClobBinding()
public int setBlob(java.sql.ResultSet results, byte[] data, java.lang.String columnName) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public void setBlob(java.sql.PreparedStatement statement, byte[] data, int column) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public void setClob(java.sql.ResultSet results, byte[] data, java.lang.String columnName) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public void setClob(java.sql.ResultSet results, java.io.InputStream is, java.lang.String columnName) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public void setClob(java.sql.PreparedStatement statement, byte[] data, int column) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public java.lang.String createSelectStatement(Table tableMetadata)
tableMetadata
- the definition of the table in which
columns will be used to create the select statement.public java.lang.String createSelectStatement(Table tableMetadata, java.lang.String tablePrefix)
public java.lang.String createSelectStatement(Table tableMetadata, java.lang.String tablePrefix, Column[] whereColumns)
tabelMetadata
- is the table that drives the sql statementtablePrefix
- is a prefix to add to the table; optional and nullablewhereColumns
- are columns to use in the where clause; optional and nullablepublic java.lang.String createInsertStatement(Table tableMetadata)
tableMetadata
- the definition of the table in which
records are to be updated; may not be null;public java.lang.String createInsertStatement(Table tableMetadata, java.lang.String tablePrefix)
public java.lang.String createInsertStatement(Table tableMetadata, java.lang.String[] values)
tableMetadata
- the definition of the table in which
records are to be updated; may not be null;values
- to be insertedpublic java.lang.String createUpdateStatement(Table tableMetadata)
tableMetadata
- the definition of the table in which
records are to be updated; may not be null;public java.lang.String createUpdateStatement(Table tableMetadata, java.lang.String[] values)
tableMetadata
- the definition of the table in which
records are to be updated; may not be null;values
- to be insertedprotected java.lang.String buildSetParmClause(java.lang.Object[] setColumns)
protected java.lang.String buildWhereUsingUiqueKeys(java.util.Collection uniqueKeys)
public java.lang.String createDeleteStatement(Table table)
tableMetadata
- the definition of the table from which
records are to be deleted; may not be null;public java.lang.String createDeleteStatement(Table table, java.lang.String tablePrefix)
public java.lang.String createDeleteStatement(Table table, Column[] whereColumns, java.lang.String tablePrefix)
public java.lang.String createTruncateStatement(java.lang.String tablename)
public java.lang.String createTruncateStatement(java.lang.String tablename, java.lang.String tablePrefix)
public int getMaxFieldNameSize()
public java.lang.String[] getTableTypes() throws MetaMatrixException
MetaMatrixException
public java.util.Map getClassTypes()
public java.util.Map getFieldTypes()
public java.lang.Number getMaximumValue(java.lang.Class clazz)
clazz
- is the java object data type that is of type Number
public java.lang.Number getMinimumValue(java.lang.Class clazz)
clazz
- is the java object data type that is of type Number
public ExpressionOperator getOperator(java.lang.String name)
public java.util.Map getPlatformOperators()
protected java.util.Map buildClassTypes()
protected java.util.Map buildFieldTypes()
protected void addOperator(ExpressionOperator op)
protected java.util.Map buildPlatformOperators()
public java.util.Map maximumNumericValues()
NOTE: BigInteger & BigDecimal maximums are dependent upon their precision & Scale
public java.util.Map minimumNumericValues()
NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale
public byte[] convertToByteArray(java.lang.Object sourceObject) throws TransformationException
TransformationException
protected byte[] convertToByteArray(java.sql.Blob sourceObject) throws TransformationException
TransformationException
public byte[] convertClobToByteArray(java.sql.ResultSet results, java.lang.String columName) throws TransformationException
TransformationException
protected byte[] convertToByteArray(java.sql.Clob sourceObject) throws TransformationException
TransformationException
protected java.lang.String buildCommaSeperatedColumns(java.util.Collection columns)
protected java.lang.String buildWhereParameterClause(Column[] whereColumns)
public int getDatabaseColumnSize(java.lang.String tableName, java.lang.String columnName, java.sql.Connection jdbcConnection) throws java.sql.SQLException
java.sql.SQLException
public java.util.List parseToExecutableStatements(java.io.BufferedReader reader, java.lang.String delimiter) throws java.sql.SQLException
java.sql.SQLException
protected java.util.List getNonExecutableDelimiters()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |