<tsx:userid> and <tsx:passwd>
Instead of hardcoding the user ID and password in the <tsx:dbconnect> tag, you can use the <tsx:userid> and <tsx:passwd> tags to accept user input for the values and then add that data to the request object where it can be accessed by a JSP that requests the database connection.
The <tsx:userid> and <tsx:passwd> must be used within a <tsx:dbconnect> tag.
The <tsx:userid> and <tsx:passwd> must be used within a <tsx:dbconnect> tag. The <tsx:userid> and <tsx:passwd> syntax is:
<% String userID = request.getParameter("USERID"); %> <% String passWord = request.getParameter("PASSWD"); %> <tsx:dbconnect id="conn" url="jdbc:db2:*local" driver="com.ibm.db2.jdbc.app.DB2Driver"> <tsx:userid><%=userID%></tsx:userid> <tsx:passwd><%=passWord%></tsx:passwd> </tsx:dbconnect>The following list describes the attributes and their values:
<tsx:getProperty>
This syntax is a mechanism for embedding variable data. For more information, see <tsx:getProperty>.USERID
This is a reference to the request parameter that contains the userid. The parameter must have already been added to the request object that was passed to this JSP file. The attribute and its value can be set in the request object using an HTML form or a URL query string to pass the user-specified request parameters.PASSWD
This is a reference to the request parameter that contains the password. The parameter must have already been added to the request object that was passed to this JSP. The attribute and its value can be set in the request object using an HTML form or a URL query string to pass user-specified values.