import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.ceo.dwr.DwrCity;
import jxl.write.DateTime;
import net.sf.json.JSONArray;
//数据库连接管理
public class DataBaseManager {
private final String driver="com.mysql.jdbc.Driver";
private final String user="root";
private final String pwd="wen";
public static Connection getMysqlCon(){
//myDB为数据库名
Connection conn=null;
try {
Class.forName("com.mysql.jdbc.Driver");
String url ="jdbc:mysql://localhost:3306/sns?useUnicode=true&characterEncoding=utf-8";
conn= java.sql.DriverManager.getConnection(url, "root", "wen");
} catch (ClassNotFoundException e) {
// TODO: handle exception
e.printStackTrace();
}catch (Exception e) {
e.printStackTrace();
}
return conn;
}
}