Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
import java.sql.*;
class JdbcTest1 {
public static void main (String[] args) {
try {
// Step 1: Load the JDBC driver.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Step 2: Establish the connection to the database.
String url = "jdbc:odbc:contact_mgr";
Connection conn = DriverManager.getConnection(url,"user1","password");
Thread.currentThread.sleep(2000);
conn.close();
} catch (Exception e) {
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
}
}
}
import java.sql.*;
class JdbcTest1 {
public static void main (String[] args) {
Connection conn = null;
try {
// Step 1: Load the JDBC driver.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Step 2: Establish the connection to the database.
String url = "jdbc:odbc:contact_mgr";
conn = DriverManager.getConnection(url,"user1","password");
Thread.currentThread.sleep(2000);
} catch (Exception e) {
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
} finally {
try {
if ( conn != null )
conn.close();
} catch (SqlException ex){}
}
}
}
try {
Thread.sleep(2000);
} catch (InterruptedException ie) {
ie.printStackTrace(System.err);
}