You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+65-17Lines changed: 65 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -24,24 +24,36 @@ The **UncheckedThrow** class uses type erasure to enable client code to throw ch
24
24
25
25
## DatabaseUtils
26
26
27
-
The **DatabaseUtils** class provides facilities that enable you to define collections of Oracle database queries and execute them easily. Query collections are defined as Java enumerations that implement the `QueryAPI` interface:
27
+
**DatabaseUtils** provides facilities that enable you to define collections of database queries and stored procedures in an easy-to-execute format.
28
+
29
+
Query collections are defined as Java enumerations that implement the `QueryAPI` interface:
28
30
*`getQueryStr` - Get the query string for this constant. This is the actual query that's sent to the database.
29
31
*`getArgNames` - Get the names of the arguments for this query. This provides diagnostic information if the incorrect number of arguments is specified by the client.
30
-
*`getArgCount` - Get the number of arguments required by this query. This enables **DatabaseUtils** to verify that the correct number of arguments has been specified by the client.
31
32
*`getConnection` - Get the connection string associated with this query. This eliminates the need for the client to provide this information.
32
-
*`getEnum` - Get the enumeration to which this query belongs. This enables **DatabaseUtils** to retrieve the name of the query's enumerated constant for diagnostic messages.
33
-
34
-
To maximize usability and configurability, we recommend the following implementation strategy for your query collections:
35
-
* Define your query collection as an enumeration that implements `QueryAPI`.
36
-
* Define each query constant with a property name and a name for each argument (if any).
37
-
* To assist users of your queries, preface their names with a type indicator (**GET** or **UPDATE**).
38
-
* Back the query collection with a configuration that implements the `Settings API`:
39
-
* groupId: com.nordstrom.tools
33
+
*`getEnum` - Get the enumeration to which this query belongs. This enables `executeQuery(Class, QueryAPI, Object[])` to retrieve the name of the query's enumerated constant for diagnostic messages.
34
+
35
+
Store procedure collections are defined as Java enumerations that implement the `SProcAPI` interface:
36
+
*`getSignature` - Get the signature for this stored procedure object. This defines the name of the stored procedure and the modes of its arguments. If the stored procedure accepts varargs, this will also be indicated.
37
+
*`getArgTypes` - Get the argument types for this stored procedure object.
38
+
*`getConnection` - Get the connection string associated with this stored procedure. This eliminates the need for the client to provide this information.
39
+
*`getEnum` - Get the enumeration to which this stored procedure belongs. This enables `executeStoredProcedure(Class, SProcAPI, Object[])` to retrieve the name of the stored procedured's enumerated constant for diagnostic messages.
40
+
41
+
To maximize usability and configurability, we recommend the following implementation strategy:
* To support execution on multiple endpoints, implement `getConnection` with sub-configurations or other dynamic data sources (e.g. - web service).
43
53
44
-
##### Query Collection Example
54
+
* To support execution on multiple endpoints, implement `QueryAPI.getConnection()` or `SProcAPI.getConnection()` with sub-configurations or other dynamic data sources (e.g. - web service).
0 commit comments