MySQL Connection Error with JSP
- by voidmain
Hello,
I am trying to connect to mysql database from jsp page. The
connection code is as below
InitialContext ic=new InitialContext();
DataSource ds=(DataSource)ic.lookup("jdbc:mysql://localhost:3306/");
Connection con=ds.getConnection();
Statement stmt = con.createStatement();
when i open the page i get the following error
javax.servlet.ServletException: javax.naming.NamingException: Lookup
failed for 'jdbc:mysql://localhost:3306/' in SerialContext [Root
exception is javax.naming.NameNotFoundException: jdbc:mysql:]
can some one please tell me what is wrong with this...