?? listing 10-7.java
字號:
Connection Db;
Properties props = new Properties ();
try {
FileInputStream propFileStream =
new fileInputStream("DBProps.txt");
props.load(propFileStream);
}
catch(IOException err) {
System.err.print("Error loading propFile: ");
System.err.println (err.getMessage());
System.exit(1);
}
try {
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
Db = DriverManager.getConnection(url, props);
}
catch (ClassNotFoundException error) {
System.err.println("Unable to load the JDBC/ODBC bridge." +
error);
System.exit(2);
}
catch (SQLException error) {
System.err.println("Cannot connect to the database." + error);
System.exit(3);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -