December 11, 2001

Declaring a Member Function as a Friend of Another Class

Although you can declare an entire class a friend of another class, like this: class A{ friend class B; //B has access to every member of A //..}; However, in most cases, only one or two member functions of B need such unrestricted access to A. To avoid indiscriminate access,

Displaying a Recordset in a Table with a Border

When displaying a recordset in a table with a border, if there is no data returned for a cell, the borders will not show up around that cell. To alleviate this, hard code a space (nbsp;) after each field so if no data is returned, it will still show the

Exception Restrictions when Overriding

When you extend a class and override a method, Java insists that the new method cannot be declared as throwing checked exceptions of classes other than those that were declared by the original method (in the base class). It may, however, throw exceptions derived from the base-class exceptions. This is

Using Database Transactions with JDBC

When a connection is created using JDBC, by default it is in auto-commit mode. This means that each SQL statement is treated as a transaction and will be automatically committed immediately after it is executed. Sometimes, you want a group of statements to execute together or fail together. Transactions are

Eliminate the Need to Comment/Remove Debug Statements

Often, while developing a system, you need to put a lot of debug statements in the code, all which have to be commented/removed before delivering the application. There’s a class with a static method that can be used to turn on/off debug statements without having to comment them or remove

Convert a Short Filename Into a Long Filename

You can use the Dir( ) function to return a long filename, but the return does not include path information. By parsing a given short path/filename into its constituent directories, you can use the Dir( ) function to build a long path/filename with 32-bit versions of VB, without the assistance

No more posts to show