devxlogo

Tip Bank

Using Quotation Marks in SQL Server

The standard delimiters for literal strings in SQL are single quotation marks (‘). By default, SQL Server reserves double quotation marks (“) as delimiters for database objects.The SQL Server ODBC

Avoid NullPointerException Comparing Strings

The standard way to compare a variable String to a constant is to use this syntax: if(myString.equals(“test”)){ doSomething();} However, if myString is null, a NullPointerException will be thrown. Instead, use:

Exceptions are Objects

When a class designer believes that an exceptional condition is recoverable, the checked exception should be thrown. But, many programmers (and I am guilty of this as well) tend to

Get Browser Information

Sometimes, you need to find the Browser in which an applet is loaded. This small bit of code can do the job: public void getBrowserInfo(){ String vendor = System.getProperty(“java.vendor.url”).toLowerCase(); browser

Take advantage of COM+ object pooling

VB6 objects can’t be pooled under COM+, because they are apartment threaded. This restriction is void with VB.NET objects (and all .NET objects in general), because they are free-threaded. To