guys i m really havin hard time to establish connection bet jsp n mysql...give me some tips..i ve done all the procedures required for that n i couldn execute the followin code

<%@ page import="java.sql.*" %>
String username="mahesh";
String password="mahesh";
String connectionURL = "jdbc:mysql://localhost:3306/mahesh";
Connection connection = null;
//Statement statement = null;
//ResultSet rs = null;


connection = DriverManager.getConnection(connectionURL, username, password);
//statement = connection.createStatement();
out.println("connection established");
//rs = statement.executeQuery("SELECT * FROM cust2");

/*while ( {



never bet, it doesn't pay in the long run.

never do database access from jsp, it's not what they're meant for (yes, I know it's possible but it's also possible to jump off a 50 story building).

and always use code tags.

Verify you have the MySqlConnector.jar in your Project Folder.If not download it from and add to project Folder.or Library Location of your IDE.check Whether MySql Service is running properly by Log in into MySql Client.IF Running Properly

                String  url1="jdbc:mysql://";
                Connection con1=null;
ResultSet rs=null;
                pstmt3=con1.prepareStatement("SELECT * FROM cust2");

If not Ur MySql Login has some Problem