<tsx:dbconnect>

Use the <tsx:dbconnect> syntax to specify information needed to make a connection to a JDBC-accessible database. The <tsx:dbconnect> syntax does not establish the connection. Instead, the <tsx:dbquery> and <tsx:dbmodify> syntax are used to reference a <tsx:dbconnect> in the same JSP file and establish the connection.

When the JSP file is compiled into a servlet, the Java processor adds the Java coding for the <tsx:dbconnect> syntax to the servlet's service() method, which means a new database connection is created for each request for the JSP file.

The <tsx:dbconnect> syntax is:

<tsx:dbconnect id="connection_id" userid="db_user" passwd="user_password"
   url="jdbc:subprotocol:database" driver="database_driver_name"
   jndiname="JNDI_context/logical name">
</tsx:dbconnect>

The following list describes the attributes and their values:

All of the elements shown in the example need to be specified. However, an empty element (such as <url></url>) is valid.

When the JSP file is compiled into a servlet, the Java processor adds the Java coding for the <tsx:dbconnect> syntax to the servlet's service() method, which means a new database connection is created for each request for the JSP file.