Package org.h2gis.utilities
Class TableUtilities
- java.lang.Object
-
- org.h2gis.utilities.TableUtilities
-
public class TableUtilities extends Object
Utility in order to simplify table function usage- Author:
- Nicolas Fortin, Adam Gouge
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcaseIdentifier(TableLocation requestedTable, String tableName, DBTypes dbType)Return the table identifier in the best fit depending on database typestatic voidcopyFields(Connection connection, org.h2.tools.SimpleResultSet rs, TableLocation tableLocation)Copy fields from table into aSimpleResultSetstatic booleanisColumnListConnection(Connection connection)Return true if this connection only wants the list of columns.static TableLocationparseInputTable(Connection connection, String inputTable)Convert an input table String to a TableLocationstatic TableLocationsuffixTableLocation(TableLocation inputTable, String suffix)Suffix a TableLocation
-
-
-
Method Detail
-
copyFields
public static void copyFields(Connection connection, org.h2.tools.SimpleResultSet rs, TableLocation tableLocation) throws SQLException
Copy fields from table into aSimpleResultSet- Parameters:
connection- Active connectionrs- Result set that will receive columnstableLocation- Import columns from this table- Throws:
SQLException- Error
-
isColumnListConnection
public static boolean isColumnListConnection(Connection connection) throws SQLException
Return true if this connection only wants the list of columns. This is a hack. See: https://groups.google.com/forum/#!topic/h2-database/NHH0rDeU258- Parameters:
connection- Connection- Returns:
- True if this connection only wants the list of columns
- Throws:
SQLException
-
parseInputTable
public static TableLocation parseInputTable(Connection connection, String inputTable) throws SQLException
Convert an input table String to a TableLocation- Parameters:
connection- ConnectioninputTable- Input table- Returns:
- corresponding TableLocation
- Throws:
SQLException
-
suffixTableLocation
public static TableLocation suffixTableLocation(TableLocation inputTable, String suffix)
Suffix a TableLocation- Parameters:
inputTable- Input tablesuffix- Suffix- Returns:
- suffixed TableLocation
-
caseIdentifier
public static String caseIdentifier(TableLocation requestedTable, String tableName, DBTypes dbType)
Return the table identifier in the best fit depending on database type- Parameters:
requestedTable- Catalog and schema usedtableName- Table without quotesdbType- Database type.- Returns:
- Find table identifier
-
-