Put a copy of the mysql-connector-java-3.0.??.zip into the following directory of your jsdk, Example:
C:\j2sdk1.4.2_04\jre\lib\ext
extract the zip file and copy the jar file: mysql-connector-java-3.0.??-bin.jar into the following directory of your tomcat:
C:\jakarta-tomcat_version\common\lib
Driver and URL:
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/mydatabase?user=;password=");