import java.sql.*;import java.util.*;public class dbtest2{ static Connection conn; static Statement stmt; public static void openDB() { try { try { Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); } catch (ClassNotFoundException e) { //System.out.println(e); } conn = DriverManager.getConnection( "jdbc:microsoft:sqlserver://A121-02-w2k/uniinfo;User=web;Password=web"); stmt = conn.createStatement(); } catch ( SQLException e ) {} } public static void closeDB() { try { stmt.close(); conn.close(); } catch ( SQLException e ) {} } public static void main(String args[]) { openDB(); closeDB(); }}