package mypack;
import java.sql.*;
import javax.sql.*;
import javax.util.*;public class Db{
private String dbUrl= "jdbc:mysql://localhost:3306/first";
private String dbUse="root";
private String dbPwd="02";

pulic Connection getConnection()throws Exception
{
try{
Class.forName("com.mysql.jdbc.Driver");
return java.sql.DriverManager.getConnection(dbUrl,dbUser,dbPwd);
}
catch(Exception e){
e.printStackTrace();
}
}

pubic reg(String name,String psw)throws Exception
{
String sql="insert into user values('name','psw')";
PreparedStatement smtp=con.prepareStatement(sql);
smtp.executeUpdate();
}
  
public void closeConnection(Connection con)
{
try{
if(con!=null) con.close();
}
catch(Exception e){
e.printStackTrace();
}
}
}
大家帮我看看好不,哪里出了问题!
提示:
E:\Tomcat 5.5\webapps\myapp\WEB-INF\classes>javac Db.java
Db.java:11: 需要 ';'
        pulic Connection getConnection()throws Exception
                         ^
1 错误