devxlogo

July 21, 2001

Generating Unique Numbers

Here is sample code: import java.security.SecureRandom;public class UniqueNumberGenerator{ static final SecureRandom random = new SecureRandom(); static final StringBuffer buffer = new StringBuffer(30); static { random.nextInt(); } public static String getNextUID()

Closing JDBC ResultSet Instances Properly

Many books about JDBC and most of JDBC-related sample code floating around seems to assume that JDBC is used directly, meaning that database connection is established by the DriverManager, and

When To Use equalsIgnoreCase

The equals() method in the String class is commonly used to compare two strings for equality. However, this method returns true only if the argument is not null and is

Load a Combobox/Listbox From a Recordset

This is a fast and versatile function for loading comboboxes.I have not included a ComboBox.Clear, to make it possible to load multiple recordsets to the combobox. This makes it more

Rollback Transactions

One of the many functional methods of rolling back transaction(s) in a VB application is as follows: 1) In the procedure containing the Begintrans/CommitTrans methods, declare a Boolean Procedural variable

Extract the ID3 Tag From an MP3 File

Here is a function for extracting the ID3 tag from a MP3 file. Add the following lines of code into a Module: Public Type ID3Data Tag As String * 3