Package com.databricks.jdbc.common.util
Class StringUtil
- java.lang.Object
-
- com.databricks.jdbc.common.util.StringUtil
-
public class StringUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description StringUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancheckPrefixMatch(String prefix, String fileName, boolean caseSensitive)Function to check if the given prefix exists in the fileNamestatic StringconvertJdbcEscapeSequences(String sql)static StringescapeStringLiteral(String str)Escape sql string literal which is enclosed in a single quote, it replaces single quote with doubled single quotes.static StringgetBaseNameFromPath(String path)Function to return the base name from the pathstatic StringgetFolderNameFromPath(String path)Function to return the folder name from the pathstatic StringgetVolumePath(String catalog, String schema, String volume)Building the volume path using the provided catalog, schema and volumestatic List<String>split(String value)
-
-
-
Method Detail
-
escapeStringLiteral
public static String escapeStringLiteral(String str)
Escape sql string literal which is enclosed in a single quote, it replaces single quote with doubled single quotes.Please always use prepareStatement to bind variables if possible, only use it when prepareStatement is not applicable, e.g. some DDL statement
-
checkPrefixMatch
public static boolean checkPrefixMatch(String prefix, String fileName, boolean caseSensitive)
Function to check if the given prefix exists in the fileName
-
getFolderNameFromPath
public static String getFolderNameFromPath(String path)
Function to return the folder name from the path
-
getBaseNameFromPath
public static String getBaseNameFromPath(String path)
Function to return the base name from the path
-
-