TDS-Tunnelling Servlet

To use the TDS-tunnelling servlet, you need a Web server that supports the javax.servlet interfaces, such as the Oracle Corporation Java Web server.

When you install the Web server, include the jConnect TDS-tunnelling servlet in the list of active servlets. You can also set servlet parameters to define connection timeouts and maximum packet size.

With the TDS-tunnelling servlet, requests from a client to the back-end server that go through the gateway include a GET or POST command, the TDS session ID (after the initial request), back-end address, and status of the request.

TDS is in the body of the request. Two header fields indicate the length of the TDS stream and the session ID assigned by the gateway.

When the client sends a request, the Content-Length header field indicates the size of the TDS content, and the request command is POST. If there is no TDS data in the request because the client is either retrieving the next portion of the response data from the server, or closing the connection, the request command is GET.

The following example illustrates how information is passed between the client and an HTTPS gateway using the TDS-tunneled HTTPS protocol; it shows a connection to a back-end server named “DBSERVER” with a port number of 1234.

  • Client to gateway login request – No session ID required.
    • Query– POST/tds?ServerHost=dbserver&ServerPort=1234& Operation=more HTTP/1.0

    • Header – Content-Length: 605

    • Content (TDS) – Login request

  • Gateway to client – Header contains session ID assigned by the TDS servlet.
    • Query– 200 SUCCESS HTTP/1.0

    • Header – Content-Length: 210 TDS-Session: TDS00245817298274292

    • Content (TDS) – Login acknowledgment EED

  • Client to gateway – Headers for all subsequent requests contain the session ID.
    • Query– POST/tds?TDS-Session=TDS00245817298274292&Operation=more HTTP/1.0

    • Header – Content-Length: 32

    • Content (TDS) – Query “SELECT * from authors”

  • Gateway to client – Headers for all subsequent responses contain the session ID
    • Query– 200 SUCCESS HTTP/1.0

    • Header – Content-Length: 2048 TDS-Session: TDS00245817298274292

    • Content (TDS) – Row format and some rows from query response