The syntax for an id follows.
id := delim-id | unDelim-id
delim-id := "[""|[any char but quote]]+"
undelim-id := (a-z|A-Z|anyunicodeletter)[a-z|A-Z|_|0-9|anyunicodeletter|anyunicodedigit]*
In the syntax braces show grouping. '*' means repeat 0 or more times.
'|' means or. '+' means repeat 1 or more times.
In addition this class provides support for qualified names. A qualified name is a dot (.) separated list of ids.
Limitations:
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DBCP_SCHEMA_NAME
Index of the schema name in a jar name on a db classpath |
| public static final int | DBCP_SQL_JAR_NAME
Index of the sql jar name in a jar name on a db classpath |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static String | Returns: the list with the id appended in its delimited form.Append an identifier to a comma separated list of identifiers. |
| public static void | checkIdentifierLengthLimit(String
identifier (in case normal form) to check identifier, int maximum legal length identifier_length_limit)Check that identifier is not too long |
| public static String | Returns: the list with the id deleted or null if the resulting list has no ids. If 'id' is not on 'list' this returns list unchanged. If list becomes empty after the removal null is returned.an id in normal form (quotes removed, upshifted if regular) id, String a comma separated list of ids in external
form (possibly delmited or not upshifted). list)Delete an normal value from a list of SQL identifiers. |
| public static String | |
| public static String | |
| public static String | getUserNameFromURLProps(Properties params)
Get user name from URL properties (key user) without any transformation. |
| private static boolean | |
| public static boolean | |
| public static String | |
| public static String | |
| private static String | |
| public static String | Returns: the result.Produce a delimited two part qualified name from two un-delimited identifiers. |
| public static String | |
| public static String | Returns: the delimited identifier.Produce a delimited form of a normal value. |
| public static String[][] | |
| private static String | parseId(StringReader r, boolean
true means return ids in nomral form, false means
return them as they were entered.
normalize)Raise an exception if the first thing in the StringReader is not a valid id. Read an id from the StringReader provided. |
| public static String[] | |
| private static String[] | parseIdList(StringReader r, boolean
true means return ids in nomral form, false means
return them as they were entered. normalize)Parse a list of comma separated SQL identifiers returning them a as elements in an array. |
| public static String[] | Returns: An array of strings made by breaking the input string at its dots, '.'.The string to be parsed s)Parse a multi-part (dot separated) SQL identifier form the String provided. |
| private static String[] | Returns: An array of strings made by breaking the input string at its dots, '.'.The multi-part identifier to be parsed r)
|
| private static String | Returns: the value of the identifer or a delimited identifierQuoted identifier to parse. r, boolean If true return a delimited identifer, otherwise return the identifier's value. normalize)Parse a delimited (quoted) identifier returning either the value of the identifier or a delimited identifier. |
| public static String | Returns: the role name to use (internal, case normal form).role identifier to check (SQL form, has possible quoting) roleName)Parse role identifier to internal, case normal form. |
| public static String | |
| private static String | Returns: the value of the identifer or a delimited identifierRegular identifier to parse. r, boolean If true return the identifer converted to a single case, otherwise return the identifier as entered. normalize)Parse a regular identifier (unquoted) returning returning either the value of the identifier or a delimited identifier. |
| public static String | |
| public static String | SQLIdentifier2CanonicalPropertyUsername(String authid)
Given a case normal form SQL authorization identifier, convert it to a
form that may be compared with the username of Derby builtin
authentication, which uses Java properties of the form
|
| private static String | vectorToIdList(Vector<String> v, boolean
True means the ids in v are in normal form
and false means they are in external form. normal)Return an idList in external form with one id for every element of v. If v has no elements, return null. |
| private static void |
| DBCP_SCHEMA_NAME | back to summary |
|---|---|
| public static final int DBCP_SCHEMA_NAME Index of the schema name in a jar name on a db classpath | |
| DBCP_SQL_JAR_NAME | back to summary |
|---|---|
| public static final int DBCP_SQL_JAR_NAME Index of the sql jar name in a jar name on a db classpath | |
| IdUtil | back to summary |
|---|---|
| public IdUtil() | |
| appendNormalToList | back to summary |
|---|---|
| public static String appendNormalToList(String id, String list) throws StandardException Append an identifier to a comma separated list of identifiers. The passed in identifier is its normal form, the list contains a list of SQL identifiers, either regular or delimited. This routine takes the easy way out and always appends a delimited identifier.
| |
| checkIdentifierLengthLimit | back to summary |
|---|---|
| public static void checkIdentifierLengthLimit(String identifier, int identifier_length_limit) throws StandardException Check that identifier is not too long
| |
| deleteId | back to summary |
|---|---|
| public static String deleteId(String id, String list) throws StandardException Delete an normal value from a list of SQL identifiers. The returned list maintains its remaining identifiers in the format they were upon entry to the call.
| |
| dups | back to summary |
|---|---|
| public static String dups(String[] l) Return an IdList with all the ids that are repeated in l.
| |
| getUserAuthorizationId | back to summary |
|---|---|
| public static String getUserAuthorizationId(String userName) throws StandardException Map userName to authorizationId in its normal form.
| |
| getUserNameFromURLProps | back to summary |
|---|---|
| public static String getUserNameFromURLProps(Properties params) Get user name from URL properties (key user) without any transformation. If the user property does not exist or is set to the empty string then Property.DEFAULT_USER_NAME is returned.
| |
| idChar | back to summary |
|---|---|
| private static boolean idChar(boolean first, int c) | |
| idOnList | back to summary |
|---|---|
| public static boolean idOnList(String id, String list) throws StandardException Return true if the normalized value of an indentifier is on the list of SQL identifiers provided.
| |
| intersect | back to summary |
|---|---|
| public static String intersect(String[] l1, String[] l2) Return an IdList with all the ids that in l1 and l2 or null if not ids are on both lists. | |
| mkIdList | back to summary |
|---|---|
| public static String mkIdList(String[] ids) Produce a string form of an idList from an array of normalized ids. | |
| mkIdListAsEntered | back to summary |
|---|---|
| private static String mkIdListAsEntered(String[] externalIds) Produce an id list from an array of ids in external form | |
| mkQualifiedName | back to summary |
|---|---|
| public static String mkQualifiedName(String id1, String id2) Produce a delimited two part qualified name from two un-delimited identifiers.
| |
| mkQualifiedName | back to summary |
|---|---|
| public static String mkQualifiedName(String[] ids) Make a string form of a qualified name from the array of ids provided. | |
| normalToDelimited | back to summary |
|---|---|
| public static String normalToDelimited(String id) Produce a delimited form of a normal value.
| |
| parseDbClassPath | back to summary |
|---|---|
| public static String[][] parseDbClassPath(String input) throws StandardException Scan a database classpath from the string provided. This returns an array with one qualified name per entry on the classpath. The constants above describe the content of the returned names. This raises an an exception if the string does not contain a valid database class path.
classpath := item[:item]*
item := id.id
In the syntax braces ([]) show grouping. '*' means repeat 0 or more times.
The syntax for id is defined in IdUtil.
Classpath returned is a two part name. If the class path is empty then this returns an array of zero length.
| |
| parseId | back to summary |
|---|---|
| private static String parseId(StringReader r, boolean normalize) throws StandardException Read an id from the StringReader provided.
| |
| parseIdList | back to summary |
|---|---|
| public static String[] parseIdList(String p) throws StandardException Scan a list of comma separated SQL identifiers from the string provided. This returns an array with containing the normalized forms of the identifiers. This raises an an exception if the string does not contain a valid list of names.
| |
| parseIdList | back to summary |
|---|---|
| private static String[] parseIdList(StringReader r, boolean normalize) throws StandardException Parse a list of comma separated SQL identifiers returning them a as elements in an array.
| |
| parseMultiPartSQLIdentifier | back to summary |
|---|---|
| public static String[] parseMultiPartSQLIdentifier(String s) throws StandardException Parse a multi-part (dot separated) SQL identifier form the String provided. Raise an excepion if the string does not contain valid SQL indentifiers. The returned String array contains the normalized form of the identifiers.
| |
| parseMultiPartSQLIdentifier | back to summary |
|---|---|
private static String[] parseMultiPartSQLIdentifier(StringReader r) throws StandardException
| |
| parseQId | back to summary |
|---|---|
| private static String parseQId(StringReader r, boolean normalize) throws IOException, StandardException Parse a delimited (quoted) identifier returning either the value of the identifier or a delimited identifier.
| |
| parseRoleId | back to summary |
|---|---|
| public static String parseRoleId(String roleName) throws StandardException Parse role identifier to internal, case normal form. It should not be NONE nor exceed Limits.MAX_IDENTIFIER_LENGTH.
| |
| parseSQLIdentifier | back to summary |
|---|---|
| public static String parseSQLIdentifier(String s) throws StandardException Parse a SQL identifier from the String provided. Raise an excepion if the string does not contain a valid SQL indentifier. The returned String contains the normalized form of the identifier.
| |
| parseUnQId | back to summary |
|---|---|
| private static String parseUnQId(StringReader r, boolean normalize) throws IOException, StandardException Parse a regular identifier (unquoted) returning returning either the value of the identifier or a delimited identifier. Ensures that all characters in the identifer are valid for a regular identifier.
| |
| pruneDups | back to summary |
|---|---|
| public static String pruneDups(String l) throws StandardException Return an IdList with all the duplicate ids removed
| |
| SQLIdentifier2CanonicalPropertyUsername | back to summary |
|---|---|
| public static String SQLIdentifier2CanonicalPropertyUsername(String authid) Given a case normal form SQL authorization identifier, convert it to a
form that may be compared with the username of Derby builtin
authentication, which uses Java properties of the form
The returned form is suitable for comparing against the property string,
cf. E.g.:
Argument -> Return
------------------
EVE -> eve [will match Java property: derby.user.eve]
eVe -> "eVe" [will match Java property: derby.user."eVe"]
"eve" -> """eve""" [will match Java property: derby.user."""eVe"""]
\eve\ -> "\eve\" [will match Java property: derby.user."\eve\"]
The latter could look this if specified on a Unix shell command line:
-Dderby.user.'"\eve\"'=<password>
| |
| vectorToIdList | back to summary |
|---|---|
| private static String vectorToIdList(Vector<String> v, boolean normal) Return an idList in external form with one id for every element of v. If v has no elements, return null.
| |
| verifyEmpty | back to summary |
|---|---|
| private static void verifyEmpty(Reader r) throws StandardException Verify the read is empty (no more characters in its stream). | |