Welcome to the Fascinating World...

Connection Code for MySql :

<% 
String url = "jdbc:mysql://localhost:3306/databaseName";    
String user= "mysql user id"; 
String pass= "mysql password";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
Connection con = DriverManager.getConnection(url, user, pass);
Statement stmt=con.createStatement();
String st="select * from students";
ResultSet rs=stmt.executeQuery(st);
%>

Note:
Write your own Query's and execute it.
At the Ending we have to close all the Resources like connections,statements etc.