Package tilda.db
Class JDBCHelper
- java.lang.Object
-
- tilda.db.JDBCHelper
-
public class JDBCHelper extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.List<java.lang.String>
_REHEARSAL_DDL_QUERIES
-
Constructor Summary
Constructors Constructor Description JDBCHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
batchWriteDone(int[] results, int size)
static java.sql.SQLException
closeStatement(java.sql.Statement s)
Closes the statementstatic void
endRehearsal()
static boolean
executeDDL(java.sql.Connection C, java.lang.String schemaName, java.lang.String tableName, java.lang.String query)
static int
executeDelete(java.sql.Connection C, java.lang.String SchemaName, java.lang.String TableName, java.lang.String Query)
static int
executeInsert(java.sql.Connection C, java.lang.String SchemaName, java.lang.String TableName, java.lang.String Query)
static int
executeSelect(java.sql.Connection C, java.lang.String SchemaName, java.lang.String TableName, java.lang.String Query, RecordProcessor RP, int Start, boolean Offsetted, int size, boolean Limited, boolean CountAll)
Executes a query with a record processor, starting at Start (0 is beginning), and for Size records.static int
executeUpdate(java.sql.Connection C, java.lang.String SchemaName, java.lang.String TableName, java.lang.String Query)
static java.util.Collection<?>
getArray(java.sql.ResultSet RS, int i, ColumnType Type, boolean isSet)
static java.util.Collection<?>
getArray(java.sql.ResultSet RS, java.lang.String colName, ColumnType Type, boolean isSet)
static java.util.Iterator<java.lang.String>
getRehearsalIterator()
static boolean
isRehearsal()
static java.lang.String
printResultSet(java.sql.ResultSet RS)
static int
process(java.sql.ResultSet RS, RecordProcessor RP, int Start, boolean Offsetted, int Size, boolean Limited)
static int
process(java.sql.ResultSet RS, RecordProcessor RP, int Start, boolean Offsetted, int Size, boolean Limited, boolean CountAll)
static java.time.ZonedDateTime
processZDT(java.lang.String TimezoneId, java.lang.String DTFieldName, java.sql.ResultSet RS, int ColumnPos, ColumnDefinition DTField, ColumnDefinition TZField, java.util.BitSet nulls)
static java.util.List<java.time.ZonedDateTime>
processZDTs(java.lang.String rowTimezoneId, java.lang.String DTFieldName, java.sql.ResultSet RS, int ColumnPos, ColumnDefinition DTField, ColumnDefinition TZField, java.util.BitSet nulls)
static java.util.List<java.time.ZonedDateTime>
processZDTs(java.util.List<java.lang.String> TimezoneIds, java.lang.String DTFieldName, java.sql.ResultSet RS, int ColumnPos, ColumnDefinition DTField, ColumnDefinition TZField, java.util.BitSet nulls)
static void
startRehearsal()
-
-
-
Method Detail
-
closeStatement
public static java.sql.SQLException closeStatement(java.sql.Statement s)
Closes the statement- Parameters:
s
- the Statement. Can be null (it will be ignored)- Returns:
- an SQException (instead of throwing) if one happens.
-
process
public static int process(java.sql.ResultSet RS, RecordProcessor RP, int Start, boolean Offsetted, int Size, boolean Limited) throws java.lang.Exception
- Throws:
java.lang.Exception
-
process
public static int process(java.sql.ResultSet RS, RecordProcessor RP, int Start, boolean Offsetted, int Size, boolean Limited, boolean CountAll) throws java.lang.Exception
- Throws:
java.lang.Exception
-
executeSelect
public static int executeSelect(java.sql.Connection C, java.lang.String SchemaName, java.lang.String TableName, java.lang.String Query, RecordProcessor RP, int Start, boolean Offsetted, int size, boolean Limited, boolean CountAll) throws java.lang.Exception
Executes a query with a record processor, starting at Start (0 is beginning), and for Size records.- Throws:
java.lang.Exception
-
executeUpdate
public static int executeUpdate(java.sql.Connection C, java.lang.String SchemaName, java.lang.String TableName, java.lang.String Query) throws java.lang.Exception
- Throws:
java.lang.Exception
-
executeDelete
public static int executeDelete(java.sql.Connection C, java.lang.String SchemaName, java.lang.String TableName, java.lang.String Query) throws java.lang.Exception
- Throws:
java.lang.Exception
-
startRehearsal
public static void startRehearsal()
-
endRehearsal
public static void endRehearsal()
-
isRehearsal
public static boolean isRehearsal()
-
getRehearsalIterator
public static java.util.Iterator<java.lang.String> getRehearsalIterator()
-
executeDDL
public static boolean executeDDL(java.sql.Connection C, java.lang.String schemaName, java.lang.String tableName, java.lang.String query) throws java.lang.Exception
- Throws:
java.lang.Exception
-
executeInsert
public static int executeInsert(java.sql.Connection C, java.lang.String SchemaName, java.lang.String TableName, java.lang.String Query) throws java.lang.Exception
- Throws:
java.lang.Exception
-
printResultSet
public static java.lang.String printResultSet(java.sql.ResultSet RS) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
batchWriteDone
public static int batchWriteDone(int[] results, int size) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getArray
public static java.util.Collection<?> getArray(java.sql.ResultSet RS, int i, ColumnType Type, boolean isSet) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getArray
public static java.util.Collection<?> getArray(java.sql.ResultSet RS, java.lang.String colName, ColumnType Type, boolean isSet) throws java.lang.Exception
- Throws:
java.lang.Exception
-
processZDT
public static final java.time.ZonedDateTime processZDT(java.lang.String TimezoneId, java.lang.String DTFieldName, java.sql.ResultSet RS, int ColumnPos, ColumnDefinition DTField, ColumnDefinition TZField, java.util.BitSet nulls) throws java.lang.Exception
- Throws:
java.lang.Exception
-
processZDTs
public static final java.util.List<java.time.ZonedDateTime> processZDTs(java.util.List<java.lang.String> TimezoneIds, java.lang.String DTFieldName, java.sql.ResultSet RS, int ColumnPos, ColumnDefinition DTField, ColumnDefinition TZField, java.util.BitSet nulls) throws java.lang.Exception
- Throws:
java.lang.Exception
-
processZDTs
public static final java.util.List<java.time.ZonedDateTime> processZDTs(java.lang.String rowTimezoneId, java.lang.String DTFieldName, java.sql.ResultSet RS, int ColumnPos, ColumnDefinition DTField, ColumnDefinition TZField, java.util.BitSet nulls) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-