?? common.java~1~
字號:
package com.bict;
import java.sql.*;
public class Common {
public static Connection getConnection(){
Connection con=null;
try{
Class.forName("org.gjt.mm.mysql.Driver");
String str="jdbc:mysql://localhost:3306/test";
con=DriverManager.getConnection(str,"root","");
}catch(Exception e){
e.printStackTrace();
}
return con;
}
public static void freeConnection (Connection con){
if(con!=null){
try {
con.close();
} catch(SQLException ex) {
ex.printStackTrace();
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -