Connection con = DriverManager.getConnection()
出现如下错误:
Multiple annotations found at this line:
- DriverManager cannot be resolved
- Connection cannot be resolved to
a type怎么办.
出现如下错误:
Multiple annotations found at this line:
- DriverManager cannot be resolved
- Connection cannot be resolved to
a type怎么办.
public static Connection getConnection(String url,String user,String password),这个是此方法的定义,参数:url - jdbc:subprotocol:subname 形式的数据库 url
user - 数据库用户,连接是为该用户建立的
password - 用户的密码 。还有一个方法是getConnection(String url),但是没有楼主写的方法。楼主可以参考一下API。