devxlogo

August 22, 2007

Convert a java.util.Date Object to a java.sql.Date Object

The following code demonstrates how to convert a java.util.Date object to a java.sql.Date object: import java.sql.*;import java.util.*;public class cs{public static void main(String[] args) { GregorianCalendar date_1=(GregorianCalendar)Calendar.getInstance(); System.out.println(date_1.getTime()); java.sql.Date date_2= new

Using the SecureString Class

NET 2.0’s System.Security namespace includes the SecureString class, which lets you create encrypted strings and delete them from memory when they’re no longer needed. You can even make a string