May 22, 2001

Close Connections When You Are Finished With Them

By proactively closing connections when they are no longer needed, you reduce demand on the database server and make resources available to other users. Connections are closed when they go out of scope, but you can use the Close method to close a connection at any time.The following code creates

System.out Vs. System.err

System.out leads the output to the standard output stream (normally mapped to the console screen). System.err leads the output to the standard error stream (and, by default to the console, as well). The idea behind having these two is that the standard output should be used for regular program output,

Setting the Expiration Date in ASP

Records can be deleted depending upon an expiration date in ASPThe sample code is given below: set connected= server.createobject(

Increase Connection Throughput By Requesting Multiple Records At Once

By default, the CacheSize property of the Recordset object is set to 1 for all cursor types. By increasing the CacheSize, you can increase the number of records the provider will retrieve at one time into local memory. For example, if CacheSize is 10, the provider will retrieve the first

Run Your RMI Implementation Under Java 2

If you’re running the client or server with Java 2, then you’ll need to specify a security policy file, to prevent SecurityExceptions being thrown. This policy file will allow your application to bind to a local port (if it

Trim Multiple Spaces in a String to a Single Space

If a string has two or more consecutive spaces, this will bring them down to a single space. Private Function TrimToSingleSpace(strToTrim As String) As StringstrToTrim = Trim(strToTrim)Do Until InStr(1, strToTrim,

How to Read Client-Side Cookies From a Servlet

Reading cookies from a servlet is easy. You can gain access to any cookies sent by the browser from the javax.servlet.http.HttpServletRequest passed to the servlet’s doGet, doPost, etc methods. HttpServletResponse offers a method, and Cookies[] getCookies() returns an array of Cookie objects. // Check for cookiesCookie[] cookies = request.getCookies();// Check

No more posts to show