|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.h2gis.utilities.JDBCUtilities
public class JDBCUtilities
DBMS should follow standard but it is not always the case, this class do some common operations. Compatible with H2 and PostgreSQL.
| Nested Class Summary | |
|---|---|
static class |
JDBCUtilities.FUNCTION_TYPE
|
| Field Summary | |
|---|---|
static String |
H2_DRIVER_NAME
|
| Method Summary | |
|---|---|
static PropertyChangeListener |
attachCancelResultSet(Statement st,
ProgressVisitor progressVisitor)
|
static int |
getFieldIndex(ResultSetMetaData resultSetMetaData,
String fieldName)
Fetch the metadata, and check field name |
static String |
getFieldName(DatabaseMetaData meta,
String table,
int fieldIndex)
|
static int |
getIntegerPrimaryKey(Connection connection,
String tableReference)
|
static int |
getRowCount(Connection connection,
String tableReference)
Fetch the row count of a table. |
static boolean |
hasField(Connection connection,
String tableName,
String fieldName)
Return true if table tableName contains field fieldName. |
static boolean |
isH2DataBase(DatabaseMetaData metaData)
|
static boolean |
isTemporaryTable(Connection connection,
String tableReference)
Read INFORMATION_SCHEMA.TABLES in order to see if the provided table reference is a temporary table. |
static boolean |
tableExists(Connection connection,
String tableName)
Return true if the table exists. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String H2_DRIVER_NAME
| Method Detail |
|---|
public static boolean hasField(Connection connection,
String tableName,
String fieldName)
throws SQLException
connection - ConnectiontableName - Table namefieldName - Field name
SQLException
public static int getFieldIndex(ResultSetMetaData resultSetMetaData,
String fieldName)
throws SQLException
resultSetMetaData - Active result set meta data.fieldName - Field name, ignore case
SQLException
public static String getFieldName(DatabaseMetaData meta,
String table,
int fieldIndex)
throws SQLException
meta - DataBase meta datatable - Table identifier [[catalog.]schema.]tablefieldIndex - Field ordinal position [1-n]
SQLException - If jdbc throws an error
public static int getRowCount(Connection connection,
String tableReference)
throws SQLException
connection - Active connection.tableReference - Table reference
SQLException - If the table does not exists, or sql request fail.
public static boolean isTemporaryTable(Connection connection,
String tableReference)
throws SQLException
connection - Active connection not closed by this methodtableReference - Table reference
SQLException - If the table does not exists.
public static boolean isH2DataBase(DatabaseMetaData metaData)
throws SQLException
metaData - Database meta data
SQLException
public static int getIntegerPrimaryKey(Connection connection,
String tableReference)
throws SQLException
connection - ConnectiontableReference - table identifier
SQLException
public static boolean tableExists(Connection connection,
String tableName)
throws SQLException
connection - ConnectiontableName - Table name
SQLException
public static PropertyChangeListener attachCancelResultSet(Statement st,
ProgressVisitor progressVisitor)
st - Statement to cancelprogressVisitor - Progress to link with
ProgressVisitor.removePropertyChangeListener(java.beans.PropertyChangeListener)
with this object as argument
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||