public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
copyRange(byte[] orig,
int from,
int to)
Copies from original byte array to a new byte array.
|
static byte[] |
copyWithLength(byte[] orig,
int length)
Copies the original byte array content to a new byte array.
|
static List<String> |
createQueryParts(String queryString,
boolean noBackslashEscapes) |
static byte[] |
encryptPassword(String password,
byte[] seed)
encrypts a password
protocol for authentication is like this: 1.
|
static String |
escapeString(String s,
boolean noBackslashEscapes) |
static String |
nativeSQL(String sql,
boolean noBackslashEscapes) |
static String |
replaceFunctionParameter(String s)
Helper function to replace function parameters in escaped string.
|
public static List<String> createQueryParts(String queryString, boolean noBackslashEscapes)
public static byte[] encryptPassword(String password, byte[] seed) throws NoSuchAlgorithmException
password - the password to encryptseed - the seed to useNoSuchAlgorithmException - if SHA1 is not available on the platform we are usingpublic static byte[] copyWithLength(byte[] orig,
int length)
orig - the original byte arraylength - how big the resulting byte array will bepublic static byte[] copyRange(byte[] orig,
int from,
int to)
orig - the original byte arrayfrom - index of first byte in original byte array which will be copiedto - index of last byte in original byte array which will be copied. This can be
outside of the original byte arraypublic static String replaceFunctionParameter(String s)
s - - input stringpublic static String nativeSQL(String sql, boolean noBackslashEscapes) throws SQLException
SQLExceptionCopyright © 2014. All rights reserved.