所以我只有这两行...
Class.forName("com.mysql.jdbc.Driver");
Connection connectionToSql = DriverManager.getConnection("jdbc:mysql://:localhost:3306/questions", "root", "root");
我得到例外说法:
Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "localhost:3306"'.
我该怎么办?
答案 0 :(得分:2)
在localhost
之前删除“:”