Package edu.suffolk.litlab.efsp.ecfcodes
Class CodeDatabaseUtils
java.lang.Object
edu.suffolk.litlab.efsp.ecfcodes.CodeDatabaseUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic classThis exception is returned when a given table name isn't in the pre-approved list of names. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateInsertQuery(String tableName, CodeDatabaseUtils.TableColumns tc) Returns an INSERT statement for the given table + court.static StringcreateTableQuery(String tableName, CodeDatabaseUtils.TableColumns tc) static Stringstatic Stringstatic StringlikeWildcard(String searchTerm) In most cases, we want to find all instances of the search term, not the exact term.static PreparedStatementsingleInsert(PreparedStatement stmt, CodeDatabaseUtils.TableColumns columns, Map<String, String> rowVals, String courtName, String jurisStr)
-
Constructor Details
-
CodeDatabaseUtils
public CodeDatabaseUtils()
-
-
Method Details
-
getTableExists
-
getIndicesExist
-
likeWildcard
In most cases, we want to find all instances of the search term, not the exact term. It's a LIKE compare, so add the 0 or more characters on either side.- Parameters:
searchTerm-- Returns:
-
createInsertQuery
Returns an INSERT statement for the given table + court. The statement includes a ON CONFLICT (all columns...) DO NOTHING clause.- Parameters:
tableName- The name of the DB table (i.e. code list) to insert intocourtName- The Court Location ID to add codes for
-
createTableQuery
-
singleInsert
public static PreparedStatement singleInsert(PreparedStatement stmt, CodeDatabaseUtils.TableColumns columns, Map<String, String> rowVals, String courtName, String jurisStr) throws SQLException- Throws:
SQLException
-