<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>

This list describes the attributes and their values: