Integrating Custom Database Actions
The JSTL database access actions look for the default values set by the configuration settings described in Table 22-5 and 22-6.
Table 22-5. Data-source configuration setting
|
Variable name: |
javax.servlet.jsp.jstl.sql.dataSource |
|
Java constant: |
Config.SQL_DATA_SOURCE |
|
Java type: |
|
|
Set by: |
|
|
Used by: |
|
Table 22-6. Maximum rows configuration setting
|
Variable name: |
javax.servlet.jsp.jstl.sql.maxRows |
|
Java constant: |
Config.SQL_MAX_ROWS |
|
Java type: |
|
|
Set by: |
|
|
Used by: |
<sql:query> |
The data-source setting can be set as a String in
this format, in which optional parts are shown between brackets:
url [, [driver] [, [user] [, [password]]]
Commas separate the parts, so if the value for any part contains a
comma, it must be escaped with a backslash. This type of value
creates a simple DataSource without any pooling
capabilities and is intended only for prototype and low-end
applications, as described in Chapter 11. It can
also be set to a JNDI path for a DataSource made
available by the container or to a DataSource
created by custom code, such as a servlet or listener. These options
are described in detail in Chapter 23.
The maximum rows setting can be set as a String
value for a context parameter or as an Integer by custom code. It can be used to prevent run-away ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access