JSP-MySQLconnection problem
Hi All
I am trying to connect from JSP page to MySQL Server, I use the following method to get connection , but it returns null.
private Connection getConnection()
{
Connection conn =null;
try
{
Class.forName("com.mysql.jdbc.Driver");
String url ="jdbc:mysql://localhost/acssDB";
String userName ="root";
String password ="pass";
conn = DriverManager.getConnection(url,userName,password);
}
catch(Exception e)
{
e.printStackTrace();
}
return conn;
}
Notes :
- When I call this method from java application, it run sucessfully.
- I use this connector mysql-connector-java-5.0.6-bin

