devxlogo

July 3, 2001

Caching/Releasing JDBC Connections

It happens quite often that a JDBC connection is declared as the instance-level variable. The actual connection is then obtained at construction time. All methods of the object that need

Changing Column Types in a Table

Changing column types in a tableSQL Server does not permit you to explicitly change the datatype or length of a column. But there is a trick to get around this.

Setting Proxy in Java Code

The java.net package contains classes that deal with connections across the network. If there is a direct connection to the Internet via a modem, various classes like the HttpConnection or

Print a Stack

If you have a line in your code you are trying to debug or you don’t know how you got there, or where you came from (who called it), you

Avoiding Unnecessary Catch Blocks

The result of adding unnecessary catch blocks is code like this, where exceptions are caught and then immediately re-thrown: try { // some code here } catch (Exception e) {

Retrieve a Parent Directory From a Path

You can retrieve the parent directory from a path by identifying the first and last backslash. The start position for the first backslash should be 3 in order for it