You are on page 1of 1

Connection_manager.

java
public class ConnectionManager {
static Connection conn;
public static Connection getConnection() throws SQLException {
try{
String url = "jdbc:mysql://localhost:3306/caes";
String dbName ="caes";
String user="root";
String pass="root";
Class.forName("com.mysql.jdbc.Driver");
try{
conn = DriverManager.getConnection(url,user,pass);
}catch (SQLException ex){
ex.printStackTrace();
}
}catch(ClassNotFoundException e){
System.out.println(e);
}return conn;
}
}